Ejemplo n.º 1
0
def test4():
    @reaction_rules
    def rulegen():
        A(_1=u,ps=(_1,)) + A(_1=u,ps=(_1,)) > A(_1=u^1,ps=(_1,)).A(_1=u^1,ps=(_1,))

    rules = rulegen()
    print generate_reactions(
        [create_species("A(ps1=u,ps2=u,ps3=u,ps=(ps1,ps2,ps3))")], rules, max_iter=1)[0]
Ejemplo n.º 2
0
def test2():
    @reaction_rules
    def rulegen():
        (A(bs) + B(bs) > A(bs^1).B(bs^1)
            | ExcludeReactants(1, B) | ExcludeReactants(2, A))

    rules = rulegen()
    print generate_reactions(
        [create_species("A(bs1, bs2, bs=(bs1, bs2))"),
        create_species("B(bs1, bs3, bs=(bs1, bs3))")], rules)[0]
Ejemplo n.º 3
0
def test1():
    @reaction_rules
    def rulegen():
        _(ps=u) > _(ps=p)
        _1(bs) + _1(bs) > _1(bs^1)._1(bs^1)
        # (_(ps=u) + K(bs) == _(ps=u^1).K(bs^1) | ExcludeReactants(1, K)
        #     > _(ps=p) + K(bs))

    rules = rulegen()
    print generate_reactions(
        [create_species("K(bs)"), create_species("A(ps=u)")], rules)[0]
    print generate_reactions(
        [create_species("K(bs)"), create_species("A(ps1=u,ps2=u)")], rules)[0]
    print generate_reactions(
        [create_species("K(bs)"),
        create_species("A(ps1=u,ps2=u,ps=(ps1,ps2))")], rules)[0]
    print generate_reactions(
        [create_species("K(bs)"),
        create_species("A(ps1=u,ps2=u,ps=(ps1,ps2),bs=(ps1,))")], rules)[0]
Ejemplo n.º 4
0
def test3():
    @reaction_rules
    def rulegen():
        # _(ps=u) > _(ps=p)
        # _(_1=u) > _(_1=p)
        # A(ps1=u) > A(ps1=p)
        # A(ps1=u,ps=(ps1,ps2)) > A(ps1=p,ps=(ps1,ps2))
        # A(_1=u,ps=(_1,_)) > A(_1=p,ps=(_1,_))
        A(_1=u,_2=u,ps=(_1,_2)) > A(_1=p,_2=u,ps=(_1,_2))

    rules = rulegen()
    print generate_reactions(
        [create_species("A(ps1=u,ps=(ps1,))")], rules)[0]
    print generate_reactions(
        [create_species("A(ps1=u,ps2=u,ps=(ps1,ps2))")], rules)[0]
    print generate_reactions(
        [create_species("A(ps1=u,ps2=u,ps3=u,ps=(ps1,ps2,ps3))")], rules)[0]
Ejemplo n.º 5
0
if __name__ == "__main__":
    newseeds = []
    for i, (sp, attr) in enumerate(attributegen()):
        print i, sp, attr
        newseeds.append(sp)
    print ''

    rules = rulegen(
        0.6 * 0.0005, 0.2 * 0.0005, 4 * 0.0005,
        10 * 10 * 0.0005, 10 * 0.0005, 0.0005)
    for i, rr in enumerate(rules):
        print i, rr
    print ''

    generate_reactions(newseeds, rules)

## Three-stage Model of Gene Expression
## from: V Shahrezaei and PS Swain (2008) PNAS
## doi: 10.1073/pnas.0803850105
##
## Let n be the number of proteins in the system at equilibrium.
## In the limit that gam -> infinity, we have:
##   P(n) = G(alpha+n)*G(beta+n)*G(kap0+kap1)/G(n+1)/G(alpha)/G(beta)/G(kap1+kap2+n)
##           * (b/(1+b))^n * (1 - b/(1+b))^alpha * 2F1(alpha+n, kap0+kap1-beta; kap0+kap1+n; b/(1+b))
## where alpha = 0.5*(a+kap0+kap1+phi),
##       beta  = 0.5*(a+kap0+kap1-phi),
##       phi^2   = (a+kap0+kap1)^2-4*a*kap0,
##       G is the Gamma function, and
##       2F1 is the Gauss hypergeometric function.
##
Ejemplo n.º 6
0
    X(p=s1) > X(p=s0) | 4


if __name__ == "__main__":
    newseeds = []
    for i, (sp, attr) in enumerate(attributegen()):
        print i, sp, attr
        newseeds.append(sp)
    print ''

    rules = rulegen()
    for i, rr in enumerate(rules):
        print i, rr
    print ''

    generate_reactions(newseeds, rules)

