batss.crn
Module for expressing population protocols using CRN notation. Ideas and much code taken from https://github.com/enricozb/python-crn.
The general syntax is
a, b, u = species('A B U')
approx_majority = [
a + b >> 2 * u,
a + u >> 2 * a,
b + u >> 2 * b,
]
n = 10 ** 5
init_config = {a: 0.51 * n, b: 0.49 * n}
sim = Simulation(init_config=init_config, rule=approx_majority)
In other words, a list of reactions is treated by the batss library just like the other ways of specifying
population protocol transitions (the rule parameter in the constructor for
batss.simulation.Simulation, which also
accepts a dict or a Python function).
More examples given in https://github.com/UC-Davis-molecular-computing/batss/tree/main/examples
Functions
|
|
|
Convert a CRN to an equivalent uniform CRN. |
|
Process all reactions before being added to the dictionary. |
|
Create a gillespy2 Model object from a CRN description. |
|
Create a gpac CRN in the form of equivalent initial configuration and list of gpac Reaction objects. |
|
Returns dict representation of reactions, transforming unimolecular reactions to bimolecular, and converting rates to probabilities, also returning the max rate so the |
|
|
|
Create a list of |
|
|
|
|
|
Write stochkit file :type filename: |
Classes
|
Representation of a CRN, a set of reactions. |
|
Class used for very basic symbolic manipulation of left/right hand side of stoichiometric equations. |
|
|
|
Representation of a stoichiometric reaction using a pair of Expressions, one for the reactants and one for the products. |
|