cnapy-org / CNApy

An integrated visual environment for metabolic modeling with common methods such as FBA, FVA and Elementary Flux Modes, and advanced features such as thermodynamic methods, extended Minimal Cut Sets, OptKnock, RobustKnock, OptCouple and more!
https://cnapy-org.github.io/CNApy-guide/
Apache License 2.0
44 stars 7 forks source link

Cannot change reaction bounds #298

Closed Paulocracy closed 3 years ago

Paulocracy commented 3 years ago

Initially reported in but separated from #296: When I change a reaction lower/upper bound, this new value is not stored for the reaction. It doesn't matter if the input is valid or not.

axelvonkamp commented 3 years ago

Somehow changing bounds still does not always work reliably, will investigate...

Paulocracy commented 3 years ago

Under which circumstances does it not work for you?

axelvonkamp commented 3 years ago

First of all, the validate_equation function does not appear to work for exchange reactions, probably rejects them because one side is empty.

Paulocracy commented 3 years ago

Yes I saw that too, it only works if there is a substrate, not if there is a product only

axelvonkamp commented 3 years ago

Another case: Load SmallExample and try to reduce the upper bound of R6 from 100 to 10. Although the change is valid and accepted after switching to another reaction and back to R6 the upper bound is now 1000 (the cobra default value).

axelvonkamp commented 3 years ago

Another case: Load SmallExample and try to reduce the upper bound of R6 from 100 to 10. Although the change is valid and accepted after switching to another reaction and back to R6 the upper bound is now 1000 (the cobra default value).

The reason is that after setting the bounds in the apply function build_reaction_from_string is always called which then apparently puts in cobra default bounds. Do you get this behaviour too, Pavlos? I am pretty sure that changing bounds worked for me a copule of weeks ago. Just saw that the build_reaction_from_string call was only put in recently.

Paulocracy commented 3 years ago

I can't reproduce the behaviour with the SmallExample and R6, at least when I tried to change the maximum to 10 and switch between the reactions. FVAs and FBAs then also respect the new maximal bound of 10. Do I miss a reproducing step?

axelvonkamp commented 3 years ago

I can't reproduce the behaviour with the SmallExample and R6, at least when I tried to change the maximum to 10 and switch between the reactions. FVAs and FBAs then also respect the new maximal bound of 10. Do I miss a reproducing step?

Strange, are you sure you are on the up-to-date master branch?

Paulocracy commented 3 years ago

Yes I am :O