Skip to content

Commit d0f82d4

Browse files
committed
COBRAmodels:fire:code headers:art: add tutorials
1 parent 7f21015 commit d0f82d4

19 files changed

+406
-214
lines changed

src/design/TrimGdel/GRPRchecker.m

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
1-
function [GR ,PR] = GRPRchecker(model, targetMet, givenGvalue)
1+
function [GR ,PR] = GRPRchecker(model, targetMet, gvalue)
22
% GRPRchecker calculates the maximum GR and the minimu PR
33
% under the GR maximization when a constraint-based model, a target
44
% metabolite, and a gene deletion stratety are given.
55
%
6-
% function [GR, PR]
7-
% = GRPRchecker(model, targetMet, givenGvalue)
6+
% USAGE:
87
%
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
8+
% function [GR, PR]
9+
% = GRPRchecker(model, targetMet, givenGvalue)
2110
%
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.
11+
% INPUTS:
12+
% model: COBRA model structure containing the following required fields to perform gDel_minRN.
2813
%
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.
14+
% *.rxns: Rxns in the model
15+
% *.mets: Metabolites in the model
16+
% *.genes: Genes in the model
17+
% *.grRules: Gene-protein-reaction relations in the model
18+
% *.S: Stoichiometric matrix (sparse)
19+
% *.b: RHS of Sv = b (usually zeros)
20+
% *.c: Objective coefficients
21+
% *.lb: Lower bounds for fluxes
22+
% *.ub: Upper bounds for fluxes
23+
% *.rev: Reversibility of fluxes
3424
%
35-
% Feb. 10, 2025 Takeyuki TAMURA
25+
% targetMet: target metabolites (e.g., 'btn_c')
26+
% gvalue: The first column is the list of genes in the original model.
27+
% The second column contains a 0/1 vector indicating which genes should be deleted.
28+
% 0: indicates genes to be deleted.
29+
% 1: indecates genes to be remained.
30+
%
31+
% OUTPUTS:
32+
% GR: the growth rate obained when the gene deletion strategy is
33+
% applied and the growth rate is maximized.
34+
% PR: the minimum target metabolite production rate obained
35+
% when the gene deletion strategy is applied and the growth rate is maximized.
36+
%
37+
% .. Author: - Takeyuki Tamura, Mar 06, 2025
3638
%
3739

3840

@@ -46,7 +48,7 @@
4648

4749

4850
model2 = model;
49-
[grRules0] = calculateGR(model, givenGvalue);
51+
[grRules0] = calculateGR(model, gvalue);
5052
lb2 = model.lb;
5153
ub2 = model.ub;
5254

src/design/TrimGdel/README.pdf

-165 KB
Binary file not shown.

src/design/TrimGdel/TrimGdel.m

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

7376
[gvalue gr pr it success] = gDel_minRN(model, targetMet, maxLoop, PRLB, GRLB) % Step 1

src/design/TrimGdel/calculateGR.m

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,45 @@
1-
function [grRules] = calculateGR(model, xname)
1+
function [grRules] = calculateGR(model, gvalue)
2+
% calculateGR is a function of gDel_minRN that reads
3+
% a COBRA model and a 0-1 assignment for genes and outputs whether
4+
% each reaction is repressed or not.
5+
%
6+
% USAGE:
7+
%
8+
% function [grRules] = calculateGR(model, gvalue)
9+
%
10+
% INPUTS:
11+
% model: COBRA model structure containing the following required fields to perform gDel_minRN.
12+
%
13+
% *.rxns: Rxns in the model
14+
% *.mets: Metabolites in the model
15+
% *.genes: Genes in the model
16+
% *.grRules: Gene-protein-reaction relations in the model
17+
% *.S: Stoichiometric matrix (sparse)
18+
% *.b: RHS of Sv = b (usually zeros)
19+
% *.c: Objective coefficients
20+
% *.lb: Lower bounds for fluxes
21+
% *.ub: Upper bounds for fluxes
22+
% *.rev: Reversibility of fluxes
23+
%
24+
% gvalue: 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+
% OUTPUT:
30+
% grRules: The first column is the list of GPR-rules. If a reaction does
31+
% not have a GPR-rule, it is represented as 1.
32+
% In the second columun, each gene is converted to 0 or 1 based
33+
% on the given 0-1 assignment, with AND converted to * and OR
34+
% converted to +.
35+
% The third comumn contains the calculation results from the
36+
% second column.
37+
% The fourth column is 0 if the third column is 0 and 1 if it is
38+
% greater. If it is 0, the reaction is repressed; if it is 1, it
39+
% is not repressed.
40+
%
41+
% .. Author: - Takeyuki Tamura, Mar 06, 2025
42+
%
243

