getSubset_ecModel Generate a context-specific ecModel (strain/cell-line/tissue) by mapping reactions and genes from a conventional context-specific GEM to a general ecModel (bigEcModel), to yield a context-specific ecModel. Both models (bigEcModel and the smallGEM) should have derived from the same starting model. If an ecModel with human-GEM 1.15.0 is made (yielding the bigEcModel), then human-GEM 1.15.0 should also be the basis from which the context-specific GEM (smallGEM) was generated by for instance tINIT. Input: bigEcModel enzyme-constrained version of conventional model of metabolism for a given species smallGEM Reduced model (subset of the general model) for a specific strain (microbes) or cell-line/tissues (mammals) Output: smallEcModel Enzyme-constrained version of the context-specific model Usage: smallEcModel = getSubsetEcModel(smallGEM,bigEcModel)
0001 function smallEcModel = getSubsetEcModel(bigEcModel,smallGEM) 0002 % getSubset_ecModel 0003 % Generate a context-specific ecModel (strain/cell-line/tissue) by 0004 % mapping reactions and genes from a conventional context-specific GEM to 0005 % a general ecModel (bigEcModel), to yield a context-specific ecModel. 0006 % 0007 % Both models (bigEcModel and the smallGEM) should have derived from the 0008 % same starting model. If an ecModel with human-GEM 1.15.0 is made 0009 % (yielding the bigEcModel), then human-GEM 1.15.0 should also be the 0010 % basis from which the context-specific GEM (smallGEM) was generated by 0011 % for instance tINIT. 0012 % 0013 % Input: 0014 % bigEcModel enzyme-constrained version of conventional model of 0015 % metabolism for a given species 0016 % smallGEM Reduced model (subset of the general model) for a 0017 % specific strain (microbes) or cell-line/tissues (mammals) 0018 % 0019 % Output: 0020 % smallEcModel Enzyme-constrained version of the context-specific model 0021 % 0022 % Usage: smallEcModel = getSubsetEcModel(smallGEM,bigEcModel) 0023 0024 % Check if models were derived from the same starting GEM 0025 rxnsDiff = find(~ismember(smallGEM.rxns,bigEcModel.rxns)); 0026 if numel(rxnsDiff) > 0 0027 dispEM(['While both models should have derived from the same starting ',... 0028 'GEM, the following reactions from smallGEM could not be found ',... 0029 'in bigEcModel:'],true,smallGEM.rxns(rxnsDiff),false); 0030 end 0031 0032 % Check if original bigEcModel contains context-dependent protein constraints 0033 if any(bigEcModel.lb(startsWith(bigEcModel.rxns,'usage_prot_')) ~= -1000) 0034 printOrange(['WARNING: The bigEcModel is constraint by protein concentrations that are\n' ... 0035 'likely not relevant in the constructed smallEcModel.\n']); 0036 end 0037 0038 % Remove genes (and associated reactions) that are absent in smallGEM 0039 genesToRemove = setdiff(bigEcModel.genes,smallGEM.genes); 0040 smallEcModel = removeGenes(bigEcModel,genesToRemove,true,true,false); 0041 0042 % Remove genes from ec-structure 0043 enzToRemove = ismember(smallEcModel.ec.genes,genesToRemove); 0044 smallEcModel.ec.genes(enzToRemove) = []; 0045 smallEcModel.ec.enzymes(enzToRemove) = []; 0046 smallEcModel.ec.concs(enzToRemove) = []; 0047 smallEcModel.ec.mw(enzToRemove) = []; 0048 smallEcModel.ec.sequence(enzToRemove) = []; 0049 smallEcModel.ec.rxnEnzMat(:,enzToRemove) = []; 0050 0051 % Remove any reaction (except prot_ associated) that is absent from smallGEM 0052 trimRxns = regexprep(smallEcModel.rxns,'_REV|_EXP_\d+',''); 0053 protRxns = startsWith(smallEcModel.rxns,{'usage_prot_','prot_pool_exchange'}); 0054 keepRxns = ismember(trimRxns,smallGEM.rxns) | protRxns; 0055 smallEcModel = removeReactions(smallEcModel,~keepRxns, true, true, true); 0056 0057 % Remove reactions from ec-structure 0058 ecRxnsToRemove = ~ismember(smallEcModel.ec.rxns,smallEcModel.rxns); 0059 0060 smallEcModel.ec.rxns(ecRxnsToRemove) = []; 0061 smallEcModel.ec.kcat(ecRxnsToRemove) = []; 0062 smallEcModel.ec.source(ecRxnsToRemove) = []; 0063 smallEcModel.ec.notes(ecRxnsToRemove) = []; 0064 smallEcModel.ec.eccodes(ecRxnsToRemove) = []; 0065 smallEcModel.ec.rxnEnzMat(ecRxnsToRemove,:) = []; 0066 end 0067