Comments (4)
Good day to you too, Pierre,
Thank you for the new update and the detailed explanation. The pace at which you addressed these issues is impressive 👍.
This thumb rule about the use cases of fluxes
and raw
makes good sense to me now. I also agree that for completeness, solution.raw
should contain everything.
The changes seem to have done the trick, the code regained its flow.
Regarding suggestions, I would not make any now. It is a big project, and I could see that it takes quite some time to get a good enough overview of what is happening under the hood. Momentarily, it seems more feasible to assume that you made all the right choices during coding. :)
With that, please feel free to close this issue.
Keep it up,
Adam
from pytfa.
Good day Adam!
Thank you for the kind words :) We appreciate that people read our prose and use our tools !
Indeed, I forgot to adapt this part of the code to the new fields of the solution attribute. The problem of your solution is that backward_use.id
will yield for example PGI
instead of BU_PGI
, and PGI
is the variable name of the reaction PGI -- which might create some issues since that would mean bounding an integer with continuous values ;) (This also explains why you do not get a key error)
However, i replaced solution.x_dict
by solution.raw
, which yields the raw Series of variable values at solution - this should work. Try pulling from dev (commit b9f14d2) - and tell me if that solves your problem :)
Cheers,
Pierre
from pytfa.
Hi Pierre,
Appreciate the quick response and the update! You are right, I was binding the integers inappropriately... After pulling the update, it works like a charm, thanks.
Subsequently, I found x_dict
s to be replaced in /analysis/variability.py
as well. Would the below changes make sense (as per your previous update)?
77: profiles[iter_count] = solution.x_dict
→ profiles[iter_count] = solution.raw
207: fluxes = solution.x_dict[reaction_id]
→ fluxes = solution.raw[reaction_id]
210: deltag = pd.Series({x.id:solution.x_dict[x.name]
→ deltag = pd.Series({x.id:solution.raw[x.name]
In the case of line 207, I am a bit confused about the deprecated x_dict
s from cobrapy
(which were suggested to be changed to fluxes
) and these x_dict
s that should be changed to raw
. Can you maybe suggest an intuitive way to differentiate them? This pytfa - cobrapy
integration and tracking the attributes/variables gets a bit tricky for me at certain points... :)
Thanks ahead!
Adam
from pytfa.
Good day Adam,
Thank you for pointing these out!
Yes, I kinda coded this in a hurry without proper documentation ... Here was my reasoning:
-
solution.fluxes
incobrapy
is a transformed version of the solver output, as it actually calculates the net flux of each reaction by substracting the reverse variable value to the forward variable value. This should be used anytime one needs the actual flux value -
solution.raw
is an attribute I added to get a clear copy of the solver output. From there one can access the value at solution for all the variables of the problem. However, looking for a reaction ID in there will only give the forward flux. This should be used for any other variable than fluxes.
I did not want to remove fluxes from solution.raw
because then, well, it would not be raw anymore ...
However if you have suggestions with respect to this I would gladly take them !
I should have corrected the last remnants of x_dict
in the latest push (dev, commit a985ce8)
Let me know if that solved your plroblem, and I'll close the issue :)
Cheers,
Pierre
from pytfa.
Related Issues (20)
- metabolomics integration HOT 3
- Unable to open Matlab models HOT 2
- SEED identifiers in thermo DB
- deltaGerr automatically sets to 2.0 after loading thermo model HOT 2
- Integration with eQuilibrator HOT 8
- tutorial_basics lots of warnings when mytfa.prepare() HOT 2
- Thermo DB as SQLite HOT 1
- tutorial_basic.py ERROR - Relaxation could not complete (no DeltaG relaxation found) HOT 7
- Get new delta G values after adding metabolomics data HOT 1
- Use displacement or not? HOT 1
- Relaxation of log concentration error HOT 1
- Problem with pytfa.relax_dgo due to sympy HOT 2
- CPLEX binaries should not be mandatory for Docker build HOT 6
- KeyError on .convert() HOT 2
- Problem with installation HOT 2
- Comma missing in constraint definition
- Problem with building Docker container HOT 1
- equilibrator-cache replaced quilt with zenodo
- Permission denied when running the docker image HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytfa.