-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Incorrect size(model.rhs) error when running loopless FVA with LLC-NS method #2377
Comments
Its probably added a constraint from the objective to make sure solutions
are optimal. Evidently the rhs needs an extra row.
c'*v = rhs(end+1) = c'*v_star where v_star is the optimal value of the LP
objective. Pls make the edit and pr
…On Sun, 10 Nov 2024 at 17:39, Alexey Sergushichev ***@***.***> wrote:
I'm trying to use LLC-NS constraints for loopless FVA and it fails with an
error, while fastSNP method works well.
Here is the code I'm running:
model = readCbModel('e_coli_core.mat');
res = fluxVariability(model, 100, 'max', model.rxns, 1, true);
res = fluxVariability(model, 100, 'max', model.rxns, 1, 'LLC-NS');
res = fluxVariability(model, 100, 'max', model.rxns, 1, 'fastSNP');
The first and third fluxVariability calls work without error, but for the
second I get:
Reduce complexity by nullspace preprocessing and implementing localized loopless constraints (LLCs)
Reactions in internal nullspace can be divided into 1 connected components.
Error using gurobi
Incorrect size(model.rhs)
Error in solveCobraLP (line 839)
resultgurobi = gurobi(gurobiLP,gurobiParam);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in optimizeCbModel (line 652)
solution = solveCobraLP(optProblem2, param);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in processingLLCs>preprocessLLCs (line 151)
sFeas = optimizeCbModel(model2, 'max', 'one');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in processingLLCs (line 36)
loopInfo = preprocessLLCs(varargin{1:5});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in fluxVariability (line 232)
[solveLP, MILPproblem, loopInfo] = processingLLCs('preprocess', loopInfo, LPproblem, model, nRxns, osenseStr, MILPproblem);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I've added a breakpoint at solveCobraLP and for some reason the problem
has matrix A of size 263x285 while vector b is of size 262, which causes
the gurobi error.
Also, when I ran testFVA I also have the same error.
*I hereby confirm that I have:*
- Tried to solve the issue on my own
- Retried to run my code with the latest version of The COBRA Toolbox
- Checked that a similar issue has not already been opened
*(Note: You may replace [ ] with [X] to check the box)*
—
Reply to this email directly, view it on GitHub
<#2377>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQMEOUYBZI56YDYVYIC6CLZ76K4NAVCNFSM6AAAAABRQNRJQCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGY2DONBWHEYDMMY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
--
Mr. Ronan MT Fleming B.V.M.S. Dip. Math. Ph.D.
----------------------------------------------------------------------------
Associate Professor,
Digital Metabolic Twin Center, www.digitalmetabolictwin.org
School of Medicine,
University of Galway.
Ireland.
----------------------------------------------------------------------------
Coordinator of the Horizon Europe project "Reconstruction and Computational
Modelling for Inherited Metabolic Diseases" (Recon4IMD
<https://www.recon4imd.org/>)
----------------------------------------------------------------------------
Peer-reviewed publications: https://goo.gl/FZPG23
Mobile: +353 852 109 806
Github: @rmtfleming <https://github.com/rmtfleming>
----------------------------------------------------------------------------
|
Sorry, I'm not that familiar for cobra code base, neither with matlab in general, so not sure what you suggest exactly. That said, I agree with your "evidently". As I understand at this line
objectiveLP is empty and doesn't increase b size, while the constraint rows is added to A (although it's a zero row in my case).
I've also checked version 9d88036. There everything appears to work fine. |
I've also found the commit that introduced this problem: 27d920b#diff-0401bfa37ea7edab5d85374c70147dfc317f57bcc6c1fbe031f112898b3ce8e2L438 I would suggest to revert to setting |
OK, try switching
https://github.com/opencobra/cobratoolbox/blob/develop/src/analysis/FBA/optimizeCbModel.m#L474C5-L474C16
to
objectiveLP = 0;
…On Mon, 11 Nov 2024 at 01:57, Alexey Sergushichev ***@***.***> wrote:
I've also found the commit that introduced this problem: 27d920b
#diff-0401bfa37ea7edab5d85374c70147dfc317f57bcc6c1fbe031f112898b3ce8e2L438
<27d920b#diff-0401bfa37ea7edab5d85374c70147dfc317f57bcc6c1fbe031f112898b3ce8e2L438>
I would suggest to revert to setting objectiveLP = 0;, but not sure why
it was changed in the first place.
—
Reply to this email directly, view it on GitHub
<#2377 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQMEOTDURXR2DLEENYEHFD2AAFH5AVCNFSM6AAAAABRQNRJQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRXGA4DEMRSHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
--
Mr. Ronan MT Fleming B.V.M.S. Dip. Math. Ph.D.
----------------------------------------------------------------------------
Associate Professor,
Digital Metabolic Twin Center, www.digitalmetabolictwin.org
School of Medicine,
University of Galway.
Ireland.
----------------------------------------------------------------------------
Coordinator of the Horizon Europe project "Reconstruction and Computational
Modelling for Inherited Metabolic Diseases" (Recon4IMD
<https://www.recon4imd.org/>)
----------------------------------------------------------------------------
Peer-reviewed publications: https://goo.gl/FZPG23
Mobile: +353 852 109 806
Github: @rmtfleming <https://github.com/rmtfleming>
----------------------------------------------------------------------------
|
Actually, the problem seems to be fixed in the develop branch by this check: https://github.com/opencobra/cobratoolbox/blob/develop/src/analysis/FBA/optimizeCbModel.m#L636 |
I'm trying to use LLC-NS constraints for loopless FVA and it fails with an error, while fastSNP method works well.
Here is the code I'm running:
The first and third
fluxVariability
calls work without error, but for the second I get:I've added a breakpoint at solveCobraLP and for some reason the problem has matrix A of size 263x285 while vector b is of size 262, which causes the gurobi error.
Also, when I ran
testFVA
I also have the same error.I hereby confirm that I have:
(Note: You may replace [ ] with [X] to check the box)
The text was updated successfully, but these errors were encountered: