Home > src > geckomat > limit_proteins > constrainEnzConcs.m

constrainEnzConcs

PURPOSE ^

constrainEnzConcs

SYNOPSIS ^

function model = constrainEnzConcs(model, removeConstraints)

DESCRIPTION ^

 constrainEnzConcs
   Constrain enzyme usages by their concentration as provided in
   model.ec.concs. For enzymes with non-NaN entries in model.ec.concs,
   their enzyme usage reaction will no longer draw from the protein pool,
   but is rather constraint by the measured protein abundance.

 Input:
   model               an ecModel in GECKO 3 format (with ecModel.ec
                       structure) with enzyme concentrations in
                       model.ec.concs
   removeConstraints   logical, whether enzyme concentration
                       constraints should be removed (model.ec.concs
                       will remain unchanged). (optional, default false)

 Output:
   model   an ecModel constraint with available enzyme concentrations

 Note: To populate model.ec.concs you should run fillEnzConcs.

 Usage:
   model = constrainEnzConcs(model, removeConstraints)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function model = constrainEnzConcs(model, removeConstraints)
0002 % constrainEnzConcs
0003 %   Constrain enzyme usages by their concentration as provided in
0004 %   model.ec.concs. For enzymes with non-NaN entries in model.ec.concs,
0005 %   their enzyme usage reaction will no longer draw from the protein pool,
0006 %   but is rather constraint by the measured protein abundance.
0007 %
0008 % Input:
0009 %   model               an ecModel in GECKO 3 format (with ecModel.ec
0010 %                       structure) with enzyme concentrations in
0011 %                       model.ec.concs
0012 %   removeConstraints   logical, whether enzyme concentration
0013 %                       constraints should be removed (model.ec.concs
0014 %                       will remain unchanged). (optional, default false)
0015 %
0016 % Output:
0017 %   model   an ecModel constraint with available enzyme concentrations
0018 %
0019 % Note: To populate model.ec.concs you should run fillEnzConcs.
0020 %
0021 % Usage:
0022 %   model = constrainEnzConcs(model, removeConstraints)
0023 
0024 %Enzyme with NaN entry in model.ec.concs => draw from prot_pool
0025 %Enzyme with numeric entry in model.ec.concs => exchange reaction with
0026 %enzyme level as UB
0027 
0028 if nargin<2
0029     removeConstraints = false;
0030 end
0031 
0032 %Get indices of usage reactions
0033 usageRxns = strcat('usage_prot_',model.ec.enzymes);
0034 [~, usageRxnsIdx] = ismember(usageRxns, model.rxns);
0035 
0036 if any(usageRxnsIdx == 0)
0037     error('Usage reactions are not defined for all enzymes. This is done by makeEcModel.')
0038 end
0039 %Get index of protein pool metabolite
0040 protPoolIdx = find(ismember(model.mets,'prot_pool'));
0041 if ~any(protPoolIdx)
0042     error('Cannot find protein pool pseudometabolite.')
0043 end
0044 
0045 %Protein that should be constraint by UB
0046 if removeConstraints
0047     protCons = [];
0048 else
0049     protCons = ~isnan(model.ec.concs);
0050 end
0051 
0052 %Set all reactions to draw from prot_pool
0053 model.S(protPoolIdx, usageRxnsIdx) = 1;
0054 model.lb(usageRxnsIdx) = -1000;
0055 
0056 %If non-NaN in model.ec.concs, then constrain by UB
0057 if any(protCons)
0058 %    model.S(protPoolIdx, usageRxnsIdx(protCons)) = 0; % Since GECKO 3.2.0
0059     model.lb(usageRxnsIdx(protCons)) = -model.ec.concs(protCons);
0060 end
0061 end

Generated by m2html © 2005