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

Unable to run the "test_flux_map.py" script #11

Open
PK1617 opened this issue Sep 3, 2019 · 5 comments
Open

Unable to run the "test_flux_map.py" script #11

PK1617 opened this issue Sep 3, 2019 · 5 comments

Comments

@PK1617
Copy link

PK1617 commented Sep 3, 2019

I have repeatedly failed to run the "test_flux_map.py" both in the Python Shell and in the Anacoda/Jupiter. I run the script exactly as it is but I do not get anything. And when I am trying to call the "test_flux_map" function I get errors. Am I missing something? I have downloaded all the necessary packeges.

@pstjohn
Copy link
Owner

pstjohn commented Sep 3, 2019

the test_flux_map.py file is a pytests unittest file, and isn't necessarily meant for public use. If you install pytest into your python environment, you should be able to run it without errors though.

I would instead look through and see if you can run notebooks in the 'examples' directory.

@PK1617
Copy link
Author

PK1617 commented Sep 4, 2019

Thank you for the immediate reply. I managed to run the code through the Jupyter Notebook but without the fixtures. As a follow up question I would like to ask whether we can change the thickness of the lines (apart from the dashed lines for the knocked out reactions) according to their values. I change the fluxes in the code but do not see any difference in the lines.

@pstjohn
Copy link
Owner

pstjohn commented Sep 5, 2019

the simplest way is just making sure the model has a solution before calling flux_map, like in https://github.com/pstjohn/d3flux/blob/master/d3flux/examples/putida/putida_layout.ipynb.

The alternative is you can pass specific fluxes to be plotted using flux_dict, that just wants a dict-like object mapping reaction IDs to flux values.

sol = model.optimize()
d3f.flux_map(model, flux_dict=sol.fluxes)

@PK1617
Copy link
Author

PK1617 commented Sep 10, 2019

Thank you very much! The last thing I would like to ask is whether you can request the fluxes to be straight lines instead of curved. Or if you can generally manipualte the shape of the fluxes (as curved lines will be needed for cycles like the TCA cycle etc.). I assigned the coordinates of the metabolites in order to get the desired network but the fluxes come out to be very curvy.

@pstjohn
Copy link
Owner

pstjohn commented Sep 13, 2019

There's a button in the lower left called 'show reaction nodes'. If you press that, you can click + drag the reaction nodes into place, and they'll stay in position if you save the json file and load it again.

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