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 Rxn_format = regexprep(bigEcModel.rxns,'_REV|_EXP_\d+',''); 0026 rxnsDiff = find(~ismember(smallGEM.rxns,Rxn_format)); 0027 if numel(rxnsDiff) > 0 0028 dispEM(['While both models should have derived from the same starting ',... 0029 'GEM, the following reactions from smallGEM could not be found ',... 0030 'in bigEcModel:'],true,smallGEM.rxns(rxnsDiff),false); 0031 end 0032 0033 % Check if original bigEcModel contains context-dependent protein constraints 0034 if any(bigEcModel.lb(startsWith(bigEcModel.rxns,'usage_prot_')) ~= -1000) 0035 printOrange(['WARNING: The bigEcModel is constraint by protein concentrations that are\n' ... 0036 'likely not relevant in the constructed smallEcModel.\n']); 0037 end 0038 0039 % Remove genes (and associated reactions) that are absent in smallGEM 0040 genesToRemove = setdiff(bigEcModel.genes,smallGEM.genes); 0041 % If genesToRemove contains "standard", then remove this entry 0042 if ismember('standard', genesToRemove) 0043 genesToRemove(strcmp(genesToRemove, 'standard')) = []; 0044 end 0045 smallEcModel = removeGenes(bigEcModel,genesToRemove,true,true,false); 0046 0047 % Remove genes from ec-structure 0048 enzToRemove = ismember(smallEcModel.ec.genes,genesToRemove); 0049 smallEcModel.ec.genes(enzToRemove) = []; 0050 smallEcModel.ec.enzymes(enzToRemove) = []; 0051 smallEcModel.ec.concs(enzToRemove) = []; 0052 smallEcModel.ec.mw(enzToRemove) = []; 0053 smallEcModel.ec.sequence(enzToRemove) = []; 0054 smallEcModel.ec.rxnEnzMat(:,enzToRemove) = []; 0055 0056 % Remove any reaction (except prot_ associated) that is absent from smallGEM 0057 trimRxns = regexprep(smallEcModel.rxns,'_REV|_EXP_\d+',''); 0058 protRxns = startsWith(smallEcModel.rxns,{'usage_prot_','prot_pool_exchange'}); 0059 keepRxns = ismember(trimRxns,smallGEM.rxns) | protRxns; 0060 smallEcModel = removeReactions(smallEcModel,~keepRxns, true, true, true); 0061 0062 % Remove reactions from ec-structure 0063 ecRxnsToRemove = ~ismember(smallEcModel.ec.rxns,smallEcModel.rxns); 0064 0065 smallEcModel.ec.rxns(ecRxnsToRemove) = []; 0066 smallEcModel.ec.kcat(ecRxnsToRemove) = []; 0067 smallEcModel.ec.source(ecRxnsToRemove) = []; 0068 smallEcModel.ec.notes(ecRxnsToRemove) = []; 0069 smallEcModel.ec.eccodes(ecRxnsToRemove) = []; 0070 smallEcModel.ec.rxnEnzMat(ecRxnsToRemove,:) = []; 0071 end 0072