Skip to content

Commit

Permalink
fix: constrainEnzConcs remove enz constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
edkerk committed Jun 6, 2024
1 parent ce31bf7 commit 94d5fde
Show file tree
Hide file tree
Showing 8 changed files with 964 additions and 832 deletions.
825 changes: 405 additions & 420 deletions doc/src/geckomat/gather_kcats/fuzzyKcatMatching.html

Large diffs are not rendered by default.

335 changes: 170 additions & 165 deletions doc/src/geckomat/gather_kcats/getStandardKcat.html

Large diffs are not rendered by default.

104 changes: 60 additions & 44 deletions doc/src/geckomat/limit_proteins/constrainEnzConcs.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../
<div class="box"><strong>constrainEnzConcs</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
<div class="box"><strong>function model = constrainEnzConcs(model) </strong></div>
<div class="box"><strong>function model = constrainEnzConcs(model, removeConstraints) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
<div class="fragment"><pre class="comment"> constrainEnzConcs
Expand All @@ -34,16 +34,20 @@ <h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="
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
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 getProteomics.
Note: To populate model.ec.concs you should run fillEnzConcs.

Usage:
model = constrainEnzConcs(model)</pre></div>
model = constrainEnzConcs(model, removeConstraints)</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
Expand All @@ -58,55 +62,67 @@ <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^