344
grRules = cell(size(model.rxns));
445
for i=1:size(model.grRules, 1)
@@ -12,9 +53,9 @@
1253
grRules(:, 2) = strrep(grRules, 'or', '+');
1354
grRules(:,2) = strrep(grRules(:,2), 'and', '*');
1455

15-
[xname2, index] = sortrows(xname(:,1), 'descend');
56+
[xname2, index] = sortrows(gvalue(:,1), 'descend');
1657
for i=1:size(index, 1)
17-
sorted_gvalue(i, 1) = xname{index(i, 1), 2};
58+
sorted_gvalue(i, 1) = gvalue{index(i, 1), 2};
1859
end
1960
for i = 1:size(model.genes, 1)
2061
grRules(:, 2) = strrep(grRules(:, 2), xname2{i, 1},num2str(sorted_gvalue(i, 1)));

src/design/TrimGdel/e_coli_core.mat

-112 KB
Binary file not shown.

src/design/TrimGdel/example1.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
function [outputArg1, outputArg2] = example1()
1+
function [] = example1()
22
% example1 calculates the gene deletion strategy for growth coupling
33
% for succinate in e_coli_core.
44
%
5-
% Feb. 6, 2025 Takeyuki TAMURA
5+
% USAGE:
66
%
7+
% function [] = example1()
8+
%
9+
% .. Author: - Takeyuki Tamura, Mar 05, 2025
10+
%
11+
712

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

src/design/TrimGdel/example2.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
function [outputArg1, outputArg2] = example2()
22
% example2 calculates the gene deletion strategy for growth coupling
33
% for biotin in iML1515.
4+
%
5+
% USAGE:
46
%
5-
% Feb. 6, 2025 Takeyuki TAMURA
7+
% function [] = example2()
8+
%
9+
% .. Author: - Takeyuki Tamura, Mar 06, 2025
610
%
711

812
load('iML1515.mat');

src/design/TrimGdel/example3.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
function [outputArg1, outputArg2] = example3()
22
% example3 calculates the gene deletion strategy for growth coupling
33
% for riboflavin in iML1515.
4+
%
5+
% USAGE:
46
%
5-
% Feb. 6, 2025 Takeyuki TAMURA
7+
% function [] = example3()
8+
%
9+
% .. Author: - Takeyuki Tamura, Mar 06, 2025
610
%
711

812
load('iML1515.mat');

src/design/TrimGdel/example4.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
function [outputArg1, outputArg2] = exampl4()
22
% example4 calculates the gene deletion strategy for growth coupling
33
% for pantothenate in iML1515.
4+
%
5+
% USAGE:
46
%
5-
% Feb. 6, 2025 Takeyuki TAMURA
7+
% function [] = example4()
8+
%
9+
% .. Author: - Takeyuki Tamura, Mar 06, 2025
610
%
711

812
load('iML1515.mat');

src/design/TrimGdel/example5.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
function [outputArg1, outputArg2] = example5()
22
% example5 calculates the gene deletion strategy for growth coupling
33
% for succinate in iMM904.
4+
%
5+
% USAGE:
46
%
5-
% Feb. 6, 2025 Takeyuki TAMURA
7+
% function [] = example5()
8+
%
9+
% .. Author: - Takeyuki Tamura, Mar 06, 2025
610
%
711

812
load('iMM904.mat');

0 commit comments

Comments
 (0)