Code Monkey home page Code Monkey logo

cobrame's People

Contributors

aebrahim avatar avsastry avatar laurenceyang33 avatar tiermak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cobrame's Issues

Combine ModificationData and SubreactionData

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.

biomass constituents

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.

Runtime error when attempting to remove genes from model

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

Access to MiniME or pickled version of iJL965_ME that does not depend on MiniME?

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

[question] steps to add a new gene + product

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!

CobraPy version not being correctly detected

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!

Cannot convert expression to float in build_me_model.ipynb

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?

COBRAme workshop

Dear all,

Is there any planned COBRAme workshop for this year? For sure the user community will beneficit from it.

Best and thanks,
Fair.

knockout gene

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?

Linking enzymes to keffs

Methods to query which processes an enzyme is coupled to. For some enzymes this is currently not very intuitive.

[question] Auxotroph E. coli

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!

COBRAme JSON loading

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!!

Changing objective function for optimization in COBRAME

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'

processdata.py met does not have formula

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!

model.update() intention

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:

  • model.reactions.get_by_id(<rxn_id>).update()
  • model.update()

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:

  • model.update(): do not override bounds setting with irreversibility parameter. Use for on-the-go model changing and simulation.
  • model.update_build(): exact copy of the current model.update(), use for model building.

Best,
Hoang

Add docker script

Add docker for running cobrame+ecolime w/ either soplex or qminos

Issues that need to be fixed to run Docker version successfully

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: 

  1. run_jupyter.sh was in /home/meuser/docker, not /home/meuser as specified in the documentation 
  2. I needed to run 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 
  3. Both the 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'
  1. As a result, of this bug, the pickled model was never generated for 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()

  1. 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

  2. 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.

Acetate production prediction

Hi! I just noticed that in the v0.0.5, when I variated de UPF value, the acetate production changed. But now, It almost stays the same. Should this be happening? Thank you!

v0.0.6

image

v0.0.5

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.