## simple_system.bngl
##
## An example model for running NFsim to get you started.
##
## Comments in BNGL are always preceded with a pound (#) character, so that any text that
## follows a pound character is ignored.  The model file below is commented to help you
## understand the main parts of a BNGL file.  Note that some commands at the end of the
## model file that allow you to run the model with different simulators are commented out.
## To use these other options, simply remove the pound character before the command.
#
#begin model
#
## The first part of a BNGL file is the parameters block, where you can define the rates
## of equations or the starting numbers of any of the molecular species.
Ejemplo n.º 7
0
    egfr(Y1148=pY) + Shc(PTB,Y317=pY^1).Grb2(SH2^1,SH3) == egfr(Y1148=pY^2).Shc(PTB^2,Y317=pY^1).Grb2(SH2^1,SH3) | (0.1, 0.2)
    egfr(Y1148=pY) + Shc(PTB,Y317=pY^1).Grb2(SH2^1,SH3^3).Sos(dom^3) == egfr(Y1148=pY^2).Shc(PTB^2,Y317=pY^1).Grb2(SH2^1,SH3^3).Sos(dom^3) | (0.3, 0.4)

    egfr(Y1148=pY^1).Shc(PTB^1,Y317=pY) + Grb2(SH2,SH3) == egfr(Y1148=pY^1).Shc(PTB^1,Y317=pY^2).Grb2(SH2^2,SH3) | (0.5, 0.6)

    egfr(Y1148=pY^1).Shc(PTB^1,Y317=pY) + Grb2(SH2,SH3^3).Sos(dom^3) == egfr(Y1148=pY^1).Shc(PTB^1,Y317=pY^2).Grb2(SH2^2,SH3^3).Sos(dom^3) | (0.7, 0.8)

    Shc(PTB^_,Y317=pY^2).Grb2(SH2^2,SH3) + Sos(dom) == Shc(PTB^_,Y317=pY^2).Grb2(SH2^2,SH3^3).Sos(dom^3) | (0.9, 1.0)

    # Cytosolic
    Shc(PTB,Y317=pY) + Grb2(SH2,SH3) == Shc(PTB,Y317=pY^1).Grb2(SH2^1,SH3) | (1.1, 1.2)
    Shc(PTB,Y317=pY) + Grb2(SH2,SH3^_) == Shc(PTB,Y317=pY^1).Grb2(SH2^1,SH3^_) | (1.3, 1.4)
    Shc(PTB,Y317=pY) > Shc(PTB,Y317=Y) | 1.5
    Grb2(SH2,SH3) + Sos(dom) == Grb2(SH2,SH3^1).Sos(dom^1) | (1.6, 1.7)
    Shc(PTB,Y317=pY^2).Grb2(SH2^2,SH3) + Sos(dom) == Shc(PTB,Y317=pY^2).Grb2(SH2^2,SH3^3).Sos(dom^3) | (1.8, 1.9)


if __name__ == "__main__":
    newseeds = []
    attrs = attributegen()
    for i, (sp, attr) in enumerate(attrs):
        #print i, sp, attr
        newseeds.append(sp)
        #print ''
    reaction_rules = rulegen()

    seeds, rules = generate_reactions(newseeds , reaction_rules, max_iter = 5)

    m = generate_NetworkModel(seeds, rules)
    convert2SBML(m, attrs, "egfr_n5.xml")
Ejemplo n.º 8
0
if __name__ == "__main__":
    newseeds = []
    for i, (sp, attr) in enumerate(attributegen()):
        print i, sp, attr
        newseeds.append(sp)
    print ''

    rules = rulegen()
    for i, rr in enumerate(rules):
        print i, rr
    print ''

    seeds, reactions = generate_reactions(newseeds,
                                          rules,
                                          max_stoich={
                                              "R": 5,
                                              "L": 2
                                          })
    for i, seed in enumerate(seeds):
        print i, seed

#    generate_reactions(newseeds, rules)

## Trivalent-ligand, Bivalen-receptor model
## (requires NFsim installation!)
##
## References:
## 1) B Goldstein, AS Perelson. "Equilibrium theory for the clustering
##      of bivalent cell surface receptors by trivalent ligands".
##      Biophysical Journal. 1985, vol45, p1109-1123.
## 2) MW Sneddon, JR Faeder, T Emonet. "Efficient modeling, simulation and
Ejemplo n.º 9
0
    R(l) + L(_1, _2, _3^_, r=[_1,_2,_3]) == R(l^1).L(_1^1, _2, _3^_, r=[_1,_2,_3]) | (kp2, koff)
    R(l) + L(_1, _2^_, _3^_, r=[_1,_2,_3]) == R(l^1).L(_1^1, _2^_, _3^_, r=[_1,_2,_3]) | (kp2, koff)

if __name__ == "__main__":
    newseeds = []
    for i, (sp, attr) in enumerate(attributegen()):
        print i, sp, attr
        newseeds.append(sp)
    print ''

    rules = rulegen()
    for i, rr in enumerate(rules):
        print i, rr
    print ''

    seeds, reactions = generate_reactions(
        newseeds, rules, max_stoich={"R": 5, "L": 2 })
    for i, seed in enumerate(seeds):
        print i, seed


#    generate_reactions(newseeds, rules)


## Trivalent-ligand, Bivalen-receptor model
## (requires NFsim installation!)
##
## References:
## 1) B Goldstein, AS Perelson. "Equilibrium theory for the clustering
##      of bivalent cell surface receptors by trivalent ligands".
##      Biophysical Journal. 1985, vol45, p1109-1123. 
## 2) MW Sneddon, JR Faeder, T Emonet. "Efficient modeling, simulation and