Skip to content

Commit cbfa3f1

Browse files
committed
TrimGdel folder is added to ~/src/design/
1 parent 0216fec commit cbfa3f1

18 files changed

+1090
-0
lines changed

src/design/TrimGdel/GRPRchecker.m

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
function [GR ,PR] = GRPRchecker(model, targetMet, givenGvalue)
2+
% GRPRchecker calculates the maximum GR and the minimu PR
3+
% under the GR maximization when a constraint-based model, a target
4+
% metabolite, and a gene deletion stratety are given.
5+
%
6+
% function [GR, PR]
7+
% = GRPRchecker(model, targetMet, givenGvalue)
8+
%
9+
% INPUTS
10+
% model COBRA model structure containing the following required fields to perform gDel_minRN.
11+
% rxns Rxns in the model
12+
% mets Metabolites in the model
13+
% genes Genes in the model
14+
% grRules Gene-protein-reaction relations in the model
15+
% S Stoichiometric matrix (sparse)
16+
% b RHS of Sv = b (usually zeros)
17+
% c Objective coefficients
18+
% lb Lower bounds for fluxes
19+
% ub Upper bounds for fluxes
20+
% rev Reversibility of fluxes
21+
%
22+
% targetMet target metabolites
23+
% (e.g., 'btn_c')
24+
% givenGvalue The first column is the list of genes in the original model.
25+
% The second column contains a 0/1 vector indicating which genes should be deleted.
26+
% 0 indicates genes to be deleted.
27+
% 1 indecates genes to be remained.
28+
%
29+
% OUTPUTS
30+
% GR the growth rate obained when the gene deletion strategy is
31+
% applied and the growth rate is maximized.
32+
% PR the minimum target metabolite production rate obained
33+
% when the gene deletion strategy is applied and the growth rate is maximized.
34+
%
35+
% Feb. 10, 2025 Takeyuki TAMURA
36+
%
37+
38+
39+
[model, targetRID, extype] = modelSetting(model, targetMet);
40+
41+
m = size(model.mets, 1);
42+
n = size(model.rxns, 1);
43+
g = size(model.genes, 1);
44+
gid = find(model.c);
45+
pid = targetRID;
46+
47+
48+
model2 = model;
49+
[grRules0] = calculateGR(model, givenGvalue);
50+
lb2 = model.lb;
51+
ub2 = model.ub;
52+
53+
for i=1:n
54+
if grRules0{i, 4} == 0
55+
lb2(i) = 0;
56+
ub2(i) = 0;
57+
end
58+
end
59+
60+
gm.A = sparse(model.S);
61+
gm.obj = -model.c;
62+
gm.modelsense = 'Min';
63+
gm.sense = repmat('=', 1, size(model.S, 1));
64+
gm.lb = lb2;
65+
gm.ub = ub2;
66+
opt0 = gurobi(gm);
67+
68+
[opt0.x(gid) opt0.x(pid)]
69+
70+
GR0 = -opt0.objval;
71+
lb2(gid) = GR0;
72+
ub2(gid) = GR0;
73+
model2.c(gid) = 0;
74+
model2.c(pid) = 1;
75+
76+
gm2.A = sparse(model.S);
77+
gm2.obj = model2.c;
78+
gm2.modelsense = 'Min';
79+
gm2.sense = repmat('=', 1, size(model.S, 1));
80+
gm2.lb = lb2;
81+
gm2.ub = ub2;
82+
opt1 = gurobi(gm2);
83+
84+
GR = GR0
85+
PR = opt1.x(pid)
86+
[GR PR]
87+
88+
return;
89+
end
90+

src/design/TrimGdel/README.pdf

165 KB
Binary file not shown.

src/design/TrimGdel/TrimGdel.m

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
function [gvalue, GR, PR, size1, size2, size3, success] = TrimGdel(model, targetMet, maxLoop, PRLB, GRLB)
2+
%
3+
% TrimGdel appropriately considers GPR rules and determines
4+
% a minimal gene deletion strategies to achieve growth-coupled production
5+
% for a given target metabolite and a genome-scale model.
6+
% even in the worst-case analysis (ensures the weak-growth-coupled production).
7+
%
8+
% Gurobi is required for this version.
9+
% The CPLEX version is available on https://github.com/MetNetComp/TrimGdel
10+
%
11+
% function [gvalue, GR, PR, size1, size2, size3, success]
12+
% = TrimGdel(model, targetMet, maxLoop, PRLB, GRLB)
13+
%
14+
% INPUTS
15+
% model COBRA model structure containing the following required fields to perform gDel_minRN.
16+
% rxns Rxns in the model
17+
% mets Metabolites in the model
18+
% genes Genes in the model
19+
% grRules Gene-protein-reaction relations in the model
20+
% S Stoichiometric matrix (sparse)
21+
% b RHS of Sv = b (usually zeros)
22+
% c Objective coefficients
23+
% lb Lower bounds for fluxes
24+
% ub Upper bounds for fluxes
25+
% rev Reversibility of fluxes
26+
%
27+
% targetMet target metabolites
28+
% (e.g., 'btn_c')
29+
% maxLoop the maximum number of iterations in gDel_minRN
30+
% PRLB the minimum required production rates of the target metabolites
31+
% when gDel-minRN searches the gene deletion
32+
% strategy candidates.
33+
% (But it is not ensured to achieve this minimum required value
34+
% when GR is maximized withoug PRLB.)
35+
% GRLB the minimum required growth rate
36+
% when gDel-minRN searches the gene deletion
37+
% strategy candidates.
38+
%
39+
% OUTPUTS
40+
% gvalue a small gene deletion strategy (obtained by TrimGdel).
41+
% The first column is the list of genes.
42+
% The second column is a 0/1 vector indicating which genes should be deleted.
43+
% 0 indicates genes to be deleted.
44+
% 1 indecates genes to be remained.
45+
% GR the maximum growth rate when the obtained gene deletion
46+
% strategy represented by gvalue is applied.
47+
% PR the minimum production rate of the target metabolite under
48+
% the maximization of the growth rate when the obtained gene deletion
49+
% strategy represented by gvalue is applied.
50+
% size1 the number of gene deletions after Step1.
51+
% size2 the number of gene deletions after Step2.
52+
% size3 the number of gene deletions after Step3.
53+
% success indicates whether TrimGdel obained an appropriate gene
54+
% deletion strategy. (1:success, 0:failure)
55+
%
56+
% T. Tamura, "Trimming Gene Deletion Strategies for Growth-Coupled
57+
% Production in Constraint-Based Metabolic Networks: TrimGdel,"
58+
% in IEEE/ACM Transactions on Computational Biology and Bioinformatics,
59+
% vol. 20, no. 2, pp. 1540-1549, 2023.
60+
%
61+
% Comprehensive computational results are accumulated in MetNetComp
62+
% database.
63+
% https://metnetcomp.github.io/database1/indexFiles/index.html
64+
%
65+
% T. Tamura, "MetNetComp: Database for Minimal and Maximal Gene-Deletion Strategies
66+
% for Growth-Coupled Production of Genome-Scale Metabolic Networks,"
67+
% in IEEE/ACM Transactions on Computational Biology and Bioinformatics,
68+
% vol. 20, no. 6, pp. 3748-3758, 2023,
69+
%
70+
% Feb. 6, 2025 Takeyuki TAMURA
71+
%
72+
73+
[gvalue gr pr it success] = gDel_minRN(model, targetMet, maxLoop, PRLB, GRLB) % Step 1
74+
if success
75+
[gvalue, GR, PR, size1, size2, size3] = step2and3(model, targetMet, gvalue) % Step 2 and 3
76+
else
77+
gvalue = [];
78+
GR = 0;
79+
PR = 0;
80+
size1 = 0;
81+
size2 = 0;
82+
size3 = 0;
83+
end
84+
85+
end
86+

