In [1]:
from ecell4.core import *
In [2]:
sp1 = Species("A(b^1).B(b^1)")
sp2 = Species("A(b^1).A(b^1)")
print(sp1.count(Species("A")))
print(sp2.count(Species("A")))
print(sp1.count(Species("A(b)")))
print(sp1.count(Species("_")))
In [3]:
rr1 = create_unbinding_reaction_rule(Species("A(b^1).B(b^1)"), Species("A(b)"), Species("B(b)"), 1.0)
rr2 = create_binding_reaction_rule(Species("A(b)"), Species("B(b)"), Species("A(b^1).B(b^1)"), 1.0)
print(rr1.count([Species("A(b^1).B(b^1)")]))
print(rr1.count([Species("A(b^1,c).A(b^2,c^1).B(b^2,c^3).A(b^3,c)")]))
print(rr2.count([Species("A(b,c^1).A(b,c^1)"), Species("B(b,c^1).B(b,c^1)")]))
In [4]:
print([rr.as_string() for rr in rr1.generate([Species("A(b^1).B(b^1)")])])
print([rr.as_string() for rr in rr2.generate([Species("A(b,c=u^1).A(b,c=p^1)"), Species("B(b,c=u^1).B(b,c=p^1)")])])
In [5]:
sp3 = Species("_1._1")
print(Species("A(b^1,c).B(b^1,c^2).A(b,c^2)").count(sp3))
print(Species("A(b^1,c^3).B(b^1,c^2).A(b,c^2).B(b^3,c)").count(sp3))
In [6]:
rr3 = create_binding_reaction_rule(Species("_1(b)"), Species("_1(b)"), Species("_1(b^1)._1(b^1)"), 1.0)
rr4 = create_unbinding_reaction_rule(Species("A(c1=_1,c2=_2)"), Species("B(c=_2)"), Species("C(c=_1)"), 1.0)
print([rr.as_string() for rr in rr3.generate([Species("A(b,c=u^1).B(b,c=p^1)"), Species("A(b,c=p^1).B(b,c=u^1)")])])
print([rr.as_string() for rr in rr4.generate([Species("A(c1=c12, c2=c13)")])])
print([rr.as_string() for rr in rr4.generate([Species("A(c1=c13, c2=c12)")])])
In [7]:
rr5 = create_unimolecular_reaction_rule(Species("A(p=u^_)"), Species("A(p=p^_)"), 1.0)
print([rr.as_string() for rr in rr5.generate([Species("A(p=u^1).KK(b^1)")])])
In [7]: