Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Rodrigo Santibáñez
    @glucksfall
    Ok, here's the paper about the model https://www.ncbi.nlm.nih.gov/pubmed/17593909
    you'll see it is a GSMM and you need to look for COBRA https://opencobra.github.io/
    What confused me was the .m file (Octave, MATLAB) that you can download from https://www.ebi.ac.uk/biomodels/MODEL3023641273#Files
    if you look the .m file, you'll see a kinetic model
    well, because a GSMM is S*v = 0
    Rodrigo Santibáñez
    @glucksfall
    take a look into this paper https://www.nature.com/articles/srep39647
    I worked with GSMMs. I can help you if you need it. Probably is a good discussion if PySB should allow supports for GSMM, but COBRA (for python, matlab, and others) does a good job "simulating" and analysing GSMMs
    Rodrigo Santibáñez
    @glucksfall
    (I said "simulating" because GSMM are optimization problems)
    Hung-Yi Wu
    @hywu0110
    I know they use COBRA in the paper, but I hope to make it work in Python. All I need is the stoichiometry matrix, right? I was hoping PySB has a nice function to get that matrix. The last resort is to parse the xml file as a regular xml file and build the matrix myself.
    I have the optimization part sorted out by scipy.optimize.minimize
    Ok I'm stupid. Just found there's cobrapy.
    @glucksfall thanks a ton fot telling me there's a difference between kinetic model and GSMM model!
    Rodrigo Santibáñez
    @glucksfall
    don't worry
    I assumed you were starting with GSMMs. That because I said details you already know
    Still, if you need help with pycobra, I can look at old scripts I have. I work now with PySB and kappa to model and simulate metabolism.
    Hung-Yi Wu
    @hywu0110
    I just started to pick up knowledge in this field. It would be great if you have some good primer papers on top of your head! Not just GSMM, but also metabolism modeling and simulation.
    Rodrigo Santibáñez
    @glucksfall
    @hywu0110 I'll send you papers ASAP. I promise I won't forget to do that.
    Hung-Yi Wu
    @hywu0110
    Thank you so much!
    Alex Lubbock
    @alubbock
    The PySB team is pleased to announce the release of v1.9.0. See the release notes for details.
    Rodrigo Santibáñez
    @glucksfall
    Congrats @alubbock
    Alex Lubbock
    @alubbock
    PySB v1.9.1 is now out, which contains a bug fix for the BngSimulator. See the release notes for details.
    briansebzhou
    @briansebzhou
    Hi there, I've installed pysb via the Anaconda command conda install -c alubbock pysb, but python keeps giving me the error message that there's no module named 'pysb'
    I'm a mac user and when I type in the command "conda install -c alubbock pysb" again it tells me "#all requested packages already installed"
    when I type in "pip install pysb" each line says "requirement already satisfied"
    briansebzhou
    @briansebzhou
    This happens in IDLE only, when I open the system version of Python or IPython things seem to be fine
    I've installed python 3.7
    Rodrigo Santibáñez
    @glucksfall
    It's because the python (and pip) from the anaconda folder takes preference over the system installed python (or viceversa)
    type which python3 (python3.7) in a terminal to know where is installed python
    Alex Lubbock
    @alubbock
    Try running python -m idlelib, which should launch IDLE for the currently active version of Python
    Rodrigo Santibáñez
    @glucksfall
    type whereis python3 (python3.7) in a terminal to know every path were is python
    *where is python
    also, pip, pip2 and pip3 are related to different python versions
    briansebzhou
    @briansebzhou
    I think it's good now, thanks!
    opurcell
    @opurcell
    Hi, I have a question about monomer specifications. Does pySB automatically handle under-specifying a monomer by performing the operation on all possible versions of the monomer? for example, if I have defined a monomer X and it can be bound or unbound, and have two states: 'active' or 'inactive'. If I refer to that monomer, but I dont care whether the monomer is active or inactive, can I just not specifiy that i.e. just specific bound or not bound, and leave the specification for the activity empty? Will pySB handle this or do I have to explicity define all possible states whenever I refer to a monomer? With a larger number of states this would be time-consuming. I also have a question about applying rules to complexes. For example, lets say I have 10 monomers and I generate rules that form all possbible complexes between them. Is it possible to then refer to these complexes somehow at a later time in my code? It seems like there is a .monomer object but not a .complex object?
    Rodrigo Santibáñez
    @glucksfall
    you could "alias" complexes, for instance complexAB = A() % B(), then use complexAB in rules
    Rodrigo Santibáñez
    @glucksfall
    You need to refer to specific states when using Init. If not, the simulator assign the initial quantity to default states. The same applies for observables. Your monomers can have 4 states, so observables range from X() accounting for all monomers (bound and unbound, active and inactives) to specific ones stating the state of each site. However, in Rules, you define only the states needed for the reaction (for instance, to dimerize, X must be inactive, active, or you don't care about it)
    This is an example from a model I dev: first, I "aliased" the dimer cplx_rpoa_rpoa = Prot_rpoA(PBD_01 = 1, PBD_02 = None) % Prot_rpoA(PBD_01 = None, PBD_02 = 1)
    Rodrigo Santibáñez
    @glucksfall
    Then used it in a Rule: Rule('rpoa_rpoa', free_rpoa + free_rpoa != cplx_rpoa_rpoa, Parameter('rpoa_rpoa_fwd', 1), Parameter('rpoa_rpoa_rvs', 1)
    Alex Lubbock
    @alubbock
    Hi @opurcell, rule-based modeling frameworks like PySB are designed to handle exactly the kinds of scenarios you mention. In rules or observables, if you don't specify states or bonds for a particular site, the pattern matches any state or bond (bound or unbound). In your example, if you just specify X() in a rule or observable, it will match both states, regardless of whether it is bound or not. You can also generate model components (rules, observables, initial conditions etc.) programmatically using a for loop or similar.
    Leonard Harris
    @lh64
    For complexes, you can access them through ‘model.species’.
    opurcell
    @opurcell
    Thankyou everyone for your quick replies, its very helpful. I think between you you have answered everything and I can make some progress. I realize that these things can be determined through trial and error but sometimes it's good to know what should/shouldnt work rather than hoping error handling makes it clear. I realized I have one more question - is it possible to represent multimerization in a single rule declaration? i.e. A % A % A for a heterotrimer or e.g. A % B % C % D for a homotetramer . I know that technically anything above dimerization is not physically possible in a single instance of time, but its much simpler to do that than representing all possible orderings of reactions to the multimer, so its a simplication I am happy to make.
    Rodrigo Santibáñez
    @glucksfall
    Short answer is yes, you could do that (for instace: 'R1' A(),X(),X() <-> X(),X(),X() @ 'a1','a2'; is kappa code, but I think you understand the idea). Gillespie argued that trimolecular (and higher order) reactions have very low probability (because molecules should collide at the same time and with correct orientation and velocity or energy). Just be aware of the rule rate. The propensivity is the multiplication of the rule rate (a1 in the example) and the quantities of A and X (sort of), so you could have a rule with very high probability of ocurrence. The example rule is part of the Schloegl's model, and there are papers showing the propensivity for each reaction.
    Rodrigo Santibáñez
    @glucksfall
    image.png
    Leonard Harris
    @lh64
    @opurcell Yes, in PySB you could write something like A(a1) + A(a1,a2) + A(a2) >> A(a1=1) % A(a1=1,a2=2) % A(a2=2) and A(b) + B(a,c) + C(b,d) + D(c) >> A(b=1) % B(a=1,c=2) % C(b=2,d=3) % D(c=3)
    opurcell
    @opurcell
    Great, thanks very much. Really just asking what I couldnt seem to find in the documentation but what I know I will need for the future. @glucksfall thanks I will be careful of the rate rules. @lh64 in an earlier message you said I could access complexes through model.species. I have built my model, and at the end would like to run through all the species and set the initial conditions. However model.species is empty in my model? model.monomers, monomers.parameters and model.rules all returns what I would expect, so my model is correctly populated. Do I have to do something to generate the species from the monomers and rules?
    opurcell
    @opurcell
    ah, so the documentation for .species states that it uses the monomer initials to derives the species? In that case I would need to define the initials for the monomers, and then call the species, and then set the initial conditions for just the complexes?
    Alex Lubbock
    @alubbock
    PySB v1.10 is now out, including support for BioNetGen local functions and an improved Kappa simulation engine. Release notes: http://pysb.org/news/pysb-v1-10-0-released
    Alex Lubbock
    @alubbock
    PySB v1.11 adds JSON model import/export, improves import of SBML and BNGL models. Release notes: http://pysb.org/news/pysb-v1-11-0-released
    @opurcell Did your issue get resolved? You need to generate the network before you can access model species, reactions, and ODEs:
    from pysb.bng import generate_equations
    generate_equations(model)
    Leonard Harris
    @lh64
    👍