src/design/TrimGdel/calculateGR.m

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
function [grRules] = calculateGR(model, xname)
2+
3+
grRules = cell(size(model.rxns));
4+
for i=1:size(model.grRules, 1)
5+
grRules{i, 1} = model.grRules{i,1};
6+
end
7+
for i = 1:size(model.rxns, 1)
8+
if isempty(grRules{i, 1})==1
9+
grRules{i,1} = '1';
10+
end
11+
end
12+
grRules(:, 2) = strrep(grRules, 'or', '+');
13+
grRules(:,2) = strrep(grRules(:,2), 'and', '*');
14+
15+
[xname2, index] = sortrows(xname(:,1), 'descend');
16+
for i=1:size(index, 1)
17+
sorted_gvalue(i, 1) = xname{index(i, 1), 2};
18+
end
19+
for i = 1:size(model.genes, 1)
20+
grRules(:, 2) = strrep(grRules(:, 2), xname2{i, 1},num2str(sorted_gvalue(i, 1)));
21+
end
22+
for i = 1:size(grRules, 1)
23+
%i
24+
if isempty(grRules{i, 2}) == 0
25+
grRules{i, 3} = eval(grRules{i, 2});
26+
if grRules{i, 3} > 0.9
27+
grRules{i, 4} = 1;
28+
else
29+
grRules{i, 4} = 0;
30+
end
31+
else
32+
grRules{i, 4} = -1;
33+
end
34+
end
35+
end
36+

src/design/TrimGdel/e_coli_core.mat

112 KB
Binary file not shown.

src/design/TrimGdel/example1.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function [outputArg1, outputArg2] = example1()
2+
% example1 calculates the gene deletion strategy for growth coupling
3+
% for succinate in e_coli_core.
4+
%
5+
% Feb. 6, 2025 Takeyuki TAMURA
6+
%
7+
8+
load('e_coli_core.mat');
9+
model = e_coli_core;
10+
11+
[gvalue, GR, PR, size1, size2, size3, success] = TrimGdel(model, 'succ_e', 10, 0.1, 0.1)
12+
13+
end
14+

src/design/TrimGdel/example2.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
function [outputArg1, outputArg2] = example2()
2+
% example2 calculates the gene deletion strategy for growth coupling
3+
% for biotin in iML1515.
4+
%
5+
% Feb. 6, 2025 Takeyuki TAMURA
6+
%
7+
8+
load('iML1515.mat');
9+
model = iML1515;
10+
[gvalue, GR, PR, size1, size2, size3, success] = TrimGdel(model, 'btn_c', 10, 0.1, 0.1)
11+
12+
end
13+

src/design/TrimGdel/example3.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function [outputArg1, outputArg2] = example3()
2+
% example3 calculates the gene deletion strategy for growth coupling
3+
% for riboflavin in iML1515.
4+
%
5+
% Feb. 6, 2025 Takeyuki TAMURA
6+
%
7+
8+
load('iML1515.mat');
9+
model = iML1515;
10+
11+
[gvalue, GR, PR, size1, size2, size3, success] = TrimGdel(model, 'ribflv_c', 10, 0.1, 0.1)
12+
13+
end
14+

src/design/TrimGdel/example4.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function [outputArg1, outputArg2] = exampl4()
2+
% example4 calculates the gene deletion strategy for growth coupling
3+
% for pantothenate in iML1515.
4+
%
5+
% Feb. 6, 2025 Takeyuki TAMURA
6+
%
7+
8+
load('iML1515.mat');
9+
model = iML1515;
10+
11+
[gvalue, GR, PR, size1, size2, size3, success] = TrimGdel(model, 'pnto__R_c', 10, 0.1, 0.1)
12+
13+
end
14+

src/design/TrimGdel/example5.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function [outputArg1, outputArg2] = example5()
2+
% example5 calculates the gene deletion strategy for growth coupling
3+
% for succinate in iMM904.
4+
%
5+
% Feb. 6, 2025 Takeyuki TAMURA
6+
%
7+
8+
load('iMM904.mat');
9+
model = iMM904;
10+
11+
[gvalue, GR, PR, size1, size2, size3, success] = TrimGdel(model, 'succ_e', 10, 0.1, 0.1)
12+
13+
end
14+

0 commit comments

Comments
 (0)