pykappa.rule¶
Classes
|
Rule that acts between two distinct components. |
|
Standard Kappa rule with left-hand side, right-hand side, and rate. |
|
Rule that acts within a single component. |
- class pykappa.rule.Rule(left, right, stochastic_rate)[source]¶
Standard Kappa rule with left-hand side, right-hand side, and rate.
- classmethod list_from_kappa(kappa_str)[source]¶
Parse Kappa string into a list of rules.
Note
Forward-reverse rules (with “<->”) represent two rules.
- Parameters:
kappa_str (str)
- Return type:
list[Self]
- classmethod from_kappa(kappa_str)[source]¶
Parse a single Kappa rule from string.
- Raises:
AssertionError – If the string represents more than one rule.
- Parameters:
kappa_str (str)
- Return type:
Self
- stochastic_rate: Expression¶
- property kappa_str: str¶
- reactivity(system)[source]¶
Calculate the total reactivity of this rule in the given system, i.e. the number of embeddings times the reaction rate, accounting for rule symmetry.
- Parameters:
system (System)
- Return type:
float
- property n_symmetries: int¶
The number of distinct automorphisms of the graph containing both left- and right-hand side agents, augmented with edges between positionally corresponding agents. For example, if a rule looks like “l1(…), l2(…) -> r1(…), r2(…)”, this method draws artifical edges between l1 and r1, and between l2 and r2, then returns the number of symmetries of the resulting graph by counting how many ways it can be mapped onto itself.
- class pykappa.rule.UnimolecularRule(left, right, stochastic_rate)[source]¶
Rule that acts within a single component.