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

order of metabolites in stoichiometric matrix not consistent depending on where it is run #1143

Open
janisshin opened this issue Sep 6, 2023 · 5 comments

Comments

@janisshin
Copy link

when I call r.getFullStoichiometryMatrix(), the order of the metabolites changes depending on whether the method is called in a class or in a Jupyter notebook. From what I can tell, the order of the reactions remains constant.

Since I am passing in the stoichiometry matrix back and forth for matrix operations, the consistency of the order of the metabolites is crucial. Can you make the order consistent like the order of reactions? Thanks.

@hsauro
Copy link

hsauro commented Sep 6, 2023 via email

@janisshin
Copy link
Author

Also, when I call r.getFloatingSpeciesIds(), the order is different in a Jupyter notebook (first image) than when I call it in a class (second image).

image
image
In the second image, r.getIndependentFloatingSpeciesIds() is stored in variable a and r.getFloatingSpeciesIds() is stored in variable b.

@janisshin
Copy link
Author

janisshin commented Sep 6, 2023

Okay, I think I got to the bottom of the issue.

import tellurium as te

# load the Teusink model
ant_file = 'data/interim/Antimony/BIOMD0000000064_e.ant'
r = te.loada(ant_file)
print(r.getFullStoichiometryMatrix())

ant_file = 'data/interim/Antimony/BIOMD0000000064_e.ant'
s  = te.loada(ant_file)
s.steadyState()
print(s.getFullStoichiometryMatrix())

For some reason, running s.steadyState changes the order of the floating species.
image

@hsauro
Copy link

hsauro commented Sep 6, 2023 via email

@janisshin
Copy link
Author

this generally works, but if I'm converting my antimony to sbml for running on Cobra, then Cobra uses the order of metabolites that is the same order as the one prior to running conservation on antimony. So, it would be nice if we could always just use one order instead of having the user be responsible for converting each time the model is loaded in both antimony and cobra.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants