sbrg / cobrame Goto Github PK
View Code? Open in Web Editor NEWA COBRApy extension for genome-scale models of metabolism and expression (ME-models)
License: Other
A COBRApy extension for genome-scale models of metabolism and expression (ME-models)
License: Other
Including both ModificationData and SubreactionData classes is redundant since they each have essentially the same functionality.
Should keep SubreactionData and implement all current modifications as SubreactionData.
Hi, when you built Escherichia coli ME-model, why did you divide the iJO1366 biomass equations into several different equations such as biomass_constituent_demand, lipid components and DNA demand requirements.
Hi, I use cobrame to calculate a prouduct , but I dont' know how to set the parameter mu_accuracy in function binary_search() and what it means.
Thank you.
Hi, how can i do FVA on COBRAme model ?
The full ComplexData instance doesn't need to be linked to the MetabolicReaction. The complex id is all that is required
Hi folks,
If you do the following in the Docker image:
import pickle, cobrame
with open('/home/meuser/me_models/iJL1678b.pickle', 'rb') as f:
me = pickle.load(f)
me.remove_genes_from_model( ['b0002'] )
Then I get the following error:
Complex (ASPKINIHOMOSERDEHYDROGI-CPLX) removed from model
Traceback (most recent call last):
File "/source/cobrame/cobrame/core/model.py", line 385, in remove_genes_from_model
from optlang.interface import SymbolicParameter
ImportError: cannot import name 'SymbolicParameter'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/source/cobrame/cobrame/core/model.py", line 387, in remove_genes_from_model
protein.remove_from_model(method='destructive')
File "/usr/lib/python3.6/site-packages/cobra-0.5.11-py3.6-linux-x86_64.egg/cobra/core/Metabolite.py", line 142, in remove_from_model
for x in self._reaction:
RuntimeError: Set changed size during iteration
Please advise
Hi folks,
I am trying to load iJL965_ME.pickle in python2 and I am unable to because I don't have access to the minime library.
from cPickle import dump,load
me = load(open('iJL965_ME.pickle', 'rb'))
results in the following error.
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-8-aac67a141a6b> in <module>()
----> 1 me = load(open('iJL965_ME.pickle', 'rb'))
ImportError: No module named minime.core.MEModel
Unfortunately, I don't see the minime
library available on github. Would someone be willing to grant me access to this library or provide a pickled version of the ME model that does not require this library?
Sincerely,
Jeremy
Hi Colton,
could you give me a short intro what would be required to add a new gene and its product to a cobrame model (for instance the E. coli ME model). Let's say I want to add a single gene with a known promoter (for instance an additional auxotrophy) and model the expression of its product (an ezyme) and maybe add a new reaction catalyzed by that product/enzyme. What steps would be required for that?
Thanks a lot!
Hello,
I installed CobraPy v0.5.11 as indicated in the documentation (note, I had to install this version manually since pip couldn't find that version).
I get the following error:
---> 22 from cobra.io.json import metabolite_from_dict, save_json_model
ImportError: cannot import name 'metabolite_from_dict' from 'cobra.io.json'
I'm wondering if the logic in detecting the CobraPy version is correct, given that it is using optlang and somehow inferring cobrapy version because of it?
This is the line in the code I'm referring to:
https://github.com/SBRG/cobrame/blob/559ebcb7687ceefcc5905e46e688ea88bae3eb05/cobrame/io/json.py#L17C1-L22C35
Thanks!
I am running into an error with the build_me_model.ipynb
:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/Users/bsp/unix/ecolime/ecolime/build_me_model.ipynb Cell 5' in <cell line: 4>()
2 ijo_directory = join(flat_files.ecoli_files_dir, 'iJO1366.json')
3 ijo = cobra.io.load_json_model(ijo_directory)
----> 4 me = cobrame.MEModel('iJL1678b-ME')
6 # ME-models require special OptLang interface if cobrapy version >= 0.6.0
7 # If cannot import SymbolicParameter, assume using cobrapy
8 # versions <= 0.5.11
9 try:
File /opt/homebrew/lib/python3.9/site-packages/cobrame/core/model.py:29, in MEModel.__init__(self, *args)
27 self._biomass_dilution.add_metabolites({self._biomass: -1})
28 self.add_reactions([self._biomass_dilution])
---> 29 self._biomass_dilution.upper_bound = mu
30 self._biomass_dilution.lower_bound = mu
31 # maintenance energy
File /opt/homebrew/lib/python3.9/site-packages/cobra/util/context.py:111, in wrapper(self, new_value)
File /opt/homebrew/lib/python3.9/site-packages/cobra/core/reaction.py:268, in upper_bound(self, value)
266 # Rebuild the model with the new independent genes/metabolites
267 self._metabolites = {}
--> 268 self.add_metabolites(new_metabolites)
269 self._genes = set()
270 for k in new_genes:
File /opt/homebrew/lib/python3.9/site-packages/cobra/core/reaction.py:220, in update_variable_bounds(self)
217 return "system_boundary"
218 return None
--> 220 @property
221 def model(self):
222 """returns the model the reaction is a part of"""
223 return self._model
File /opt/homebrew/lib/python3.9/site-packages/sympy-1.10.1-py3.9.egg/sympy/core/expr.py:345, in Expr.__float__(self)
343 if result.is_number and result.as_real_imag()[1]:
344 raise TypeError("Cannot convert complex to float")
--> 345 raise TypeError("Cannot convert expression to float")
Any idea what might be the source of this error?
Dear all,
Is there any planned COBRAme workshop for this year? For sure the user community will beneficit from it.
Best and thanks,
Fair.
Hi, i have a question about knockout a gene
is it good to knockout gene with me models? if yes , how can i do it?
Methods to query which processes an enzyme is coupled to. For some enzymes this is currently not very intuitive.
Each reaction type should be handled differently
Hi!,
I'm trying to model a E. coli that has mutations that make it auxotroph for some aminoacids. I added the mutations on the genes I am interested but I think I might be doing something wrong when I try to make E. coli consume the aminoacids that it's lacking.I tried to make it consume them by applying a negative value on the "EX_" reactions of each aminoacid but the model won't be solved. Do you have any ideas on what am I missing?
Thank you!
I was expecting load_json_me to return a COBRAme model.
On a related note, the naming of MEModel (filename) vs MEmodel (class name) is a little confusing.
Thanks for working through all these details!!
Hi,I would like to change the objective function from maximize biomass to ATPM in COBRAME. Just changing the objective_coefficient as follows results in a an error where me.solution is NOTYPE. How do we change the objective function?
me.reactions.dummy_reaction_FWD_SPONT.objective_coefficient = 0
me.reactions.ATPM.objective_coefficient = 1
in solve_me_model(me, max_mu, precision, min_mu, using_soplex, compiled_expressions)
11 # Use bisection for now (until the NLP formulation is worked out)
12 muopt, hs, xopt, cache = me_nlp.bisectmu(precision=precision, mumax=max_mu)
---> 13 me.solution.f = me.solution.x_dict['ATPM']
14
15 def show_escher_map(me, solution=None):
AttributeError: 'NoneType' object has no attribute 'x_dict'
This could be two steps:
Including, for example, each TranscriptionData instance in process_data and transcription_data is redundant.
Can replace model.transcription_data as a property
Hi! I've used the build_me_model.ipynb from ecolime and it gives me the next warning:
/cobrame/core/processdata.py:257 UserWarning: met (generic_tRNA_GAG_glu__L_c) does not have formula
And when I solve it, it gives me a different result than the v 0.0.5 . Do you know why is this happening? I got the new folders from github, followed the instructions to install cobrame and ecolime again , used the new build_me_model.ipynb and solved them with SoPlex.
Thanks!
Based on my experience when working with knockout strain designs and changing metabolic enzyme kinetic parameters, there is the following unintended issue with model.update().
When I update my k_eff, I need to perform an update for the coefficient to change using two following methods:
Using either method, the reactions reversibility is prioritized over bound when updating, which make model.update() erase all previous bound settings by, for example, knockout reactions. However, the second method has global scale effect, negating previous knockout setting if model.update() is used after setting the knockout.
It might be useful to have two functions for updating model:
Best,
Hoang
It would be great to have a convenience function to get all the translation going into a given metabolic reaction. This will be really helpful for newcomers.
Refactor to use formula weight instead.
This will allow us to remove the metabolite mass dictionaries in mass.py
Add docker for running cobrame+ecolime w/ either soplex or qminos
Thank you for providing the Docker instance.
I was able to run docker and start the jupyter notebook on my machine and with a bit of effort I was able to build the model and solve it using quadminos
.
I only tested the 0.0.7 implementation that was in the Manuscript subdirectory, and not the 0.0.8 version that is the current version.
The instructions could be a bit more clear, so I will detail what needs to be fixed in order to get it to work:
run_jupyter.sh
was in /home/meuser/docker
, not /home/meuser
as specified in the documentation pip3 install --user .
within the cobrame-0.0.7
directory in order to be able to import cobrame
into the ecolime solve_demo.ipynb
jupyter notebook build_me_model.py
script and the build_me_model.ipynb
notebook had a bug in the call to return_gr_dependent_dna_demand()
: Traceback (most recent call last):
File "build_me_model.py", line 821, in <module>
me = return_me_model()
File "build_me_model.py", line 319, in return_me_model
me.global_info['GC_fraction'])
TypeError: return_gr_dependent_dna_demand() missing 1 required positional argument: 'gc_fraction'
solve_demo.ipynb
to run. This was solved by adding me
as the first parameter and me.global_info['GC_fraction']
as the second parameter to return_gr_dependent_dna_demand()
The last cell of solve_demo.ipynb
notebook was unable to import escher
because escher installation was not included in the Dockerfile. This was solved with pip install --user escher
.
The good news is that quadminos
worked without a hitch, and I was able to view the results in Escher after fixing the bugs mentioned above.
Using lowercase nucleotide sequences when creating a translation reactions gives an unclear error message.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.