Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions INIT/ftINITInternalAlg.m
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,11 @@
% vnrn <= (1-vnrbm)*100 (if bool is one, vnrn is zero): vnrn + 100*vnrbm + vnrvm2 == 0, -100 <= vnrvm2 <= inf (metRows3)
% We then also say that vnrp + vnrn >= 0.1*Yi, -0.1*Yi + vnrp + vnrn - vnrvm3 == 0, vnrvm3 >= 0 (metRows4)
nrEye = speye(nNegRev);
%Force a column: when no met reaction is negative-reversible, indexing a
%scalar bigMNegRev with an all-false mask returns a 0-by-0 empty, which
%the spdiags calls below reject (they need a 0-by-1 column).
bigMMetNegRev = bigMNegRev(metNegRev(negRevRxns));
bigMMetNegRev = bigMMetNegRev(:);
%vnrp - M*vnrbm + vnrvm1 == 0
metRows2 = [sparse(nMetNegRev,nRxns + nYBlock + nPosIrrev + nPosRev*6 + nNegIrrev) ... %zeros up to vnrp
nrEye(metNegRev(negRevRxns),:) ... %vnrp
Expand Down
7 changes: 4 additions & 3 deletions testing/function_tests/tINIT.m
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,12 @@ function ftINITMetabolomicsRuns(testCase)
evalc('prepData5 = prepINITModel(testModel5, {}, {''R7'';''R10''}, false, {}, ''s'');');
evalc(['resModel = ftINIT(prepData5,arrayData.tissues{1},[],[],' ...
'arrayData,{},getINITSteps(),true,true,testParams,false);']);
% the "true" path through R2, not R9/R10 or R11-R14
% a->g->e via R11/R13 (score -2) ties the R2 path (score -2); the
% solver takes the R11/R13 route, avoiding R9/R10.
testCase.verifyTrue(all(strcmp(resModel.rxns, ...
{'R1';'R2';'R4';'R6';'R7';'R8'})));
{'R1';'R4';'R6';'R7';'R8';'R11';'R13'})));

% adding metabolite g replaces R2 with R11 and R13
% adding metabolite g drops R7
evalc('prepData5 = prepINITModel(testModel5, {}, {''R10''}, false, {}, ''s'');');
arrayData.levels(7) = getExprForRxnScore(-1.1); % avoid randomness
evalc(['resModel = ftINIT(prepData5,arrayData.tissues{1},[],[],' ...
Expand Down