Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop algorithms for gene deletion strategies for growth-coupled production #2427

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions src/design/TrimGdel/GRPRchecker.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
function [GR ,PR] = GRPRchecker(model, targetMet, gvalue)
% GRPRchecker calculates the maximum GR and the minimu PR
% under the GR maximization when a constraint-based model, a target
% metabolite, and a gene deletion stratety are given.
%
% USAGE:
%
% function [GR, PR]
% = GRPRchecker(model, targetMet, givenGvalue)
%
% INPUTS:
% model: COBRA model structure containing the following required fields to perform gDel_minRN.
%
% *.rxns: Rxns in the model
% *.mets: Metabolites in the model
% *.genes: Genes in the model
% *.grRules: Gene-protein-reaction relations in the model
% *.S: Stoichiometric matrix (sparse)
% *.b: RHS of Sv = b (usually zeros)
% *.c: Objective coefficients
% *.lb: Lower bounds for fluxes
% *.ub: Upper bounds for fluxes
% *.rev: Reversibility of fluxes
%
% targetMet: target metabolites (e.g., 'btn_c')
% gvalue: The first column is the list of genes in the original model.
% The second column contains a 0/1 vector indicating which genes should be deleted.
% 0: indicates genes to be deleted.
% 1: indecates genes to be remained.
%
% OUTPUTS:
% GR: the growth rate obained when the gene deletion strategy is
% applied and the growth rate is maximized.
% PR: the minimum target metabolite production rate obained
% when the gene deletion strategy is applied and the growth rate is maximized.
%
% .. Author: - Takeyuki Tamura, Mar 06, 2025
%


[model, targetRID, extype] = modelSetting(model, targetMet);

m = size(model.mets, 1);
n = size(model.rxns, 1);
g = size(model.genes, 1);
gid = find(model.c);
pid = targetRID;


model2 = model;
[grRules0] = calculateGR(model, gvalue);
lb2 = model.lb;
ub2 = model.ub;

for i=1:n
if grRules0{i, 4} == 0
lb2(i) = 0;
ub2(i) = 0;
end
end

gm.A = sparse(model.S);
gm.obj = -model.c;
gm.modelsense = 'Min';
gm.sense = repmat('=', 1, size(model.S, 1));
gm.lb = lb2;
gm.ub = ub2;
opt0 = gurobi(gm);

[opt0.x(gid) opt0.x(pid)]

GR0 = -opt0.objval;
lb2(gid) = GR0;
ub2(gid) = GR0;
model2.c(gid) = 0;
model2.c(pid) = 1;

gm2.A = sparse(model.S);
gm2.obj = model2.c;
gm2.modelsense = 'Min';
gm2.sense = repmat('=', 1, size(model.S, 1));
gm2.lb = lb2;
gm2.ub = ub2;
opt1 = gurobi(gm2);

GR = GR0
PR = opt1.x(pid)
[GR PR]

return;
end

