Reactions that are defined backwards-only (so lb<0 and ub=0) could arguably have their rev field as 0. But this raises a problem when simplifyModel is run with deleteInaccessible is set as true. In this line:
The S-matrix is expanded with inverted versions of reversible reactions (the reducedModel.rev~=0 part), to consider that reactions can have a negative flux. But for the above case (backwards-only & irreversible), these reactions are not included. Arguably, it is not interesting anyway what the value of the rev field is, what is important is whether the reaction can carry a negative flux.
Description of the issue:
Reactions that are defined backwards-only (so lb<0 and ub=0) could arguably have their
rev
field as0
. But this raises a problem whensimplifyModel
is run withdeleteInaccessible
is set astrue
. In this line:https://github.com/SysBioChalmers/RAVEN/blob/e296b5dc7b66f11d8a494303629256ec69679868/core/simplifyModel.m#L129
The S-matrix is expanded with inverted versions of reversible reactions (the
reducedModel.rev~=0
part), to consider that reactions can have a negative flux. But for the above case (backwards-only & irreversible), these reactions are not included. Arguably, it is not interesting anyway what the value of therev
field is, what is important is whether the reaction can carry a negative flux.This should therefore be changed to:
revS=[reducedModel.S,reducedModel.S(:,reducedModel.lb<0)*-1 I(:,in) I(:,out)*-1];
I hereby confirm that I have: