Skip to content

Commit bbf364d

Browse files
committed
TrimGdel, tested under Gurobi12.0 and MATLAB2024b, is added.
1 parent 1dca42f commit bbf364d

20 files changed

+1052
-1
lines changed

src/design/TrimGdel/GRPRchecker.m

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
function [GR ,PR] = GRPRchecker(model,targetMet,givenGvalue)
2+
3+
[model,targetRID,extype] = modelSetting(model,targetMet)
4+
5+
m=size(model.mets,1);
6+
n=size(model.rxns,1);
7+
g=size(model.genes,1);
8+
gid=find(model.c);
9+
pid=targetRID;
10+
11+
12+
model2=model;
13+
[grRules0] = calculateGR(model,givenGvalue);
14+
lb2=model.lb;
15+
ub2=model.ub;
16+
17+
for i=1:n
18+
if grRules0{i,4}==0
19+
lb2(i)=0;
20+
ub2(i)=0;
21+
end
22+
end
23+
24+
gm.A=sparse(model.S);
25+
gm.obj=-model.c;
26+
gm.modelsense='Min';
27+
gm.sense=repmat('=',1,size(model.S,1));
28+
gm.lb=lb2;
29+
gm.ub=ub2;
30+
opt0=gurobi(gm);
31+
32+
[opt0.x(gid) opt0.x(pid)]
33+
34+
GR0=-opt0.objval;
35+
lb2(gid)=GR0;
36+
ub2(gid)=GR0;
37+
model2.c(gid)=0;
38+
model2.c(pid)=1;
39+
40+
gm2.A=sparse(model.S);
41+
gm2.obj=model2.c;
42+
gm2.modelsense='Min';
43+
gm2.sense=repmat('=',1,size(model.S,1));
44+
gm2.lb=lb2;
45+
gm2.ub=ub2;
46+
opt1=gurobi(gm2);
47+
48+
GR=GR0
49+
PR=opt1.x(pid)
50+
[GR PR]
51+
52+
return;
53+
end
54+

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+

0 commit comments

Comments
 (0)