89 changes: 89 additions & 0 deletions src/design/TrimGdel/TrimGdel.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
function [gvalue, GR, PR, size1, size2, size3, success] = TrimGdel(model, targetMet, maxLoop, PRLB, GRLB)
% TrimGdel appropriately considers GPR rules and determines
% a minimal gene deletion strategies to achieve growth-coupled production
% for a given target metabolite and a genome-scale model.
% even in the worst-case analysis (ensures the weak-growth-coupled production).
%
% Gurobi is required for this version.
% The CPLEX version is available on https://github.com/MetNetComp/TrimGdel
%
% USAGE:
%
% function [gvalue, GR, PR, size1, size2, size3, success]
% = TrimGdel(model, targetMet, maxLoop, PRLB, GRLB)
%
% INPUTS:
% model: COBRA model structure containing the following required fields to perform gDel_minRN.
%
% *.rxns: Rxns in the model
% *.mets: Metabolites in the model
% *.genes: Genes in the model
% *.grRules: Gene-protein-reaction relations in the model
% *.S: Stoichiometric matrix (sparse)
% *.b: RHS of Sv = b (usually zeros)
% *.c: Objective coefficients
% *.lb: Lower bounds for fluxes
% *.ub: Upper bounds for fluxes
% *.rev: Reversibility of fluxes
%
% targetMet: target metabolites (e.g., 'btn_c')
% maxLoop: the maximum number of iterations in gDel_minRN
% PRLB: the minimum required production rates of the target metabolites
% when gDel-minRN searches the gene deletion
% strategy candidates.
% (But it is not ensured to achieve this minimum required value
% when GR is maximized withoug PRLB.)
% GRLB: the minimum required growth rate
% when gDel-minRN searches the gene deletion
% strategy candidates.
%
% OUTPUTS:
% gvalue: a small gene deletion strategy (obtained by TrimGdel).
% The first column is the list of genes.
% The second column is a 0/1 vector indicating which genes should be deleted.
% 0: indicates genes to be deleted.
% 1: indecates genes to be remained.
% GR: the maximum growth rate when the obtained gene deletion
% strategy represented by gvalue is applied.
% PR: the minimum production rate of the target metabolite under
% the maximization of the growth rate when the obtained gene deletion
% strategy represented by gvalue is applied.
% size1: the number of gene deletions after Step1.
% size2: the number of gene deletions after Step2.
% size3: the number of gene deletions after Step3.
% success: indicates whether TrimGdel obained an appropriate gene
% deletion strategy. (1:success, 0:failure)
%
% NOTE:
%
% T. Tamura, "Trimming Gene Deletion Strategies for Growth-Coupled
% Production in Constraint-Based Metabolic Networks: TrimGdel,"
% in IEEE/ACM Transactions on Computational Biology and Bioinformatics,
% vol. 20, no. 2, pp. 1540-1549, 2023.
%
% Comprehensive computational results are accumulated in MetNetComp
% database.
% https://metnetcomp.github.io/database1/indexFiles/index.html
%
% T. Tamura, "MetNetComp: Database for Minimal and Maximal Gene-Deletion Strategies
% for Growth-Coupled Production of Genome-Scale Metabolic Networks,"
% in IEEE/ACM Transactions on Computational Biology and Bioinformatics,
% vol. 20, no. 6, pp. 3748-3758, 2023,
%
% .. Author: - Takeyuki Tamura, Mar 06, 2025
%

[gvalue gr pr it success] = gDel_minRN(model, targetMet, maxLoop, PRLB, GRLB) % Step 1
if success
[gvalue, GR, PR, size1, size2, size3] = step2and3(model, targetMet, gvalue) % Step 2 and 3
else
gvalue = [];
GR = 0;
PR = 0;
size1 = 0;
size2 = 0;
size3 = 0;
end

end

77 changes: 77 additions & 0 deletions src/design/TrimGdel/calculateGR.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
function [grRules] = calculateGR(model, gvalue)
% calculateGR is a function of gDel_minRN that reads
% a COBRA model and a 0-1 assignment for genes and outputs whether
% each reaction is repressed or not.
%
% USAGE:
%
% function [grRules] = calculateGR(model, gvalue)
%
% INPUTS:
% model: COBRA model structure containing the following required fields to perform gDel_minRN.
%
% *.rxns: Rxns in the model
% *.mets: Metabolites in the model
% *.genes: Genes in the model
% *.grRules: Gene-protein-reaction relations in the model
% *.S: Stoichiometric matrix (sparse)
% *.b: RHS of Sv = b (usually zeros)
% *.c: Objective coefficients
% *.lb: Lower bounds for fluxes
% *.ub: Upper bounds for fluxes
% *.rev: Reversibility of fluxes
%
% gvalue: The first column is the list of genes in the original model.
% The second column contains a 0/1 vector indicating which genes should be deleted.
% 0: indicates genes to be deleted.
% 1: indecates genes to be remained.
%
% OUTPUT:
% grRules: The first column is the list of GPR-rules. If a reaction does
% not have a GPR-rule, it is represented as 1.
% In the second columun, each gene is converted to 0 or 1 based
% on the given 0-1 assignment, with AND converted to * and OR
% converted to +.
% The third comumn contains the calculation results from the
% second column.
% The fourth column is 0 if the third column is 0 and 1 if it is
% greater. If it is 0, the reaction is repressed; if it is 1, it
% is not repressed.
%
% .. Author: - Takeyuki Tamura, Mar 06, 2025
%