<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function model = constrainEnzConcs(model)</a>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function model = constrainEnzConcs(model, removeConstraints)</a>
0002 <span class="comment">% constrainEnzConcs</span>
0003 <span class="comment">% Constrain enzyme usages by their concentration as provided in</span>
0004 <span class="comment">% model.ec.concs. For enzymes with non-NaN entries in model.ec.concs,</span>
0005 <span class="comment">% their enzyme usage reaction will no longer draw from the protein pool,</span>
0006 <span class="comment">% but is rather constraint by the measured protein abundance.</span>
0007 <span class="comment">%</span>
0008 <span class="comment">% Input:</span>
0009 <span class="comment">% model an ecModel in GECKO 3 format (with ecModel.ec structure) with enzyme</span>
0010 <span class="comment">% concentrations in model.ec.concs</span>
0011 <span class="comment">%</span>
0012 <span class="comment">% Output:</span>
0013 <span class="comment">% model an ecModel constraint with available enzyme concentrations</span>
0014 <span class="comment">%</span>
0015 <span class="comment">% Note: to populate model.ec.concs you should run getProteomics.</span>
0016 <span class="comment">%</span>
0017 <span class="comment">% Usage:</span>
0018 <span class="comment">% model = constrainEnzConcs(model)</span>
0019
0020 <span class="comment">%Enzyme with NaN entry in model.ec.concs =&gt; draw from prot_pool</span>
0021 <span class="comment">%Enzyme with numeric entry in model.ec.concs =&gt; exchange reaction with</span>
0022 <span class="comment">%enzyme level as UB</span>
0009 <span class="comment">% model an ecModel in GECKO 3 format (with ecModel.ec</span>
0010 <span class="comment">% structure) with enzyme concentrations in</span>
0011 <span class="comment">% model.ec.concs</span>
0012 <span class="comment">% removeConstraints logical, whether enzyme concentration</span>
0013 <span class="comment">% constraints should be removed (model.ec.concs</span>
0014 <span class="comment">% will remain unchanged). (optional, default false)</span>
0015 <span class="comment">%</span>
0016 <span class="comment">% Output:</span>
0017 <span class="comment">% model an ecModel constraint with available enzyme concentrations</span>
0018 <span class="comment">%</span>
0019 <span class="comment">% Note: To populate model.ec.concs you should run fillEnzConcs.</span>
0020 <span class="comment">%</span>
0021 <span class="comment">% Usage:</span>
0022 <span class="comment">% model = constrainEnzConcs(model, removeConstraints)</span>
0023
0024 <span class="comment">%Get indices of usage reactions</span>
0025 usageRxns = strcat(<span class="string">'usage_prot_'</span>,model.ec.enzymes);
0026 [~, usageRxnsIdx] = ismember(usageRxns, model.rxns);
0024 <span class="comment">%Enzyme with NaN entry in model.ec.concs =&gt; draw from prot_pool</span>
0025 <span class="comment">%Enzyme with numeric entry in model.ec.concs =&gt; exchange reaction with</span>
0026 <span class="comment">%enzyme level as UB</span>
0027
0028 <span class="keyword">if</span> any(usageRxnsIdx == 0)
0029 error(<span class="string">'Usage reactions are not defined for all enzymes. This is done by makeEcModel.'</span>)
0028 <span class="keyword">if</span> nargin&lt;2
0029 removeConstraints = false;
0030 <span class="keyword">end</span>
0031 <span class="comment">%Get index of protein pool metabolite</span>
0032 protPoolIdx = find(ismember(model.mets,<span class="string">'prot_pool'</span>));
0033 <span class="keyword">if</span> ~any(protPoolIdx)
0034 error(<span class="string">'Cannot find protein pool pseudometabolite.'</span>)
0035 <span class="keyword">end</span>
0036
0037 <span class="comment">%Protein that should be constraint by UB</span>
0038 protCons = ~isnan(model.ec.concs);
0039
0040 <span class="comment">%Set all reactions to draw from prot_pool</span>
0041 model.S(protPoolIdx, usageRxnsIdx(~protCons)) = 1;
0042 model.lb(usageRxnsIdx(protCons)) = -1000;
0043
0044 <span class="comment">%If non-NaN in model.ec.concs, then constrain by UB</span>
0045 <span class="keyword">if</span> any(protCons)
0046 <span class="comment">% model.S(protPoolIdx, usageRxnsIdx(protCons)) = 0; % Since GECKO 3.2.0</span>
0047 model.lb(usageRxnsIdx(protCons)) = -model.ec.concs(protCons);
0048 <span class="keyword">end</span>
0049 <span class="keyword">end</span></pre></div>
0031
0032 <span class="comment">%Get indices of usage reactions</span>
0033 usageRxns = strcat(<span class="string">'usage_prot_'</span>,model.ec.enzymes);
0034 [~, usageRxnsIdx] = ismember(usageRxns, model.rxns);
0035
0036 <span class="keyword">if</span> any(usageRxnsIdx == 0)
0037 error(<span class="string">'Usage reactions are not defined for all enzymes. This is done by makeEcModel.'</span>)
0038 <span class="keyword">end</span>
0039 <span class="comment">%Get index of protein pool metabolite</span>
0040 protPoolIdx = find(ismember(model.mets,<span class="string">'prot_pool'</span>));
0041 <span class="keyword">if</span> ~any(protPoolIdx)
0042 error(<span class="string">'Cannot find protein pool pseudometabolite.'</span>)
0043 <span class="keyword">end</span>
0044
0045 <span class="comment">%Protein that should be constraint by UB</span>
0046 <span class="keyword">if</span> removeConstraints
0047 protCons = [];
0048 <span class="keyword">else</span>
0049 protCons = ~isnan(model.ec.concs);
0050 <span class="keyword">end</span>
0051
0052 <span class="comment">%Set all reactions to draw from prot_pool</span>
0053 model.S(protPoolIdx, usageRxnsIdx) = 1;
0054 model.lb(usageRxnsIdx) = -1000;
0055
0056 <span class="comment">%If non-NaN in model.ec.concs, then constrain by UB</span>
0057 <span class="keyword">if</span> any(protCons)
0058 <span class="comment">% model.S(protPoolIdx, usageRxnsIdx(protCons)) = 0; % Since GECKO 3.2.0</span>
0059 model.lb(usageRxnsIdx(protCons)) = -model.ec.concs(protCons);
0060 <span class="keyword">end</span>
0061 <span class="keyword">end</span></pre></div>
<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
Loading

0 comments on commit 94d5fde

Please sign in to comment.