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
    that's the output of kade
    Zelun Li
    @lzl0719
    Do I need to install something to use KaDE?
    Rodrigo Santibáñez
    @glucksfall
    yeap... download the compiled kappatools from the github
    otherwise, good luck installing opam and other things to compile from source
    Zelun Li
    @lzl0719
    And I would also need to install libroadrunner? is there a version for Linux?
    Rodrigo Santibáñez
    @glucksfall
    is a python package
    :)
    Princeofthebow
    @Princeofthebow

    Hi there pretty new to Pysb and I'm trying to start to use if for some calculations.

    I have encoutered however the following error:

    FileNotFoundError: [WinError 2] The system cannot find the file specified when running the tutorial code.

    I'm using biogennet 2.5.1, may this be the issue?

    This is the code I'm trying to run

    from pysb import *
    from pysb.simulator import ScipyOdeSimulator

    Model()
    Monomer('A')
    Parameter('k', 3.0)
    Rule('synthesize_A', None >> A(), k)
    t = [0, 10, 20, 30, 40, 50, 60]

    simulator = ScipyOdeSimulator(model)
    simresult = simulator.run()
    print(simresult.species)

    Rodrigo Santibáñez
    @glucksfall
    Hi @Princeofthebow, there is a small problem with your code (missing t in ScipyOdeSimulator:
    from pysb import *
    from pysb.simulator import ScipyOdeSimulator
    
    Model()
    Monomer('A')
    Parameter('k', 3.0)
    Rule('synthesize_A', None >> A(), k)
    t = [0, 10, 20, 30, 40, 50, 60]
    
    simulator = ScipyOdeSimulator(model, t)
    simresult = simulator.run()
    print(simresult.species)
    You need to add BNG2.pl to the path. You could use from pysb.pathfinder import set_path and then set_path('bng', path_to_BNG2.pl)
    Rodrigo Santibáñez
    @glucksfall
    if you installed BNG2 with conda, something like this should work set_path('bng', 'C:/Users/gluck/Anaconda3/share/bionetgen') (change gluck by your user)
    Princeofthebow
    @Princeofthebow
    OK - cool I did not know biogennet used pearl so I will have to install that as well

    I did though succesfully add the .pl to the path and only after doing so it gave me the error you see.

    I'll check after installing pearl

    BTW I'm running everyhting from Jupyter, no Anaconda
    Princeofthebow
    @Princeofthebow
    Ok excellent, both needed fixing and now it works!
    Rodrigo Santibáñez
    @glucksfall
    Great to know!! Feel free to ask anything. BTW, I'm a user of pySB, not part of the dev team.
    Princeofthebow
    @Princeofthebow
    Cool thanks
    I'm actaully getting into it as I woudl like to run gillespie via GPUs
    have you ever used this functionality?
    Rodrigo Santibáñez
    @glucksfall
    No, but I would like to do that.
    Princeofthebow
    @Princeofthebow
    cool I'll tryo to keep you in the loop with a MVE if I get somewhere :-)
    Rodrigo Santibáñez
    @glucksfall
    sure, no problem at all
    Princeofthebow
    @Princeofthebow

    Hi sorry it is me again, I ahve some trouble in understading how the rule definitions work(I'm an engineer and I'm not too familiar with some concepts)

    I would need to model this reaction

    image.png
    where R(A) is a function that depdends non linearly on A
    does anybody know how to do it in pysb?
    Rodrigo Santibáñez
    @glucksfall
    Princeofthebow
    @Princeofthebow
    ow wow thanks I had not spotted that
    Rodrigo Santibáñez
    @glucksfall
    no problem ;)
    Princeofthebow
    @Princeofthebow

    Hi I tried it but it results on an error

    from pysb import *
    from pysb.pathfinder import set_path
    from pysb.simulator import ScipyOdeSimulator
    set_path('bng', 'C:\Program Files\BNG')
    
    Model()
    Monomer('A',['a'])
    Observable('A_total', A())
    Parameter('Hcoeff',1.0)
    Expression('kf_A', A_total*Hcoeff)
    Rule('bindA', A(a=None) + A(a=None) >> A(a=1) % A(a=1), kf_A)
    Parameter('A0',20)
    Initial(A(a=None),A0)
    
    simres = ScipyOdeSimulator(model, tspan=[0,20]).run()

    This is the error I get:

    AttributeError: 'str' object has no attribute 'args'

    Is there some problem with my code?

    Rodrigo Santibáñez
    @glucksfall
    Oh... right. Sorry, I forgot to mention. Last week, another user asked the same about Expression. It seems there is a problem when converting the model into ODEs. The solution, if you could read the conversation history, was export the model into kappa, edit by hand because the observable must be before the parameter that use the observable, and simulate the model using the command line (KaSim).
    Princeofthebow
    @Princeofthebow
    ok that looks tough as I am totally new to this. I simply submitted an issue on the github. Lets see where it gets
    rAntonioH
    @rAntonioh
    hi, i'm trying to set the max_stoich option in BioNetGen using pysb, however generate_network(Model, cleanup=False, **{'max_stoich':3}) results in the following error:
    AttributeError: type object 'Model' has no attribute 'rules'
    this is of course not 'True' because i have written rules, any advice on how to address this?
    lu-250
    @lu-250
    Hi, everyone, I am new to pysb and have some questions about update monomer state in a list of complex, would anyone help me ? Thanks a lot ! I have a list of complex including(binding to) a common monomer. I create the list by SpeciesPatternMatcher. I would like to update the state of the particular monomer from 'u' to 'p' and create a corresponding list of complex, I am wondering if there is any easy way such as a function in library ? Thanks a lot !
    Alex Lubbock
    @alubbock
    @rAntonioh Apologies for the delayed response, but it looks like you need to use the lower case model rather than Model. In Python terms, Model is the model class, model is the model object (instance) that contains your rules etc.
    Alex Lubbock
    @alubbock
    @lu-250 Is this part of a rule or reaction in a model? Or are you trying to modify a model "statically" for some reason (without running a simulation)?
    lu-250
    @lu-250
    Yes, this will be part of a rule in a model. @alubbock Thanks a lot for the quick reply.
    lu-250
    @lu-250
    the rule I was trying to create basically states all complex with the monomer will self phosphorylated from 'u' to 'p'
    Alex Lubbock
    @alubbock
    @lu-250 The general pattern for this, with a monomer A, binding site b, and phosphorylation site s, is Rule('r1', A(s='u') >> A(s='p'), kf). The left hand side of the rule, A(s='u'), determines what's matched by the rule. Note that no binding site is included in that rule, so the phosphorylation will apply regardless if A is bound or not. If you want the phosphorylation reaction to only apply to A units which are in complex, but you don't care what the binding partner is, you can use the ANY keyword to specify "any bond, but not unbound", i.e. Rule('r2', A(b=ANY, s='u') >> A(b=ANY, s='p'), kf). For a worked example including the ANY keyword, see the egfr_simple model: https://github.com/pysb/pysb/blob/master/pysb/examples/bngwiki_egfr_simple.py
    lu-250
    @lu-250
    Got it. Thank you so much ! much simpler than what i have in mind. @alubbock
    lu-250
    @lu-250
    just to make sure I understand it right, for your r1 example, if the rule only apply to monomer, not in complex, then the binding site need to be explicitly stated in rule as rule('r1', A(s = 'u', b = None) >> A (s = 'p', b = None), kf) , even though the binding site is not directly involved or changed in the reaction. Am I right ?
    lu-250
    @lu-250
    and basically A(s = 'u') is the same as A(s = 'u', b = WILD), right ?
    Thank you so much !
    lu-250
    @lu-250
    thus Rule('r1', A(s = 'u') >> A(s = 'p'), kf) is equivalent to Rule('r1', A(s = 'u', b = WILD) >> A(s = 'p', b = WILD), kf)