chemart / kappa-calculus
View on GitHubKappa calculus — How to describe a chemistry you could never enumerate. Agents are proteins with named sites; a site can hold an internal state and a bond to another site, and a rule rewrites a *partial* pattern - bind these two sites, p…
{"species": [{"id": "A(x[.],c[.])", "structure": "A(x[.],c[.])"}, {"id": "B(x[.])", "structure": "B(x[.])"}, {"id": "C(x1{u}[.],x2{u}[.])", "structure": "C(x1{u}[.],x2{u}[.])"}, {"id": "A(x[1],c[.]),B(x[1])", "structure": "A(x[1],c[.]),B(x[1])"}, {"id": "A(x[1],c[2]),B(x[1]),C(x1{u}[2],x2{u}[.])", "structure": "A(x[1],c[2]),B(x[1]),C(x1{u}[2],x2{u}[.])"}, {"id": "A(x[.],c[1]),C(x1{u}[1],x2{u}[.])", "structure": "A(x[.],c[1]),C(x1{u}[1],x2{u}[.])"}, {"id": "C(x1{p}[.],x2{u}[.])", "structure": "C(x1{p}[.],x2{u}[.])"}, {"id": "A(x[.],c[1]),C(x1{p}[.],x2{u}[1])", "structure": "A(x[.],c[1]),C(x1{p}[.],x2{u}[1])"}, {"id": "C(x1{p}[.],x2{p}[.])", "structure": "C(x1{p}[.],x2{p}[.])"}, {"id": "A(x[1],c[2]),B(x[1]),C(x1{p}[.],x2{u}[2])", "structure": "A(x[1],c[2]),B(x[1]),C(x1{p}[.],x2{u}[2])"}], "reactions": [{"reactants": {"A(x[.],c[.])": 1, "B(x[.])": 1}, "products": {"A(x[1],c[.]),B(x[1])": 1}, "rate": {"law": "mass-action", "k": 0.0001}, "count": null}, {"reactants": {"A(x[1],c[.]),B(x[1])": 1}, "products": {"A(x[.],c[.])": 1, "B(x[.])": 1}, "rate": {"law": "mass-action", "k": 0.1}, "count": null}, {"reactants": {"C(x1{u}[.],x2{u}[.])": 1, "A(x[1],c[.]),B(x[1])": 1}, "products": {"A(x[1],c[2]),B(x[1]),C(x1{u}[2],x2{u}[.])": 1}, "rate": {"law": "mass-action", "k": 0.0001}, "count": null}, {"reactants": {"A(x[1],c[2]),B(x[1]),C(x1{u}[2],x2{u}[.])": 1}, "products": {"A(x[.],c[1]),C(x1{u}[1],x2{u}[.])": 1, "B(x[.])": 1}, "rate": {"law": "mass-action", "k": 0.1}, "count": null}, {"reactants": {"A(x[1],c[2]),B(x[1]),C(x1{u}[2],x2{u}[.])": 1}, "products": {"A(x[1],c[.]),B(x[1])": 1, "C(x1{p}[.],x2{u}[.])": 1}, "rate": {"law": "mass-action", "k": 1.0}, "count": null}, {"reactants": {"A(x[.],c[1]),C(x1{u}[1],x2{u}[.])": 1}, "products": {"A(x[.],c[.])": 1, "C(x1{p}[.],x2{u}[.])": 1}, "rate": {"law": "mass-action", "k": 1.0}, "count": null}, {"reactants": {"B(x[.])": 1, "A(x[.],c[1]),C(x1{u}[1],x2{u}[.])": 1}, "products": {"A(x[1],c[2]),B(x[1]),C(x1{u}[2],x2{u}[.])": 1}, "rate": {"law": "mass-action", "k": 0.0001}, "count": null}, {"reactants": {"A(x[.],c[.])": 1, "C(x1{p}[.],x2{u}[.])": 1}, "products": {"A(x[.],c[1]),C(x1{p}[.],x2{u}[1])": 1}, "rate": {"law": "mass-action", "k": 0.0001}, "count": null}, {"reactants": {"A(x[.],c[1]),C(x1{p}[.],x2{u}[1])": 1}, "products": {"A(x[.],c[.])": 1, "C(x1{p}[.],x2{p}[.])": 1}, "rate": {"law": "mass-action", "k": 1.0}, "count": null}, {"reactants": {"B(x[.])": 1, "A(x[.],c[1]),C(x1{p}[.],x2{u}[1])": 1}, "products": {"A(x[1],c[2]),B(x[1]),C(x1{p}[.],x2{u}[2])": 1}, "rate": {"law": "mass-action", "k": 0.0001}, "count": null}, {"reactants": {"A(x[1],c[2]),B(x[1]),C(x1{p}[.],x2{u}[2])": 1}, "products": {"A(x[.],c[1]),C(x1{p}[.],x2{u}[1])": 1, "B(x[.])": 1}, "rate": {"law": "mass-action", "k": 0.1}, "count": null}], "status": "complete", "initial_state": {"A(x[.],c[.])": 1000.0, "B(x[.])": 1000.0, "C(x1{u}[.],x2{u}[.])": 10000.0}, "inflow": null, "outflow": null, "extras": {"model": "abc", "signatures": ["A(x,c)", "B(x)", "C(x1{u p},x2{u p})"], "rules": ["'rule 1' A(x[.]), B(x[.]) <-> A(x[1]), B(x[1]) @ 1.0E-4, 0.1", "'rule 2' A(x[_],c[.]), C(x1{u}[.]) -> A(x[_],c[2]), C(x1{u}[2]) @ 1.0E-4", "'rule 3' C(x1{u}[1]), A(c[1]) -> C(x1{p}[.]), A(c[.]) @ 1", "'rule 4' A(x[.],c[.]), C(x1{p}[.],x2{u}[.]) -> A(x[.],c[1]), C(x1{p}[.],x2{u}[1]) @ 1.0E-4", "'rule 5' A(x[.],c[1]), C(x1{p}[.],x2{u}[1]) -> A(x[.],c[.]), C(x1{p}[.],x2{p}[.]) @ 1"], "init": {"A(),B()": 1000, "C(x1{u},x2{u})": 10000}, "kappa": "%agent: A(x,c)\n%agent: B(x)\n%agent: C(x1{u p},x2{u p})\n'rule 1' A(x[.]), B(x[.]) <-> A(x[1]), B(x[1]) @ 1.0E-4, 0.1\n'rule 2' A(x[_],c[.]), C(x1{u}[.]) -> A(x[_],c[2]), C(x1{u}[2]) @ 1.0E-4\n'rule 3' C(x1{u}[1]), A(c[1]) -> C(x1{p}[.]), A(c[.]) @ 1\n'rule 4' A(x[.],c[.]), C(x1{p}[.],x2{u}[.]) -> A(x[.],c[1]), C(x1{p}[.],x2{u}[1]) @ 1.0E-4\n'rule 5' A(x[.],c[1]), C(x1{p}[.],x2{u}[1]) -> A(x[.],c[.]), C(x1{p}[.],x2{p}[.]) @ 1\n%init: 1000 A(),B()\n%init: 10000 C(x1{u},x2{u})\n", "rate_convention": {"symmetry": "rule", "rule_symmetries": {"rule 1": {"lhs": 1, "preserved": 1}, "rule 1_op": {"lhs": 1, "preserved": 1}, "rule 2": {"lhs": 1, "preserved": 1}, "rule 3": {"lhs": 1, "preserved": 1}, "rule 4": {"lhs": 1, "preserved": 1}, "rule 5": {"lhs": 1, "preserved": 1}}, "k": "k_R = sum over embeddings producing R of gamma * Omega / prod(m_i!), molecule-count units (volume 1), so k_R prod x_i^m_i is the Kappa rule activity", "molecularity": "components of a rule's left-hand side match distinct complexes; inside one complex only with a unimolecular rate {k} (KaDE)"}, "reaction_rules": [["rule 1"], ["rule 1_op"], ["rule 2"], ["rule 1_op"], ["rule 3"], ["rule 3"], ["rule 1"], ["rule 4"], ["rule 5"], ["rule 1"], ["rule 1_op"]], "conservation": [{"name": "agents of type A", "vector": {"A(x[.],c[.])": 1, "B(x[.])": 0, "C(x1{u}[.],x2{u}[.])": 0, "A(x[1],c[.]),B(x[1])": 1, "A(x[1],c[2]),B(x[1]),C(x1{u}[2],x2{u}[.])": 1, "A(x[.],c[1]),C(x1{u}[1],x2{u}[.])": 1, "C(x1{p}[.],x2{u}[.])": 0, "A(x[.],c[1]),C(x1{p}[.],x2{u}[1])": 1, "C(x1{p}[.],x2{p}[.])": 0, "A(x[1],c[2]),B(x[1]),C(x1{p}[.],x2{u}[2])": 1}}, {"name": "agents of type B", "vector": {"A(x[.],c[.])": 0, "B(x[.])": 1, "C(x1{u}[.],x2{u}[.])": 0, "A(x[1],c[.]),B(x[1])": 1, "A(x[1],c[2]),B(x[1]),C(x1{u}[2],x2{u}[.])": 1, "A(x[.],c[1]),C(x1{u}[1],x2{u}[.])": 0, "C(x1{p}[.],x2{u}[.])": 0, "A(x[.],c[1]),C(x1{p}[.],x2{u}[1])": 0, "C(x1{p}[.],x2{p}[.])": 0, "A(x[1],c[2]),B(x[1]),C(x1{p}[.],x2{u}[2])": 1}}, {"name": "agents of type C", "vector": {"A(x[.],c[.])": 0, "B(x[.])": 0, "C(x1{u}[.],x2{u}[.])": 1, "A(x[1],c[.]),B(x[1])": 0, "A(x[1],c[2]),B(x[1]),C(x1{u}[2],x2{u}[.])": 1, "A(x[.],c[1]),C(x1{u}[1],x2{u}[.])": 1, "C(x1{p}[.],x2{u}[.])": 1, "A(x[.],c[1]),C(x1{p}[.],x2{u}[1])": 1, "C(x1{p}[.],x2{p}[.])": 1, "A(x[1],c[2]),B(x[1]),C(x1{p}[.],x2{u}[2])": 1}}], "species_encoding": "id = structure = canonical Kappa expression: agents in breadth-first order from the root whose text is least, sites in signature order, bonds numbered in order of appearance", "analysis": {"largest_complex": 3, "truncated_by_max_complex_size": false}}, "chemistry": "kappa-calculus", "params": {"model": "abc", "signatures": [], "rules": [], "init": {}, "symmetry": "rule", "max_species": 2000, "max_complex_size": 20}, "seed": 1}