Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FastCC results differ from respective MATLAB function #1154

Open
NantiaL opened this issue Feb 21, 2022 · 6 comments
Open

FastCC results differ from respective MATLAB function #1154

NantiaL opened this issue Feb 21, 2022 · 6 comments
Labels

Comments

@NantiaL
Copy link

NantiaL commented Feb 21, 2022

Hello, I would like to raise a question regarding the FastCC implementation of Cobrapy. After multiple runs, FastCC outputs a different number of blocked reactions using the Recon1 model. It might be reasonable because optimization never delivers unique solutions. But, the respective MATLAB function from the COBRAToolbox always returns the same results after several runs. Since both implementations are based on the same algorithm, I guess both should give the same results. So, I think this might be something worths checking.

I noticed that the number of irreversible reactions detected in the FastCC implementation deviates from the number of irreversible reactions computed by the MATLAB function. Reactions that are irreversible in the backward direction are not reported as irreversible in the MATLAB command window.

For Recon1:
MATLAB:

  • 2186 irreversible reactions
  • 1274 blocked reactions

Python:

  • 2192 irreversible reactions
  • blocked reactions differ after each run
    Used solver: glpk, python 3.8.5
@Midnighter
Copy link
Member

Thanks for the report @NantiaL. Can you please post the exact code that you used to generate these results?

@NantiaL
Copy link
Author

NantiaL commented Feb 21, 2022

Hey, here it is:

MATLAB:

is_active = fastcc(model, 1e-4);
inactiveRxns = setdiff(model.rxns, model.rxns(is_active));

Python:

from cobra import *
model = io.read_sbml_model('RECON1.xml')
model.solver= 'glpk'
fastcc(model)

In Python I also got different results over multiple runs after setting the zero_cutoff and/or the flux_threshold to 1e-4.

@NantiaL NantiaL changed the title FastCC results differe from respective MATLAB function FastCC results differ from respective MATLAB function Feb 21, 2022
@cdiener
Copy link
Member

cdiener commented Feb 21, 2022

From a cursory look it seems like there are some bugs in the FastCC coefficient setting. For instance a reaction with a forward flux of 1 and reverse flux of 1 (net flux 0) is considered active on our formulation.

@Midnighter Midnighter added the bug label Feb 21, 2022
@synchon
Copy link
Member

synchon commented Feb 23, 2022

Apologies for the delayed response. I'll take a look. Thanks for the report!

@synchon synchon self-assigned this Feb 23, 2022
@babessell1
Copy link

@synchon

Hello, I was wondering if you ever found any leads on what is causing this issue. I tried to diagnose myself but it got quite overwhelming for me to understand. This issue seems pretty important for research since results should be reproducible.

Thank you

@synchon
Copy link
Member

synchon commented Aug 4, 2022

Hi @babessell1 ! The problem is most likely in the problem formulation as @cdiener pointed out earlier. I have been quite busy lately and I'm not sure when I can take tackle it. Apologies for that as I had self-assigned it. I'll remove it and let someone else take a stab at it.

@synchon synchon removed their assignment Aug 4, 2022
@synchon synchon added help-wanted An issue that should be easy to implement for anyone in the community. and removed help-wanted An issue that should be easy to implement for anyone in the community. labels Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants