Skip to content

Commit

Permalink
fix: getExchangeRxns uptake and excrete options (#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
edkerk authored Oct 9, 2024
1 parent 943fe1c commit e9acdb1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
10 changes: 6 additions & 4 deletions core/getExchangeRxns.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@
case 'reverse'
exchangeRxnsIndexes = allExch(model.lb(allExch) < 0 & model.ub(allExch) > 0);
case 'uptake'
exchangeRxnsIndexes = allExch([(model.lb(hasNoSubs) >= 0 & model.ub(hasNoSubs) > 0); ...
(model.lb(hasNoProd) < 0 & model.ub(hasNoProd) <= 0)]);

exchangeRxnsIndexes = allExch([(model.lb(hasNoProd) < 0 & model.ub(hasNoProd) <= 0); ...
(model.lb(hasNoSubs) >= 0 & model.ub(hasNoSubs) > 0)]);
case 'excrete'
exchangeRxnsIndexes = allExch([(model.lb(hasNoSubs) < 0 & model.ub(hasNoSubs) <= 0); ...
(model.lb(hasNoProd) >= 0 & model.ub(hasNoProd) > 0)]);
exchangeRxnsIndexes = allExch([(model.lb(hasNoProd) >= 0 & model.ub(hasNoProd) > 0); ...
(model.lb(hasNoSubs) < 0 & model.ub(hasNoSubs) <= 0)]);
otherwise
error('Invalid reactionType specified')
end
exchangeRxnsIndexes = sort(exchangeRxnsIndexes);
exchangeRxns = model.rxns(exchangeRxnsIndexes);
end
22 changes: 12 additions & 10 deletions doc/core/getExchangeRxns.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,18 @@ <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" sr
0070 <span class="keyword">case</span> <span class="string">'reverse'</span>
0071 exchangeRxnsIndexes = allExch(model.lb(allExch) &lt; 0 &amp; model.ub(allExch) &gt; 0);
0072 <span class="keyword">case</span> <span class="string">'uptake'</span>
0073 exchangeRxnsIndexes = allExch([(model.lb(hasNoSubs) &gt;= 0 &amp; model.ub(hasNoSubs) &gt; 0); <span class="keyword">...</span>
0074 (model.lb(hasNoProd) &lt; 0 &amp; model.ub(hasNoProd) &lt;= 0)]);
0075 <span class="keyword">case</span> <span class="string">'excrete'</span>
0076 exchangeRxnsIndexes = allExch([(model.lb(hasNoSubs) &lt; 0 &amp; model.ub(hasNoSubs) &lt;= 0); <span class="keyword">...</span>
0077 (model.lb(hasNoProd) &gt;= 0 &amp; model.ub(hasNoProd) &gt; 0)]);
0078 <span class="keyword">otherwise</span>
0079 error(<span class="string">'Invalid reactionType specified'</span>)
0080 <span class="keyword">end</span>
0081 exchangeRxns = model.rxns(exchangeRxnsIndexes);
0082 <span class="keyword">end</span></pre></div>
0073
0074 exchangeRxnsIndexes = allExch([(model.lb(hasNoProd) &lt; 0 &amp; model.ub(hasNoProd) &lt;= 0); <span class="keyword">...</span>
0075 (model.lb(hasNoSubs) &gt;= 0 &amp; model.ub(hasNoSubs) &gt; 0)]);
0076 <span class="keyword">case</span> <span class="string">'excrete'</span>
0077 exchangeRxnsIndexes = allExch([(model.lb(hasNoProd) &gt;= 0 &amp; model.ub(hasNoProd) &gt; 0); <span class="keyword">...</span>
0078 (model.lb(hasNoSubs) &lt; 0 &amp; model.ub(hasNoSubs) &lt;= 0)]);
0079 <span class="keyword">otherwise</span>
0080 error(<span class="string">'Invalid reactionType specified'</span>)
0081 <span class="keyword">end</span>
0082 exchangeRxnsIndexes = sort(exchangeRxnsIndexes);
0083 exchangeRxns = model.rxns(exchangeRxnsIndexes);
0084 <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>

0 comments on commit e9acdb1

Please sign in to comment.