grRules = cell(size(model.rxns));
for i=1:size(model.grRules, 1)
grRules{i, 1} = model.grRules{i,1};
end
for i = 1:size(model.rxns, 1)
if isempty(grRules{i, 1})==1
grRules{i,1} = '1';
end
end
grRules(:, 2) = strrep(grRules, 'or', '+');
grRules(:,2) = strrep(grRules(:,2), 'and', '*');

[xname2, index] = sortrows(gvalue(:,1), 'descend');
for i=1:size(index, 1)
sorted_gvalue(i, 1) = gvalue{index(i, 1), 2};
end
for i = 1:size(model.genes, 1)
grRules(:, 2) = strrep(grRules(:, 2), xname2{i, 1},num2str(sorted_gvalue(i, 1)));
end
for i = 1:size(grRules, 1)
%i
if isempty(grRules{i, 2}) == 0
grRules{i, 3} = eval(grRules{i, 2});
if grRules{i, 3} > 0.9
grRules{i, 4} = 1;
else
grRules{i, 4} = 0;
end
else
grRules{i, 4} = -1;
end
end
end

19 changes: 19 additions & 0 deletions src/design/TrimGdel/example1.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
function [] = example1()
% example1 calculates the gene deletion strategy for growth coupling
% for succinate in e_coli_core.
%
% USAGE:
%
% function [] = example1()
%
% .. Author: - Takeyuki Tamura, Mar 05, 2025
%


load('e_coli_core.mat');
model = e_coli_core;

[gvalue, GR, PR, size1, size2, size3, success] = TrimGdel(model, 'succ_e', 10, 0.1, 0.1)

end

17 changes: 17 additions & 0 deletions src/design/TrimGdel/example2.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
function [outputArg1, outputArg2] = example2()
% example2 calculates the gene deletion strategy for growth coupling
% for biotin in iML1515.
%
% USAGE:
%
% function [] = example2()
%
% .. Author: - Takeyuki Tamura, Mar 06, 2025
%

load('iML1515.mat');
model = iML1515;
[gvalue, GR, PR, size1, size2, size3, success] = TrimGdel(model, 'btn_c', 10, 0.1, 0.1)

end

18 changes: 18 additions & 0 deletions src/design/TrimGdel/example3.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function [outputArg1, outputArg2] = example3()
% example3 calculates the gene deletion strategy for growth coupling
% for riboflavin in iML1515.
%
% USAGE:
%
% function [] = example3()
%
% .. Author: - Takeyuki Tamura, Mar 06, 2025
%

load('iML1515.mat');
model = iML1515;

[gvalue, GR, PR, size1, size2, size3, success] = TrimGdel(model, 'ribflv_c', 10, 0.1, 0.1)

end

18 changes: 18 additions & 0 deletions src/design/TrimGdel/example4.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function [outputArg1, outputArg2] = exampl4()
% example4 calculates the gene deletion strategy for growth coupling
% for pantothenate in iML1515.
%
% USAGE:
%
% function [] = example4()
%
% .. Author: - Takeyuki Tamura, Mar 06, 2025
%

load('iML1515.mat');
model = iML1515;

[gvalue, GR, PR, size1, size2, size3, success] = TrimGdel(model, 'pnto__R_c', 10, 0.1, 0.1)

end

18 changes: 18 additions & 0 deletions src/design/TrimGdel/example5.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function [outputArg1, outputArg2] = example5()
% example5 calculates the gene deletion strategy for growth coupling
% for succinate in iMM904.
%
% USAGE:
%
% function [] = example5()
%
% .. Author: - Takeyuki Tamura, Mar 06, 2025
%

load('iMM904.mat');
model = iMM904;

[gvalue, GR, PR, size1, size2, size3, success] = TrimGdel(model, 'succ_e', 10, 0.1, 0.1)

end

Loading