@@ -86,49 +86,54 @@ <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" sr
86860022 < span class ="comment "> % Usage: smallEcModel = getSubsetEcModel(smallGEM,bigEcModel)</ span >
87870023
88880024 < span class ="comment "> % Check if models were derived from the same starting GEM</ span >
89- 0025 rxnsDiff = find(~ismember(smallGEM.rxns,bigEcModel.rxns));
90- 0026 < span class ="keyword "> if</ span > numel(rxnsDiff) > 0
91- 0027 dispEM([< span class ="string "> 'While both models should have derived from the same starting '</ span > ,< span class ="keyword "> ...</ span >
92- 0028 < span class ="string "> 'GEM, the following reactions from smallGEM could not be found '</ span > ,< span class ="keyword "> ...</ span >
93- 0029 < span class ="string "> 'in bigEcModel:'</ span > ],true,smallGEM.rxns(rxnsDiff),false);
94- 0030 < span class ="keyword "> end</ span >
95- 0031
96- 0032 < span class ="comment "> % Check if original bigEcModel contains context-dependent protein constraints</ span >
97- 0033 < span class ="keyword "> if</ span > any(bigEcModel.lb(startsWith(bigEcModel.rxns,< span class ="string "> 'usage_prot_'</ span > )) ~= -1000)
98- 0034 printOrange([< span class ="string "> 'WARNING: The bigEcModel is constraint by protein concentrations that are\n'</ span > < span class ="keyword "> ...</ span >
99- 0035 < span class ="string "> 'likely not relevant in the constructed smallEcModel.\n'</ span > ]);
100- 0036 < span class ="keyword "> end</ span >
101- 0037
102- 0038 < span class ="comment "> % Remove genes (and associated reactions) that are absent in smallGEM</ span >
103- 0039 genesToRemove = setdiff(bigEcModel.genes,smallGEM.genes);
104- 0040 smallEcModel = removeGenes(bigEcModel,genesToRemove,true,true,false);
105- 0041
106- 0042 < span class ="comment "> % Remove genes from ec-structure</ span >
107- 0043 enzToRemove = ismember(smallEcModel.ec.genes,genesToRemove);
108- 0044 smallEcModel.ec.genes(enzToRemove) = [];
109- 0045 smallEcModel.ec.enzymes(enzToRemove) = [];
110- 0046 smallEcModel.ec.concs(enzToRemove) = [];
111- 0047 smallEcModel.ec.mw(enzToRemove) = [];
112- 0048 smallEcModel.ec.sequence(enzToRemove) = [];
113- 0049 smallEcModel.ec.rxnEnzMat(:,enzToRemove) = [];
114- 0050
115- 0051 < span class ="comment "> % Remove any reaction (except prot_ associated) that is absent from smallGEM</ span >
116- 0052 trimRxns = regexprep(smallEcModel.rxns,< span class ="string "> '_REV|_EXP_\d+'</ span > ,< span class ="string "> ''</ span > );
117- 0053 protRxns = startsWith(smallEcModel.rxns,{< span class ="string "> 'usage_prot_'</ span > ,< span class ="string "> 'prot_pool_exchange'</ span > });
118- 0054 keepRxns = ismember(trimRxns,smallGEM.rxns) | protRxns;
119- 0055 smallEcModel = removeReactions(smallEcModel,~keepRxns, true, true, true);
120- 0056
121- 0057 < span class ="comment "> % Remove reactions from ec-structure</ span >
122- 0058 ecRxnsToRemove = ~ismember(smallEcModel.ec.rxns,smallEcModel.rxns);
123- 0059
124- 0060 smallEcModel.ec.rxns(ecRxnsToRemove) = [];
125- 0061 smallEcModel.ec.kcat(ecRxnsToRemove) = [];
126- 0062 smallEcModel.ec.source(ecRxnsToRemove) = [];
127- 0063 smallEcModel.ec.notes(ecRxnsToRemove) = [];
128- 0064 smallEcModel.ec.eccodes(ecRxnsToRemove) = [];
129- 0065 smallEcModel.ec.rxnEnzMat(ecRxnsToRemove,:) = [];
130- 0066 < span class ="keyword "> end</ span >
131- 0067</ pre > </ div >
89+ 0025 Rxn_format = regexprep(bigEcModel.rxns,< span class ="string "> '_REV|_EXP_\d+'</ span > ,< span class ="string "> ''</ span > );
90+ 0026 rxnsDiff = find(~ismember(smallGEM.rxns,Rxn_format));
91+ 0027 < span class ="keyword "> if</ span > numel(rxnsDiff) > 0
92+ 0028 dispEM([< span class ="string "> 'While both models should have derived from the same starting '</ span > ,< span class ="keyword "> ...</ span >
93+ 0029 < span class ="string "> 'GEM, the following reactions from smallGEM could not be found '</ span > ,< span class ="keyword "> ...</ span >
94+ 0030 < span class ="string "> 'in bigEcModel:'</ span > ],true,smallGEM.rxns(rxnsDiff),false);
95+ 0031 < span class ="keyword "> end</ span >
96+ 0032
97+ 0033 < span class ="comment "> % Check if original bigEcModel contains context-dependent protein constraints</ span >
98+ 0034 < span class ="keyword "> if</ span > any(bigEcModel.lb(startsWith(bigEcModel.rxns,< span class ="string "> 'usage_prot_'</ span > )) ~= -1000)
99+ 0035 printOrange([< span class ="string "> 'WARNING: The bigEcModel is constraint by protein concentrations that are\n'</ span > < span class ="keyword "> ...</ span >
100+ 0036 < span class ="string "> 'likely not relevant in the constructed smallEcModel.\n'</ span > ]);
101+ 0037 < span class ="keyword "> end</ span >
102+ 0038
103+ 0039 < span class ="comment "> % Remove genes (and associated reactions) that are absent in smallGEM</ span >
104+ 0040 genesToRemove = setdiff(bigEcModel.genes,smallGEM.genes);
105+ 0041 < span class ="comment "> % If genesToRemove contains "standard", then remove this entry</ span >
106+ 0042 < span class ="keyword "> if</ span > ismember(< span class ="string "> 'standard'</ span > , genesToRemove)
107+ 0043 genesToRemove(strcmp(genesToRemove, < span class ="string "> 'standard'</ span > )) = [];
108+ 0044 < span class ="keyword "> end</ span >
109+ 0045 smallEcModel = removeGenes(bigEcModel,genesToRemove,true,true,false);
110+ 0046
111+ 0047 < span class ="comment "> % Remove genes from ec-structure</ span >
112+ 0048 enzToRemove = ismember(smallEcModel.ec.genes,genesToRemove);
113+ 0049 smallEcModel.ec.genes(enzToRemove) = [];
114+ 0050 smallEcModel.ec.enzymes(enzToRemove) = [];
115+ 0051 smallEcModel.ec.concs(enzToRemove) = [];
116+ 0052 smallEcModel.ec.mw(enzToRemove) = [];
117+ 0053 smallEcModel.ec.sequence(enzToRemove) = [];
118+ 0054 smallEcModel.ec.rxnEnzMat(:,enzToRemove) = [];
119+ 0055
120+ 0056 < span class ="comment "> % Remove any reaction (except prot_ associated) that is absent from smallGEM</ span >
121+ 0057 trimRxns = regexprep(smallEcModel.rxns,< span class ="string "> '_REV|_EXP_\d+'</ span > ,< span class ="string "> ''</ span > );
122+ 0058 protRxns = startsWith(smallEcModel.rxns,{< span class ="string "> 'usage_prot_'</ span > ,< span class ="string "> 'prot_pool_exchange'</ span > });
123+ 0059 keepRxns = ismember(trimRxns,smallGEM.rxns) | protRxns;
124+ 0060 smallEcModel = removeReactions(smallEcModel,~keepRxns, true, true, true);
125+ 0061
126+ 0062 < span class ="comment "> % Remove reactions from ec-structure</ span >
127+ 0063 ecRxnsToRemove = ~ismember(smallEcModel.ec.rxns,smallEcModel.rxns);
128+ 0064
129+ 0065 smallEcModel.ec.rxns(ecRxnsToRemove) = [];
130+ 0066 smallEcModel.ec.kcat(ecRxnsToRemove) = [];
131+ 0067 smallEcModel.ec.source(ecRxnsToRemove) = [];
132+ 0068 smallEcModel.ec.notes(ecRxnsToRemove) = [];
133+ 0069 smallEcModel.ec.eccodes(ecRxnsToRemove) = [];
134+ 0070 smallEcModel.ec.rxnEnzMat(ecRxnsToRemove,:) = [];
135+ 0071 < span class ="keyword "> end</ span >
136+ 0072</ pre > </ div >
132137< hr > < address > Generated by < strong > < a href ="http://www.artefact.tk/software/matlab/m2html/ " title ="Matlab Documentation in HTML "> m2html</ a > </ strong > © 2005</ address >
133138</ body >
134139</ html >
0 commit comments