Systems biology
Systems biology: gene circuits, Boolean networks, circadian clocks, signalling cascades, and Min-protein waves.
AtomMapSpec(reaction, reactants, products)
dataclass
Bases: BaseSpec
Atom transitions of a reaction, a string of atom letters for every occurrence of a metabolite.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reaction
|
str
|
The name of the reaction. |
required |
reactants
|
Sequence[tuple[str, str]]
|
Every occurrence of a reactant with its letters, as pairs of a metabolite and a string. |
required |
products
|
Sequence[tuple[str, str]]
|
Every occurrence of a product with its letters, as pairs of a metabolite and a string. |
required |
Raises:
| Type | Description |
|---|---|
ValidationError
|
A product names a letter that no reactant carries, or a reactant repeats a letter, raised by |
Examples:
>>> from skcomplex.systems.biology.systems_biology import AtomMapSpec
>>> atoms = AtomMapSpec('v1', [('AcCoA', 'ab'), ('OAC', 'cdef')], [('Cit', 'fedbac')])
>>> atoms.origins[('Cit', 1)], atoms.origins[('Cit', 5)]
(('OAC', 4), ('AcCoA', 1))
origins
property
Reactant atom of every product atom, as pairs of a metabolite and an atom counted from 1.
BackboneGeometry(structure, system=0)
Bases: BaseConfig[None, Array]
Chain of a structure rebuilt from the angles phi and psi of its backbone, with all other geometry kept.
The angles of a chain of n residues are one array of 2 (n - 1) values in degrees: phi of the residues from the
second to the last, then psi of the residues from the first to the one before the last. The bond lengths, the
bond angles, omega, and the side chains stay as they are in the system. Biopython warns on every rebuild that
NumPy reads where without out, and the class filters this one warning.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
structure
|
StructureSpec
|
The structure, of one chain. |
required |
system
|
int
|
The index of the system that gives the geometry. |
0
|
Attributes:
| Name | Type | Description |
|---|---|---|
angles_ |
The angles of the system, in degrees. |
|
positions_ |
The positions of the atoms after the last run, atoms by 3. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
The structure holds more than one chain, or the angles have another length. |
Examples:
>>> import numpy as np
>>> from skcomplex.systems.biology.systems_biology import BackboneGeometry, read_structure
>>> geometry = BackboneGeometry(read_structure('1L2Y')).prepare()
>>> geometry.angles_.shape
(38,)
>>> geometry.run(geometry.angles_).positions_.shape
(304, 3)
Source code in src/skcomplex/systems/biology/systems_biology/_backbone_geometry.py
56 57 58 | |
read_effective_atoms()
Return the mean atom of every residue of the last run.
Returns:
| Name | Type | Description |
|---|---|---|
positions |
Array
|
Residues by 3. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import BackboneGeometry, read_structure
>>> geometry = BackboneGeometry(read_structure('1L2Y')).prepare()
>>> geometry.run(geometry.angles_).read_effective_atoms().shape
(20, 3)
Source code in src/skcomplex/systems/biology/systems_biology/_backbone_geometry.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
BackboneVisual(position, structure=None, radius=None, states=(), *, trail=0, strip=True, path=None, recording=None)
Bases: PointsVisual
Visual that logs the effective atoms of a chain as points in three dimensions, joined by a line strip in order.
A state of coordinates holds one row of three values per residue. With a structure, the state holds the angles of a
BackboneGeometry instead, and the visual rebuilds the chain from them at every frame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
position
|
str
|
The name of the lattice state of coordinates or angles. |
required |
structure
|
StructureSpec | None
|
The structure whose chain the angles rebuild, or |
None
|
radius
|
float | None
|
The radius of the points, or |
None
|
states
|
Sequence[str] | None
|
The names of the other states to log as time series. |
()
|
trail
|
int
|
The number of recent positions the trail of each point holds, or 0 for no trail. |
0
|
strip
|
bool
|
Whether to join the points in member order by one line strip. |
True
|
path
|
str | None
|
The entity path of the group to draw, which also names it in the problem. |
None
|
recording
|
RecordingStream | None
|
The Rerun recording to log to, or |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
geometry_ |
The chain the angles rebuild, or |
Examples:
>>> from skcomplex.systems.biology.systems_biology import BackboneVisual
>>> BackboneVisual(position='x').strip
True
Source code in src/skcomplex/systems/biology/systems_biology/_fuzzy_oil_drop.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 | |
BooleanFunctionInteraction(label, *, target, inputs, table=(0,))
Bases: MapInteraction
Synchronous update of a node by a truth table of any number of input nodes.
A table of 2^k entries reads the k inputs as the bits of a binary number, from the most significant, and gives
the next value of the target. The update is the sum, over the patterns whose entry is 1, of the product that is 1
exactly on that pattern.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the interaction. |
required |
target
|
Annotated[str, RoleSpec()]
|
The path of the updated node. |
required |
inputs
|
Annotated[list[str], RoleSpec(variadic=True)]
|
The paths of the input nodes, in the order of the bits of the table. |
required |
table
|
tuple[int, ...]
|
The next value of the target for each of the |
(0,)
|
Raises:
| Type | Description |
|---|---|
ValidationError
|
The table does not have one entry per pattern of the inputs. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import BooleanFunctionInteraction
>>> BooleanFunctionInteraction('and', target='c', inputs=['a', 'b'], table=(0, 0, 0, 1)).table
(0, 0, 0, 1)
Source code in src/skcomplex/systems/biology/common/networks/_boolean_function.py
48 49 50 51 52 53 54 55 56 57 58 | |
BooleanNodeElement(label, visual=None, *, x=0)
Bases: Element
Node of a Boolean network, a gene or protein that is on or off.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the node. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
x
|
Annotated[float, StateSpec(domain=FiniteEnumeratedSet([0, 1]))]
|
The initial value, 0 or 1. |
0
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import BooleanNodeElement
>>> BooleanNodeElement('Sic1', x=1).x
1
Source code in src/skcomplex/systems/biology/common/networks/_boolean_node.py
33 34 35 36 37 38 39 40 41 | |
ChainCoordinateElement(label, x=0.0)
Bases: Element
Coordinate of an effective atom of a protein chain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the element. |
required |
x
|
Annotated[float, StateSpec()]
|
The coordinate in ångström. |
0.0
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import ChainCoordinateElement
>>> ChainCoordinateElement('site').x
0.0
Source code in src/skcomplex/systems/biology/systems_biology/_fuzzy_oil_drop.py
83 84 85 | |
DihedralAngleElement(label, angle=0.0)
Bases: Element
Backbone dihedral angle of a protein chain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the element. |
required |
angle
|
Annotated[float, StateSpec()]
|
The angle in degrees. |
0.0
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import DihedralAngleElement
>>> DihedralAngleElement('site').angle
0.0
Source code in src/skcomplex/systems/biology/systems_biology/_fuzzy_oil_drop.py
104 105 106 | |
EllipsePath(long_diagonal=LONG_DIAGONAL, short_diagonal=SHORT_DIAGONAL, cells=72)
Bases: BaseConfig[None, Array]
Ellipse path on the Ramachandran map, with the projection of dihedral angles by the shortest periodic distance.
The path is phi = A cos(t) - B sin(t), psi = -A cos(t) - B sin(t), a centred ellipse whose long diagonal runs
from the upper left to the lower right of the map, with t = 0 in the lower right and t growing clockwise.
Konieczny et al. (2023 §3.7.1, Fig. 3.43d and e) draw this path and print no equation or number for it. The
defaults, 83° and 58°, are readings of a figure and not published numbers: a fit to panel e of that figure gives
84.5° and 56.3° with the centre at the origin, which agrees within the 2.7° of one of its pixels. The origin
and the direction of t are a convention of this class, since the book states neither. The equation and the
parameters of Brylinski et al. (2004, Bioinformatics 20:199) have not been read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
long_diagonal
|
float
|
The value |
LONG_DIAGONAL
|
short_diagonal
|
float
|
The value |
SHORT_DIAGONAL
|
cells
|
int
|
The number of equal cells of the parameter |
72
|
Attributes:
| Name | Type | Description |
|---|---|---|
parameters_ |
The parameter |
|
angles_ |
The projected |
|
cells_ |
The cell of the path of every pair of the last run. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
A diagonal or the number of cells is not positive, or the angles are not pairs. |
Examples:
>>> import numpy as np
>>> from skcomplex.systems.biology.systems_biology import EllipsePath
>>> path = EllipsePath().prepare()
>>> path.read_points(np.array([0.0])).shape
(1, 2)
>>> path.run(np.array([[1.0, -1.0]])).cells_.tolist()
[0]
Source code in src/skcomplex/systems/biology/systems_biology/_early_stage.py
139 140 141 142 143 144 145 146 147 | |
read_points(parameters)
Return the points of the path at some values of its parameter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parameters
|
Array
|
The values of |
required |
Returns:
| Name | Type | Description |
|---|---|---|
points |
Array
|
The |
Examples:
>>> import numpy as np
>>> from skcomplex.systems.biology.systems_biology import EllipsePath
>>> phi, psi = EllipsePath(1.0, 0.5).read_points(np.array([0.0]))[0]
>>> float(phi), float(psi)
(1.0, -1.0)
Source code in src/skcomplex/systems/biology/systems_biology/_early_stage.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
EnsembleReplayInteraction(label, *, target, state, ensemble)
Bases: Interaction
Drive that sets a lattice state to one member of an ensemble per unit of time, holding the last after the end.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the interaction. |
required |
target
|
Annotated[str, RoleSpec()]
|
The path of the lattice group. |
required |
state
|
str
|
The name of the state. |
required |
ensemble
|
Array
|
The members, members by the lattice shape. |
required |
Examples:
>>> import numpy as np
>>> from skcomplex.systems.biology.systems_biology import EnsembleReplayInteraction
>>> EnsembleReplayInteraction('replay', target='chain', state='x', ensemble=np.zeros((2, 3))).state
'x'
Source code in src/skcomplex/systems/biology/systems_biology/_fuzzy_oil_drop.py
132 133 134 135 136 137 138 139 140 141 142 143 | |
EnzymeNodeElement(label, visual=None, *, X=0.1)
Bases: Element
Enzyme of a signalling circuit, the active fraction X of a pool that other enzymes activate and deactivate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the enzyme. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
X
|
Annotated[float, StateSpec(domain=closed(0, 1))]
|
The initial active fraction. |
0.1
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import EnzymeNodeElement
>>> EnzymeNodeElement('A', X=0.2).X
0.2
Source code in src/skcomplex/systems/biology/systems_biology/_adaptation.py
55 56 57 58 59 60 61 62 63 | |
EnzymeRegulationInteraction(label, *, target, source, sign=1, k=1.0, K=0.5)
Bases: Interaction
Michaelis-Menten activation or deactivation of an enzyme by another enzyme of a circuit.
An activating source converts the inactive fraction of the target at the rate k X_s (1 - X) / (1 - X + K), and a
deactivating source the active fraction at the rate k X_s X / (X + K), the kinetics of Ma et al. (2009).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the interaction. |
required |
target
|
Annotated[str, RoleSpec()]
|
The path of the regulated enzyme. |
required |
source
|
Annotated[str, RoleSpec()]
|
The path of the regulating enzyme. |
required |
sign
|
int
|
1 for activation or -1 for deactivation. |
1
|
k
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The catalytic rate. |
1.0
|
K
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The Michaelis constant. |
0.5
|
Raises:
| Type | Description |
|---|---|
ValidationError
|
The sign is neither 1 nor -1. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import EnzymeRegulationInteraction
>>> EnzymeRegulationInteraction('ab', target='B', source='A', sign=-1).sign
-1
Source code in src/skcomplex/systems/biology/systems_biology/_adaptation.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
EnzymeStimulusInteraction(label, *, target, sign=1, k=1.0, K=0.5, level=0.5, change=0.0, at=0.0)
Bases: Interaction
Activation or deactivation of an enzyme by an outside stimulus or a basal enzyme of fixed concentration.
The regulator has the concentration level, which rises by change at the time at, as the input I of a
circuit, and stays fixed for a basal enzyme F with no change. It activates the target at the rate k I (1 - X) /
(1 - X + K) or deactivates it at the rate k I X / (X + K).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the interaction. |
required |
target
|
Annotated[str, RoleSpec()]
|
The path of the regulated enzyme. |
required |
sign
|
int
|
1 for activation or -1 for deactivation. |
1
|
k
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The catalytic rate. |
1.0
|
K
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The Michaelis constant. |
0.5
|
level
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The concentration of the regulator before the change. |
0.5
|
change
|
float
|
The step of the concentration at the time |
0.0
|
at
|
float
|
The time of the step. |
0.0
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import EnzymeStimulusInteraction
>>> EnzymeStimulusInteraction('input', target='A', level=0.5, change=0.1, at=300.0).change
0.1
Source code in src/skcomplex/systems/biology/systems_biology/_adaptation.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
FateLandscapeElement(label, visual=None, *, x=0.0, y=0.0, a=-0.2, theta1=0.0, theta2=0.0, v1=0.0, v2=0.0)
Bases: Element
Cell state in the compactified elliptic umbilic, the minimal landscape of a decision among three fates.
The state (x, y) descends the potential f = x^4 + y^4 + x^3 - 2 x y^2 + a (x^2 + y^2) + theta1 x + theta2 y of
Rand et al. (2021, figure 5D), dx/dt = -df/dx and dy/dt = -df/dy. The signals theta1 and theta2 change
in time at the rates v1 and v2, and the sign of a makes the central rest point an attractor or a repellor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the cell or of the group of cells. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
x
|
Annotated[float, StateSpec()]
|
The initial first coordinate. |
0.0
|
y
|
Annotated[float, StateSpec()]
|
The initial second coordinate. |
0.0
|
a
|
Annotated[float, ParameterSpec()]
|
The curvature of the potential at the centre. |
-0.2
|
theta1
|
Annotated[float, ParameterSpec()]
|
The first signal at the start. |
0.0
|
theta2
|
Annotated[float, ParameterSpec()]
|
The second signal at the start. |
0.0
|
v1
|
Annotated[float, ParameterSpec()]
|
The rate of change of the first signal. |
0.0
|
v2
|
Annotated[float, ParameterSpec()]
|
The rate of change of the second signal. |
0.0
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import FateLandscapeElement
>>> FateLandscapeElement('cell', a=-0.2).a
-0.2
Source code in src/skcomplex/systems/biology/systems_biology/_fates.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
FragmentSpec(metabolite, atoms, name='')
dataclass
Bases: BaseSpec
Fragment of a metabolite whose mass isotopomer distribution a simulation gives or an experiment measures.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metabolite
|
str
|
The metabolite. |
required |
atoms
|
Sequence[int]
|
The atoms of the fragment, counted from 1. |
required |
name
|
str
|
The name of the fragment, or the empty string for the name of the metabolite. |
''
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import FragmentSpec
>>> FragmentSpec('Glu', (1, 2, 3, 4, 5)).label
'Glu'
label
property
Name of the fragment, the name of its metabolite without one of its own.
FuzzyOilDropAnalysis(structure, kind='relative-distance', scale=None, cutoff=CUTOFF, *, observed=None, state=None)
Bases: BaseAnalysis
Distributions of hydrophobicity of a structure and their relative distance, after the fuzzy oil drop system.
The theoretical distribution T is a three-dimensional Gaussian over the effective atoms along the principal axes
of the chain (Eq. 1.1). The observed distribution O is Levitt's sum over the pairs of residues within a cutoff
(Eq. 1.2). The uniform distribution R gives every residue the same value. Then
RD = D_KL(O|T) / (D_KL(O|T) + D_KL(O|R)) in bits (Eqs. 1.3 to 1.6), and K minimises D_KL(O|M) for the profile
M = [T + K [T_max - T]_n]_n (Eq. 1.9), where [...]_n normalises to a sum of one, by SciPy's bounded scalar
minimiser. The equations follow Konieczny et al. (2023 §1.3.1), and the curves of Fig. 1.41 give back its K = 0.5.
Each sigma is a third of the largest absolute coordinate along its axis, one reading of the book's Gaussian that
reaches near zero at 3 sigma (p. 33 and Fig. 1.41), which gives no formula for sigma. The book names no scale, no
orientation of the axes, no fit of K, and no upper bound of it, for which it reports values above 3 (p. 41), so
the Kyte-Doolittle scale, the principal axes, the minimisation, and the bound 5 are choices of this class, as is
leaving a residue out of its own sum in Eq. 1.2, where the book speaks of interactions between residues.
The bundled entries do not reach the RD < 0.5 and K below 0.5 that the book expects of fast-folding and
single-chain proteins (p. 40): the mean RD and K are 0.77 and 2.2 for 1L2Y, 0.70 and 0.98 for 1UBQ, and 0.77 and
2.2 for 5PTI. The gap comes from sigma, since a wider Gaussian closes it and no other choice does.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
structure
|
StructureSpec
|
The structure that gives the residues, and the systems when the source is |
required |
kind
|
str
|
|
'relative-distance'
|
scale
|
Mapping[str, float] | None
|
The hydrophobicity by the three-letter name of a residue, or |
None
|
cutoff
|
float
|
The cutoff distance of the observed distribution in ångström. |
CUTOFF
|
observed
|
ArrayLike | None
|
The observed distribution to use in place of Levitt's sum, one value per residue, or |
None
|
state
|
str | None
|
The dotted name of the lattice state of a trajectory that holds the coordinates, or |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
positions_ |
The effective atoms, frames by residues by 3. |
|
theoretical_ |
The distribution |
|
observed_ |
The distribution |
|
uniform_ |
The distribution |
|
divergences_ |
|
|
values_ |
For the kind |
Raises:
| Type | Description |
|---|---|
AnalysisError
|
The kind is unknown, the cutoff is not positive, the structure holds a residue the scale does not cover, or the positions do not hold one row per residue. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import FuzzyOilDropAnalysis, read_structure
>>> values = FuzzyOilDropAnalysis(read_structure('1L2Y')).prepare().run().values_
>>> values.shape, bool(values.min() >= 0 and values.max() <= 1)
((38,), True)
Source code in src/skcomplex/systems/biology/systems_biology/_fuzzy_oil_drop.py
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | |
GProteinElement(label, visual=None, *, g=0.0, k_on=1.0, k_gtp=0.5, hormone=1.0, start=1.0, width=1.0)
Bases: Element
G protein activated by a hormone pulse and inactivated by its own GTPase, the timer that ends the signal.
The active fraction follows dg/dt = k_on H(t) (1 - g) - k_gtp g, where the hormone H(t) is a rectangular pulse
of height hormone from start for width. Once the hormone is gone, the signal ends after the time 1 / k_gtp.
The element holds the states and parameters and has no laws of its own: the interactions of
hormone_cascade_amplifier read its parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the G protein. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
g
|
Annotated[float, StateSpec(domain=closed_open(0, oo))]
|
The initial active fraction. |
0.0
|
k_on
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The activation rate per unit of hormone. |
1.0
|
k_gtp
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The rate of GTP hydrolysis, which inactivates the protein. |
0.5
|
hormone
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The height of the hormone pulse. |
1.0
|
start
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The time the hormone pulse starts. |
1.0
|
width
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The duration of the hormone pulse. |
1.0
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import GProteinElement
>>> GProteinElement('g_protein').k_gtp
0.5
Source code in src/skcomplex/systems/biology/systems_biology/_cascades.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
GeneElement(label, visual=None, *, m=0.0, p=0.0)
Bases: Element
Gene with a count m of messenger RNA and a count p of protein.
A gene has no laws of its own. Reactions transcribe, translate, and degrade its molecules.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the gene. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
m
|
Annotated[float, StateSpec(domain=closed_open(0, oo))]
|
The initial number of mRNA molecules. |
0.0
|
p
|
Annotated[float, StateSpec(domain=closed_open(0, oo))]
|
The initial number of protein molecules. |
0.0
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import GeneElement
>>> GeneElement('lacI', p=20.0).p
20.0
Source code in src/skcomplex/systems/biology/systems_biology/_genes.py
44 45 46 47 48 49 50 51 52 53 54 | |
GeneralizedMassActionInteraction(label, *, species, stoichiometry=((0.0,),), gamma=(0.0,), orders=((0.0,),))
Bases: Interaction
Rates of a biochemical system in the generalized mass action form of biochemical systems theory.
Flux j is the power law v_j = gamma_j prod_k x_k^f_jk, and species i changes as dx_i/dt = sum_j s_ij v_j.
The kinetic orders f_jk are real numbers, negative for inhibition.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the interaction. |
required |
species
|
Annotated[list[str], RoleSpec(variadic=True)]
|
The paths of the species, in the order of the rows of the stoichiometry. |
required |
stoichiometry
|
Sequence[Sequence[float]]
|
The stoichiometric coefficient |
((0.0,),)
|
gamma
|
Sequence[float]
|
The rate constant of every flux. |
(0.0,)
|
orders
|
Sequence[Sequence[float]]
|
The kinetic order |
((0.0,),)
|
Raises:
| Type | Description |
|---|---|
ValidationError
|
The matrices do not have one row per flux or species and one entry per species or flux. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import GeneralizedMassActionInteraction
>>> v = GeneralizedMassActionInteraction(
... 'v', species=['X'], stoichiometry=((1, -1),), gamma=(1, 2), orders=((0,), (1,))
... )
>>> v.gamma
(1, 2)
Source code in src/skcomplex/systems/biology/systems_biology/_networks.py
323 324 325 326 327 328 329 330 331 332 333 334 335 336 | |
GlucoseSensorInteraction(label, *, node='node', source='source', threshold=None)
Bases: Interaction
Boolean node that reads whether a substrate lies above a threshold, or the previous node of a chain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the interaction. |
required |
node
|
Annotated[str, RoleSpec()]
|
The path of the Boolean node. |
'node'
|
source
|
Annotated[str, RoleSpec()]
|
The path of what the node reads: a substrate with a threshold, or a Boolean node without one. |
'source'
|
threshold
|
float | None
|
The concentration above which the node turns on, or |
None
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import GlucoseSensorInteraction
>>> GlucoseSensorInteraction('sensor', node='a', source='glucose', threshold=0.1).threshold
0.1
Source code in src/skcomplex/systems/biology/systems_biology/_regulatory_fba.py
58 59 60 61 62 63 64 65 66 67 68 69 | |
GlycolysisElement(label, visual=None, *, variables=None)
Bases: DeclaredElement
Yeast glycolysis in a flow reactor, the fifteen metabolites of the model of Nielsen and coworkers.
The model of Nielsen, Sørensen, Hynne, and Busse (1998), BioModels BIOMD0000000042, follows glucose GLC through
hexokinase, phosphofructokinase with its inhibition by the ratio of ATP to AMP, aldolase, glyceraldehyde
phosphate dehydrogenase, phosphoglycerate kinase, pyruvate kinase, pyruvate decarboxylase, alcohol dehydrogenase,
adenylate kinase, and a glycerol branch to P. The reactor is fed with ATP, ADP, NADH, NAD, and glucose
at fixed concentrations and washed out at the rate flow. The concentrations, in mM, and the rate constants, in mM
and per minute, are declared variables named as in the source, and variables replaces any of them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the cell extract. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
variables
|
Mapping[str, DeclaredVariableSpec] | None
|
The declared states and parameters that replace those of the source, by name, or |
None
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import GlycolysisElement
>>> GlycolysisElement('extract').get_value('V4')
10.0
Source code in src/skcomplex/core/components/elements/_declared.py
52 53 54 55 56 57 58 59 60 | |
LabelMeasurementSpec(experiment, fragment, values, deviation=0.002)
dataclass
Bases: BaseSpec
Measured mass isotopomer distribution of a fragment in one tracer experiment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
experiment
|
str
|
The name of the tracer experiment. |
required |
fragment
|
str
|
The name of the fragment. |
required |
values
|
ArrayLike
|
The measured distribution. |
required |
deviation
|
float
|
The standard deviation of every value. |
0.002
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import LabelMeasurementSpec
>>> LabelMeasurementSpec('a', 'Glu', (0.5, 0.5), 0.002).deviation
0.002
distribution
property
Measured distribution as an array.
LabellingAnalysis(kind='simulation', *, atoms=(), tracers=None, fragments=(), measurements=(), fluxes=None, measured_fluxes=None, symmetric=(), starts=5, intervals='linear', random_state=None)
Bases: BaseAnalysis
Isotope labelling of a metabolic network at metabolic and isotopic steady state, of one kind.
The analysis takes a system that holds a metabolic network. It walks the atom maps backward from the fragments to
collect the elementary metabolite units (Antoniewicz et al. 2007), and solves per unit size one sparse linear system
with scipy.sparse.linalg.splu.
'simulation': the mass isotopomer distributions of the fragments for given fluxes.'estimation': the fluxes by weighted least squares over measured distributions and measured fluxes, from seeded feasible starts that the core solve draws. The net fluxes run over a null space basis of the balances, with one exchange flux per reversible reaction, so every balance holds exactly. A 95% interval of every flux and a chi-square test of the fit follow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kind
|
str
|
|
'simulation'
|
atoms
|
Sequence[AtomMapSpec]
|
The atom map of every reaction that moves traced atoms. |
()
|
tracers
|
Mapping[str, Sequence[TracerSpec]] | None
|
The labelled substrates of every parallel experiment, by the name of the experiment. |
None
|
fragments
|
Sequence[FragmentSpec]
|
The fragments to simulate or that measurements name. |
()
|
measurements
|
Sequence[LabelMeasurementSpec]
|
The measured distributions, for |
()
|
fluxes
|
Mapping[str, float | tuple[float, float]] | None
|
The flux of every reaction for |
None
|
measured_fluxes
|
Mapping[str, tuple[float, float]] | None
|
The value and the standard deviation of every measured flux for |
None
|
symmetric
|
Sequence[str]
|
The metabolites whose atoms a producing reaction scrambles, half in each direction. |
()
|
starts
|
int
|
The number of feasible starts of the fit. |
5
|
intervals
|
str
|
|
'linear'
|
random_state
|
int | Generator | None
|
The seed or generator of the starts. |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
distributions_ |
The distribution of every fragment of every experiment. |
|
fluxes_ |
The estimated net flux of every reaction, and the exchange |
|
intervals_ |
The 95% interval of every estimated flux. |
|
identifiable_ |
Whether the data identify every estimated flux, false for an interval that reaches a bound. |
|
residual_ |
The sum of the squares of the weighted residuals at the optimum. |
|
chi2_ |
The range of the sum of squares that the test accepts at the 5% level. |
|
accepted_ |
Whether the residual lies in that range. |
Raises:
| Type | Description |
|---|---|
AnalysisError
|
A setting is unknown or a metabolite has no source of labels, raised by |
ValidationError
|
An atom map is not valid, or two maps give one metabolite different numbers of atoms, raised by |
Examples:
>>> from skcomplex.core.components.spaces import StaticTime
>>> from skcomplex.core.components.system import System
>>> from skcomplex.systems.biology.common.metabolism import ReactionSpec, metabolic_network_type
>>> from skcomplex.systems.biology.systems_biology import (
... AtomMapSpec,
... FragmentSpec,
... LabellingAnalysis,
... TracerSpec,
... )
>>> reactions = {'in': ReactionSpec({'B': 1.0}), 'out': ReactionSpec({'B': -1.0})}
>>> network = metabolic_network_type('ChainElement', reactions)('net')
>>> analysis = LabellingAnalysis(
... atoms=[AtomMapSpec('in', [('A', 'ab')], [('B', 'ba')])],
... tracers={'first': [TracerSpec('A', {'00': 0.5, '01': 0.5})]},
... fragments=[FragmentSpec('B', (1, 2))],
... fluxes={'in': 1.0, 'out': 1.0},
... )
>>> system = System(elements=[network], time=StaticTime())
>>> analysis.prepare(system).run().distributions_['first']['B'].tolist()
[0.5, 0.5, 0.0]
Source code in src/skcomplex/systems/biology/systems_biology/_carbon_13_mfa.py
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 | |
LateralInhibitionInteraction(label, *, cells, kernel=((0.0,),))
Bases: Interaction
Lateral inhibition of the neural fate of cells by their neighbours, through a kernel of the distance.
Following Eq. (2) of Rand et al. (2021), da_i/dt = sigma(a_i - h_i) - a_i with the inhibition h_i = sum_{j != i}
K_ij d(a_j), where sigma(u) = 1 / (1 + exp(-u / width)) and d(a) = sigma(a - 1 / 2). A cell under an
inhibition below 0.37 can only turn neural, above 0.63 only epidermal, and in between it is bistable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the interaction. |
required |
cells
|
Annotated[str, RoleSpec()]
|
The path of the group of cells. |
required |
kernel
|
Sequence[Sequence[float]]
|
The inhibition |
((0.0,),)
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import LateralInhibitionInteraction
>>> LateralInhibitionInteraction('inhibition', cells='cells', kernel=((0.0, 1.0), (1.0, 0.0))).kernel
((0.0, 1.0), (1.0, 0.0))
Source code in src/skcomplex/systems/biology/systems_biology/_fates.py
165 166 167 168 169 170 171 172 173 174 | |
LogicalRegulationInteraction(label, *, target, regulators=(), thresholds=(), parameters=None)
Bases: Interaction
Regulation of a logical variable, which steps one level at a time towards the focal level its regulators set.
In the formalism of Thomas, every regulator acts when its level reaches its threshold. The logical parameters map every combination of acting regulators, a tuple of truth values in the order of the regulators, to the focal level of the target. The target rises or falls by one level towards its focal level at the unit rate, so the transitions of all variables are asynchronous random events.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the interaction. |
required |
target
|
Annotated[str, RoleSpec()]
|
The path of the regulated variable. |
required |
regulators
|
Annotated[Sequence[str], RoleSpec(variadic=True)]
|
The paths of the regulating variables. |
()
|
thresholds
|
Sequence[int]
|
The level at which every regulator acts, in the order of the regulators. |
()
|
parameters
|
Mapping[tuple[bool, ...], int] | None
|
The focal level of the target for every combination of acting regulators. |
None
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import LogicalRegulationInteraction
>>> regulation = LogicalRegulationInteraction(
... 'x_regulation', target='x', regulators=['y'], thresholds=(1,), parameters={(False,): 2, (True,): 0}
... )
>>> regulation.parameters[(True,)]
0
Source code in src/skcomplex/systems/biology/systems_biology/_logical_networks.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |
LogicalVariableElement(label, visual=None, *, level=0.0)
Bases: Element
Variable of a generalised logical network, a discrete level from zero to its largest level.
The levels stand for qualitative concentrations, such as absent, basal, medium, or high, cut at the thresholds at which the variable acts on its targets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the variable. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
level
|
Annotated[float, StateSpec(domain=NN)]
|
The initial level. |
0.0
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import LogicalVariableElement
>>> LogicalVariableElement('x', level=2.0).level
2.0
Source code in src/skcomplex/systems/biology/systems_biology/_logical_networks.py
69 70 71 72 73 74 75 76 77 | |
MajorityNodeElement(label, visual=None, *, sigma=1.0, eta=0.0)
Bases: Element
Node of a noisy Boolean network, a state of plus or minus one that follows the majority of its inputs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the node or of the group of nodes. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
sigma
|
Annotated[float, StateSpec(domain=FiniteEnumeratedSet([-1, 1]))]
|
The state, -1 or 1. |
1.0
|
eta
|
Annotated[float, ParameterSpec(domain=closed(0, 1))]
|
The probability that the node takes the state opposite to the majority. |
0.0
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import MajorityNodeElement
>>> MajorityNodeElement('node', eta=0.1).eta
0.1
Source code in src/skcomplex/systems/biology/systems_biology/_boolean_systems.py
96 97 98 99 100 101 102 103 104 105 106 | |
MinSkeletonElement(label, visual=None, *, md=0.0, mde=0.0, cdt=0.0, cdd=0.0, ce=0.0, Dm=0.013, Dc=60.0, k_d=0.1, k_dd=0.1, k_de=0.5, k_off=0.4, lam=6.0)
Bases: Element
Site of the Min skeleton system, with membrane MinD and MinDE and cytosolic MinD-ATP, MinD-ADP, and MinE.
The reactions are the attachment and self-recruitment of MinD-ATP to the membrane, (k_d + k_dd md) cdt, the
recruitment of MinE by membrane MinD, k_de md ce, the dissociation of MinDE complexes, k_off mde, which releases
MinD-ADP and MinE to the cytosol, and the nucleotide exchange lam cdd from MinD-ADP to MinD-ATP. They conserve
the totals of MinD, md + mde + cdt + cdd, and of MinE, mde + ce.
The element holds the states and parameters and has no laws of its own: the interactions of min_protein_skeleton
read its parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the site or the field. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
md
|
Annotated[float, StateSpec(domain=closed_open(0, oo))]
|
The initial membrane MinD. |
0.0
|
mde
|
Annotated[float, StateSpec(domain=closed_open(0, oo))]
|
The initial membrane MinDE complexes. |
0.0
|
cdt
|
Annotated[float, StateSpec(domain=closed_open(0, oo))]
|
The initial cytosolic MinD-ATP. |
0.0
|
cdd
|
Annotated[float, StateSpec(domain=closed_open(0, oo))]
|
The initial cytosolic MinD-ADP. |
0.0
|
ce
|
Annotated[float, StateSpec(domain=closed_open(0, oo))]
|
The initial cytosolic MinE. |
0.0
|
Dm
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The diffusivity on the membrane. |
0.013
|
Dc
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The diffusivity in the cytosol. |
60.0
|
k_d
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The attachment rate of MinD-ATP. |
0.1
|
k_dd
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The recruitment rate of MinD-ATP by membrane MinD. |
0.1
|
k_de
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The recruitment rate of MinE by membrane MinD. |
0.5
|
k_off
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The dissociation rate of MinDE complexes. |
0.4
|
lam
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The nucleotide exchange rate. |
6.0
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import MinSkeletonElement
>>> MinSkeletonElement('site').lam
6.0
Source code in src/skcomplex/systems/biology/systems_biology/_min_proteins.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
NoisyMajorityInteraction(label, *, nodes, inputs=((0.0,),))
Bases: Interaction
Update of every node of a Boolean network to the sign of the sum of its inputs, flipped with a probability.
Node i takes sign(sum_j sigma_ij) over its inputs with the probability 1 - eta and the opposite sign with
the probability eta, all nodes at once, the network of Huepe and Aldana-González (2002).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the interaction. |
required |
nodes
|
Annotated[str, RoleSpec()]
|
The path of the group of nodes. |
required |
inputs
|
Sequence[Sequence[float]] | sparray
|
The input matrix, dense or sparse, one row per node with 1 for every input, an odd number per row. |
((0.0,),)
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import NoisyMajorityInteraction
>>> NoisyMajorityInteraction('majority', nodes='nodes', inputs=((0.0, 1.0), (1.0, 0.0))).nodes
'nodes'
Source code in src/skcomplex/systems/biology/systems_biology/_boolean_systems.py
131 132 133 134 135 136 137 138 139 140 | |
PathCellElement(label, cell=0.0, amino=0.0)
Bases: Element
Residue of a protein chain whose dihedral angles lie in one cell of an ellipse path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the element. |
required |
cell
|
Annotated[float, StateSpec()]
|
The cell of the path. |
0.0
|
amino
|
Annotated[float, ParameterSpec()]
|
The index of the amino acid of the residue. |
0.0
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import PathCellElement
>>> PathCellElement('residue').cell
0.0
Source code in src/skcomplex/systems/biology/systems_biology/_early_stage.py
83 84 85 86 87 88 89 90 91 | |
PerClockElement(label, visual=None, *, M=0.5, P0=0.5, P1=0.5, P2=0.5, PN=0.5, v_s=0.76, v_m=0.65, K_m=0.5, k_s=0.38, v_d=0.95, K_d=0.2, k1=1.9, k2=1.3, K_I=1.0, n=4.0, V1=3.2, V2=1.58, V3=5.0, V4=2.5, K=2.0)
Bases: Element
PER protein clock of Drosophila, after Goldbeter: per mRNA, three phosphorylation forms, and nuclear PER.
The mRNA M is transcribed under repression by nuclear PER and degraded. Cytosolic PER is translated as P0,
phosphorylated reversibly to P1 and P2, and P2 is degraded or enters the nucleus as PN. Concentrations are
in µM and time in hours.
The element holds the states and parameters and has no laws of its own: the interactions of circadian_clock read
its parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the clock. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
M
|
Annotated[float, StateSpec(domain=closed_open(0, oo))]
|
The initial per mRNA concentration. |
0.5
|
P0
|
Annotated[float, StateSpec(domain=closed_open(0, oo))]
|
The initial unphosphorylated PER. |
0.5
|
P1
|
Annotated[float, StateSpec(domain=closed_open(0, oo))]
|
The initial monophosphorylated PER. |
0.5
|
P2
|
Annotated[float, StateSpec(domain=closed_open(0, oo))]
|
The initial bisphosphorylated PER. |
0.5
|
PN
|
Annotated[float, StateSpec(domain=closed_open(0, oo))]
|
The initial nuclear PER. |
0.5
|
v_s
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The maximal transcription rate. |
0.76
|
v_m
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The maximal mRNA degradation rate. |
0.65
|
K_m
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The Michaelis constant of mRNA degradation. |
0.5
|
k_s
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The translation rate. |
0.38
|
v_d
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The maximal degradation rate of |
0.95
|
K_d
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The Michaelis constant of the degradation of |
0.2
|
k1
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The rate of nuclear entry. |
1.9
|
k2
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The rate of nuclear exit. |
1.3
|
K_I
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The threshold of repression by nuclear PER. |
1.0
|
n
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The Hill coefficient of repression. |
4.0
|
V1
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The maximal rate of the first phosphorylation. |
3.2
|
V2
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The maximal rate of the first dephosphorylation. |
1.58
|
V3
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The maximal rate of the second phosphorylation. |
5.0
|
V4
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The maximal rate of the second dephosphorylation. |
2.5
|
K
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The Michaelis constant of the phosphorylations and dephosphorylations. |
2.0
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import PerClockElement
>>> PerClockElement('clock').v_s
0.76
Source code in src/skcomplex/systems/biology/systems_biology/_clocks.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
PhosphorylationLoopElement(label, visual=None, *, A=1.0, B=0.0, C=0.0, kp1=1.0, kd1=2.0, kp2=2.0, kd2=1.0, kp3=2.0, kd3=1.0, K1=0.01, K2=0.01, K3=0.01, A_T=1.0, B_T=1.0, C_T=1.0)
Bases: Element
Three proteins, each phosphorylated and dephosphorylated by Michaelis-Menten kinetics, that regulate each other.
The states are the unphosphorylated amounts, and each total is conserved. With u_T = A_T - A, and so on:
dA/dt = kp1 u_T / (K1 + u_T) - kd1 C A / (K1 + A),dB/dt = kp2 A (B_T - B) / (K2 + B_T - B) - kd2 B / (K2 + B),dC/dt = kp3 B (C_T - C) / (K3 + C_T - C) - kd3 C / (K3 + C).
The element holds the states and parameters and has no laws of its own: the interactions of
phosphorylation_oscillator read its parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the loop. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
A
|
Annotated[float, StateSpec(domain=closed_open(0, oo))]
|
The initial amount of unphosphorylated A. |
1.0
|
B
|
Annotated[float, StateSpec(domain=closed_open(0, oo))]
|
The initial amount of unphosphorylated B. |
0.0
|
C
|
Annotated[float, StateSpec(domain=closed_open(0, oo))]
|
The initial amount of unphosphorylated C. |
0.0
|
kp1
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The maximal rate that restores A. |
1.0
|
kd1
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The catalytic rate of the conversion of A by C. |
2.0
|
kp2
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The catalytic rate of the conversion of B by A. |
2.0
|
kd2
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The maximal rate that removes B. |
1.0
|
kp3
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The catalytic rate of the conversion of C by B. |
2.0
|
kd3
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The maximal rate that removes C. |
1.0
|
K1
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The Michaelis constant of both reactions of A. |
0.01
|
K2
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The Michaelis constant of both reactions of B. |
0.01
|
K3
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The Michaelis constant of both reactions of C. |
0.01
|
A_T
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The total amount of A. |
1.0
|
B_T
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The total amount of B. |
1.0
|
C_T
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The total amount of C. |
1.0
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import PhosphorylationLoopElement
>>> PhosphorylationLoopElement('loop', A=0.5).A
0.5
Source code in src/skcomplex/systems/biology/systems_biology/_networks.py
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | |
ProbabilisticFunctionInteraction(label, *, target, inputs, tables=((0,),), probabilities=(1.0,))
Bases: MapInteraction
Synchronous map of a node by one of several truth tables, drawn with given probabilities at every step.
Each table of 2^k entries reads the k inputs as the bits of a binary number, from the most significant, and
gives the next value x of the target. A second update of the same step records the index of the drawn table in
the state function of the target, from the same draw.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the interaction. |
required |
target
|
Annotated[str, RoleSpec()]
|
The path of the updated node, a |
required |
inputs
|
Annotated[list[str], RoleSpec(variadic=True)]
|
The paths of the input nodes, in the order of the bits of the tables. |
required |
tables
|
Sequence[Sequence[int]]
|
The candidate truth tables. |
((0,),)
|
probabilities
|
Sequence[float]
|
The probability of every table. |
(1.0,)
|
Raises:
| Type | Description |
|---|---|
ValidationError
|
The tables and the probabilities differ in number, or a table does not have one entry per pattern. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import ProbabilisticFunctionInteraction
>>> function = ProbabilisticFunctionInteraction(
... 'f', target='c', inputs=['a', 'b'], tables=((0, 0, 0, 1), (0, 1, 1, 1)), probabilities=(0.7, 0.3)
... )
>>> function.probabilities
(0.7, 0.3)
Source code in src/skcomplex/systems/biology/systems_biology/_probabilistic.py
105 106 107 108 109 110 111 112 113 114 115 116 117 | |
ProbabilisticNodeElement(label, visual=None, *, x=0, function=0)
Bases: Element
Node of a probabilistic Boolean network, on or off, with the index of the function that set it last.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the node. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
x
|
Annotated[float, StateSpec(domain=FiniteEnumeratedSet([0, 1]))]
|
The initial value, 0 or 1. |
0
|
function
|
Annotated[float, StateSpec(domain=NN)]
|
The index of the candidate function of the last update, 0 at the start. |
0
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import ProbabilisticNodeElement
>>> ProbabilisticNodeElement('x1', x=1).x
1
Source code in src/skcomplex/systems/biology/systems_biology/_probabilistic.py
56 57 58 59 60 61 62 63 64 65 66 | |
ProneuralCellElement(label, visual=None, *, a=0.0, width=0.127)
Bases: Element
Cell of an epithelium that adopts the neural fate when the inhibition from its neighbours is weak.
The state a runs from 0, the epidermal fate, to 1, the neural fate of a sensory bristle. The sigmoids of the
lateral inhibition share the width width.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the cell or of the group of cells. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
a
|
Annotated[float, StateSpec(domain=closed(0, 1))]
|
The initial neural state. |
0.0
|
width
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The width of the sigmoids. |
0.127
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import ProneuralCellElement
>>> ProneuralCellElement('cell', a=0.1).a
0.1
Source code in src/skcomplex/systems/biology/systems_biology/_fates.py
129 130 131 132 133 134 135 136 137 138 139 | |
RepressionInteraction(label, *, reactants=None, products=None, modifiers=None, alpha=1.0, alpha0=0.0, K=1.0, n=1.0, mode='rate')
Bases: ReactionInteraction
Synthesis of a product at the rate alpha0 + alpha (1 - hill(y, K, n)), repressed by a modifier y.
The product, such as the mRNA of a gene, gains units at the leaky rate alpha0 plus the rate alpha lowered by the
decreasing Hill function 1 / (1 + (y / K)^n) of the one modifier, the repressor. The repressor enters the rate
and does not change. In the mode 'jump' every synthesis is a random event that adds one unit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the repression. |
required |
reactants
|
Annotated[Stoichiometry | None, RoleSpec(variadic=True)]
|
The coefficients of the reactants, or |
None
|
products
|
Annotated[Stoichiometry | None, RoleSpec(variadic=True)]
|
The coefficient of the synthesized state, such as |
None
|
modifiers
|
Annotated[Stoichiometry | None, RoleSpec(variadic=True)]
|
The coefficient of the repressor state, such as |
None
|
alpha
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The synthesis rate without repressor. |
1.0
|
alpha0
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The leaky synthesis rate at saturating repressor. |
0.0
|
K
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The repressor amount at half repression. |
1.0
|
n
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The Hill coefficient of the repression. |
1.0
|
mode
|
str
|
The form of the laws, |
'rate'
|
Raises:
| Type | Description |
|---|---|
ValidationError
|
The mode is unknown, the reaction has neither reactants nor products, or an entry is not a pair of a path and a state name with a positive coefficient. |
Examples:
>>> from skcomplex.core.components.system import System
>>> from skcomplex.core.engine.runtime import Simulation
>>> from skcomplex.systems.biology.systems_biology import RepressionInteraction, SpeciesElement
>>> repression = RepressionInteraction(
... 'repression', products={('mRNA', 'x'): 1}, modifiers={('repressor', 'x'): 1}, alpha=2.0, K=1.0
... )
>>> species = [SpeciesElement('mRNA'), SpeciesElement('repressor', x=1.0)]
>>> trajectory = Simulation(System(elements=species, interactions=[repression]), dt=0.1).prepare()
>>> round(float(trajectory.run(until=1.0).trajectory_.values('mRNA.x')[-1]), 3)
1.0
Source code in src/skcomplex/systems/biology/common/kinetics/_repression.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
SSystemInteraction(label, *, species, alpha=(), beta=(), g=((0.0,),), h=((0.0,),))
Bases: GeneralizedMassActionInteraction
Rates of a biochemical system in the S-system form of biochemical systems theory.
Every species has one aggregated production and one aggregated degradation, both power laws:
dx_i/dt = alpha_i prod_j x_j^g_ij - beta_i prod_j x_j^h_ij. It is the generalized mass action form with two
fluxes per species.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the interaction. |
required |
species
|
Annotated[list[str], RoleSpec(variadic=True)]
|
The paths of the species. |
required |
alpha
|
Annotated[Sequence[float], ParameterSpec(per=species, domain=closed_open(0, oo))]
|
The rate constant of the production of every species. |
()
|
beta
|
Annotated[Sequence[float], ParameterSpec(per=species, domain=closed_open(0, oo))]
|
The rate constant of the degradation of every species. |
()
|
g
|
Sequence[Sequence[float]]
|
The kinetic orders of the productions, one row per species. |
((0.0,),)
|
h
|
Sequence[Sequence[float]]
|
The kinetic orders of the degradations, one row per species. |
((0.0,),)
|
Raises:
| Type | Description |
|---|---|
ValidationError
|
The kinetic orders do not have one row and one column per species. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import SSystemInteraction
>>> SSystemInteraction('rates', species=['X'], alpha=[1.0], beta=[1.0], g=((0.0,),), h=((1.0,),)).h
((1.0,),)
Source code in src/skcomplex/systems/biology/systems_biology/_networks.py
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | |
SpeciesElement(label, visual=None, *, x=0.0)
Bases: Element
Molecular species, an mRNA, an enzyme, a messenger, or a metabolite, with a nonnegative concentration x.
A species has no laws of its own, and reactions synthesize, convert, and degrade it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the species. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
x
|
Annotated[float, StateSpec(domain=closed_open(0, oo))]
|
The initial concentration. |
0.0
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import SpeciesElement
>>> SpeciesElement('camp', x=2.0).x
2.0
Source code in src/skcomplex/systems/biology/common/kinetics/_species.py
36 37 38 39 40 41 42 43 44 | |
StructureSpec(coordinates, atom_names, residue_names, residue_numbers, chain_names)
dataclass
Bases: BaseSpec
Spec of a molecular structure, every system of an ensemble with the same atoms.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coordinates
|
Array
|
The positions in ångström, systems by atoms by 3. |
required |
atom_names
|
tuple[str, ...]
|
The name of every atom. |
required |
residue_names
|
tuple[str, ...]
|
The name of the residue of every atom. |
required |
residue_numbers
|
tuple[int, ...]
|
The number of the residue of every atom in its chain. |
required |
chain_names
|
tuple[str, ...]
|
The name of the chain of every atom. |
required |
Raises:
| Type | Description |
|---|---|
ValidationError
|
The coordinates are not systems by atoms by 3, or the names do not hold one entry per atom. |
Examples:
>>> import numpy as np
>>> from skcomplex.systems.biology.systems_biology import StructureSpec
>>> atoms = StructureSpec(np.zeros((1, 2, 3)), ('N', 'CA'), ('GLY', 'GLY'), (1, 1), ('A', 'A'))
>>> atoms.residues
(('A', 1, 'GLY'),)
effective_atoms
property
Mean atom of every residue, systems by residues by 3.
residues
property
Chain, number, and name of every residue, in the order of the atoms.
ThresholdFunctionInteraction(label, *, target, inputs, weights=(), decays=False)
Bases: MapInteraction
Synchronous update of a node by the sign of the weighted sum of its active inputs, after Li et al.
The node turns on when the sum w_0 x_0 + w_1 x_1 + ... over its inputs is positive and off when it is negative.
When the sum is zero, a node that decays turns off and any other node keeps its value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the interaction. |
required |
target
|
Annotated[str, RoleSpec()]
|
The path of the updated node. |
required |
inputs
|
Annotated[list[str], RoleSpec(variadic=True)]
|
The paths of the input nodes. |
required |
weights
|
Annotated[Sequence[float], ParameterSpec(per=inputs)]
|
The weight of every input, positive for activation and negative for inhibition. |
()
|
decays
|
bool
|
Whether the node turns off without net input. |
False
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import ThresholdFunctionInteraction
>>> ThresholdFunctionInteraction('sic1', target='Sic1', inputs=['Swi5', 'Cln1_2'], weights=[1.0, -1.0]).weights
[1.0, -1.0]
Source code in src/skcomplex/systems/biology/systems_biology/_boolean.py
70 71 72 73 74 75 76 77 78 79 80 81 82 | |
ToyNetworkElement(label, visual=None, *, objective=None, parsimonious=False, infeasible='raise', name='ToyNetwork', reactions=TOY_REACTIONS, default_objective=TOY_OBJECTIVE, variables=None)
Bases: MetabolicNetworkElement
The toy network of Table 8.2 of Raman (2021), which grows on A alone.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the element. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
objective
|
Mapping[str, float] | None
|
The coefficient of every reaction in the objective, or |
None
|
parsimonious
|
bool
|
Whether to minimise the total absolute flux after the objective. |
False
|
infeasible
|
str
|
The infeasibility policy of the program. |
'raise'
|
name
|
str | None
|
The name of the network. |
'ToyNetwork'
|
reactions
|
Mapping[str, ReactionSpec]
|
The reactions by name. |
TOY_REACTIONS
|
default_objective
|
Mapping[str, float]
|
The objective of the network when |
TOY_OBJECTIVE
|
variables
|
Mapping[str, DeclaredVariableSpec] | None
|
The declared states and parameters that replace the ones of the reactions, by name, or |
None
|
Examples:
>>> from skcomplex.systems.biology.common.metabolism import ToyNetworkElement
>>> ToyNetworkElement('cell').get_value('upper_v1')
1000.0
Source code in src/skcomplex/systems/biology/common/metabolism/_toy_network.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
TracerSpec(metabolite, fractions)
dataclass
Bases: BaseSpec
Labelling of a substrate, the fraction of every isotopomer as a bit string with atom 1 first.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metabolite
|
str
|
The metabolite. |
required |
fractions
|
Mapping[str, float]
|
The fraction of every isotopomer, such as |
required |
Raises:
| Type | Description |
|---|---|
ValidationError
|
The fractions do not sum to 1, or their bit strings differ in length, raised by |
Examples:
>>> from skcomplex.systems.biology.systems_biology import TracerSpec
>>> TracerSpec('AcCoA', {'00': 0.5, '11': 0.5}).size
2
size
property
Number of atoms of the metabolite.
biochemical_systems_theory(x=(0.5, 1.0, 4.0), *, form='s-system', alpha=PATHWAY_ALPHA, beta=PATHWAY_BETA, g=PATHWAY_G, h=PATHWAY_H, stoichiometry=PATHWAY_STOICHIOMETRY, gamma=PATHWAY_GAMMA, orders=PATHWAY_ORDERS)
Return a biochemical system of power-law rates, in the S-system or the generalized mass action form.
The S-system form gives every species one production and one degradation,
dx_i/dt = alpha_i prod_j x_j^g_ij - beta_i prod_j x_j^h_ij. The generalized mass action form sums power-law
fluxes, dx_i/dt = sum_j s_ij gamma_j prod_k x_k^f_jk. The book states only the two forms. The default is a
choice, an unbranched pathway X1 -> X2 -> X3 whose end product inhibits the supply of X1, written in both forms
with the same rates, dX1/dt = 2 X3^-0.5 - X1^0.5, dX2/dt = X1^0.5 - X2^0.5, and dX3/dt = X2^0.5 - X3^0.5.
The steady state of an S-system solves the linear system (g - h) log x = log(beta / alpha), here x = (2, 2, 2).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Sequence[float]
|
The initial concentrations of the species. |
(0.5, 1.0, 4.0)
|
form
|
str
|
|
's-system'
|
alpha
|
Sequence[float]
|
The rate constants of the productions of the S-system. |
PATHWAY_ALPHA
|
beta
|
Sequence[float]
|
The rate constants of the degradations of the S-system. |
PATHWAY_BETA
|
g
|
Sequence[Sequence[float]]
|
The kinetic orders of the productions of the S-system, one row per species. |
PATHWAY_G
|
h
|
Sequence[Sequence[float]]
|
The kinetic orders of the degradations of the S-system, one row per species. |
PATHWAY_H
|
stoichiometry
|
Sequence[Sequence[float]]
|
The stoichiometric coefficients of the generalized mass action form, one row per species. |
PATHWAY_STOICHIOMETRY
|
gamma
|
Sequence[float]
|
The rate constants of the fluxes of the generalized mass action form. |
PATHWAY_GAMMA
|
orders
|
Sequence[Sequence[float]]
|
The kinetic orders of the fluxes of the generalized mass action form, one row per flux. |
PATHWAY_ORDERS
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the concentrations |
Raises:
| Type | Description |
|---|---|
ValidationError
|
The form is unknown. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import biochemical_systems_theory
>>> biochemical_systems_theory(form='gma').interactions[0].gamma
(2.0, 1.0, 1.0, 1.0)
Source code in src/skcomplex/systems/biology/systems_biology/_networks.py
608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 | |
boolean_repressilator(x=(1, 0, 0), *, delay=0)
Return the Boolean repressilator, where LacI represses TetR, TetR represses cI, and cI represses LacI.
The transfer functions are TetR* = NOT LacI, cI* = NOT TetR, and LacI* = NOT cI. From a state with one or two
genes on, the genes switch on and off in turn with period 6, and the states 000 and 111 alternate with period
2. A repression delayed by delay steps passes through that many relay nodes, <repressor>_1 and so on, which
copy the repressor one step later and start at its initial value. The oscillation remains, with period
6 (delay + 1).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Sequence[int]
|
The initial values of LacI, TetR, and cI. |
(1, 0, 0)
|
delay
|
int
|
The number of steps by which every repression is delayed. |
0
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the values |
Raises:
| Type | Description |
|---|---|
ValidationError
|
The delay is negative. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import boolean_repressilator
>>> [node.label for node in boolean_repressilator(delay=1).elements]
['LacI', 'TetR', 'cI', 'LacI_1', 'TetR_1', 'cI_1']
Source code in src/skcomplex/systems/biology/systems_biology/_boolean_systems.py
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | |
bristle_lateral_inhibition(cells=40, *, strength=1.0, length=2.5, width=0.127, noise=0.05, seed=0)
Return a ring of cells that inhibit the neural fate of their neighbours, leaving sparse, evenly spaced bristles.
Following Eq. (2) of Rand et al. (2021), every cell relaxes to sigma(a_i - h_i) under the inhibition h_i = sum_j
K_ij d(a_j), with the Gaussian kernel K_ij = strength exp(-d_ij^2 / (2 length^2)) of the distance d_ij along
the ring. All cells start near the epidermal state and rise together, until small differences break the symmetry
at a saddle on the diagonal: the leading cells turn neural and silence their neighbours, so the neural cells end
several cell diameters apart.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cells
|
int
|
The number of cells on the ring. |
40
|
strength
|
float
|
The inhibition between neighbouring cells at zero distance. |
1.0
|
length
|
float
|
The range of the inhibition, in cell diameters. |
2.5
|
width
|
float
|
The width of the sigmoids. |
0.127
|
noise
|
float
|
The largest initial neural state, drawn uniformly from zero. |
0.05
|
seed
|
int | None
|
The seed of the initial states. |
0
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the neural states |
Examples:
>>> from skcomplex.systems.biology.systems_biology import bristle_lateral_inhibition
>>> bristle_lateral_inhibition(10).elements[0].prepare().size_
10
Source code in src/skcomplex/systems/biology/systems_biology/_fates.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | |
carbon_13_mfa(network=None)
Return a metabolic network that LabellingAnalysis fits to labelling data, the TCA example by default.
Labelled atoms of a tracer spread through the network along its atom transitions, so the measured mass isotopomer
distributions of its products carry the fluxes (Raman 2021, Section 9.7). tca_labelling_analysis gives the
analysis of the TCA example of Antoniewicz et al. (2007) with data simulated from its known fluxes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
MetabolicNetworkElement | None
|
The metabolic network, or |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import carbon_13_mfa
>>> carbon_13_mfa().elements[0].label
'tca'
Source code in src/skcomplex/systems/biology/systems_biology/_carbon_13_mfa.py
1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 | |
circadian_clock(*, v_s=0.76, v_d=0.95, k_s=0.38, n=4.0)
Return Goldbeter's system of the Drosophila circadian clock, PER that represses its own transcription.
Multiple phosphorylation and nuclear entry delay the negative feedback, which yields a limit cycle with a period
near 24 hours for the published parameters. Larger degradation v_d lengthens the period, from 22.6 hours at
v_d = 0.8 to 29.3 hours at v_d = 1.6.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
v_s
|
float
|
The maximal transcription rate in µM/h. |
0.76
|
v_d
|
float
|
The maximal degradation rate of bisphosphorylated PER in µM/h. |
0.95
|
k_s
|
float
|
The translation rate per hour. |
0.38
|
n
|
float
|
The Hill coefficient of repression. |
4.0
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the concentrations |
Examples:
>>> from skcomplex.systems.biology.systems_biology import circadian_clock
>>> circadian_clock(v_d=1.2).elements[0].v_d
1.2
Source code in src/skcomplex/systems/biology/systems_biology/_clocks.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | |
dynamic_fba(approach='static', *, biomass=0.01, glucose=10.0, vmax=10.0, km=0.015, interval=SYNCHRONISATION)
Return a batch culture of the E. coli core system, which needs the extra metabolism.
The program solves for the fluxes with Michaelis-Menten glucose uptake and then the smallest total flux. By the
static optimisation approach it solves in a discrete partition at every synchronisation point, and the biomass and
the glucose integrate with the fluxes held (Raman 2021, Eqs. 9.8 and 9.9). By the direct approach it solves at every
evaluation of the drift. Without glucose the program is infeasible, and the policy 'zero' stops growth, so biomass
grows in one phase and stays.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
approach
|
str
|
|
'static'
|
biomass
|
float
|
The initial biomass in gDW per L. |
0.01
|
glucose
|
float
|
The initial glucose in mM. |
10.0
|
vmax
|
float
|
The largest glucose uptake in mmol per gDW per h. |
10.0
|
km
|
float
|
The half-saturation concentration of glucose in mM. |
0.015
|
interval
|
float
|
The synchronisation interval of the static optimisation approach in h. |
SYNCHRONISATION
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
The approach is unknown. |
MissingExtraError
|
The extra is not installed. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import dynamic_fba
>>> [system.label for system in dynamic_fba().systems]
['fba', 'culture']
Source code in src/skcomplex/systems/biology/systems_biology/_dynamic_fba.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
early_stage_folding_intermediate(entry=ENTRY, *, cells=CELLS, temperature=1.0)
Return the residues of a protein sampling the cells of an ellipse path of the Ramachandran map by heat bath.
Each residue takes a cell of EllipsePath, the limited conformational space of the early stage after Konieczny et
al. (2023 §3.7.1), with the local energy -log p(cell | amino acid) of the probabilities of
read_cell_probabilities. The heat bath and the 72 cells of equal t are choices of this system: the 72 of the
book counts 5° steps of one angle of the whole map (p. 147).
Each unit of time makes as many draws as the chain has residues, each drawing the cell of one random residue from
p(cell | amino acid) raised to one over the temperature, renormalised, so at temperature 1 the cells follow the
probabilities. The local energies enter through a row score, their sum over the chain, since the change of the score
with the cell of one residue is the change of its local energy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entry
|
str
|
The bundled entry whose sequence the system samples. |
ENTRY
|
cells
|
int
|
The number of cells of the path. |
CELLS
|
temperature
|
float
|
The temperature, in the units of the local energy. |
1.0
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the lattice |
Raises:
| Type | Description |
|---|---|
MissingExtraError
|
The extra |
ValidationError
|
The temperature is not positive. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import early_stage_folding_intermediate
>>> early_stage_folding_intermediate().elements[0].space.shape
(1, 58)
Source code in src/skcomplex/systems/biology/systems_biology/_early_stage.py
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | |
elementary_flux_modes(knockouts=())
Return the toy network of Raman whose steady-state cone ElementaryModeAnalysis enumerates.
Every steady-state flux of the network is a non-negative combination of the elementary modes of its cone (Raman
2021, Section 9.8). The toy network has two modes, through v1 and through v2 and v3, both with growth yield
1/12 on A, so the bound 1000 on v6 limits the growth to 50 whichever route carries the flux.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
knockouts
|
Sequence[str]
|
The reactions to fix at zero. |
()
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system. |
Examples:
>>> from skcomplex.core.analysis import ElementaryModeAnalysis
>>> from skcomplex.systems.biology.systems_biology import elementary_flux_modes
>>> analysis = ElementaryModeAnalysis(normalize='cell.v_b1').prepare(elementary_flux_modes()).run()
>>> analysis.modes_.shape[0]
2
Source code in src/skcomplex/systems/biology/systems_biology/_elementary_flux_modes.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
enzyme_adaptation_circuit(links=NEGATIVE_FEEDBACK_BUFFER, *, k=RATES, K=CONSTANTS, k_basal=BASAL_RATES, K_basal=BASAL_CONSTANTS, level=0.5, change=0.1, at=300.0)
Return a circuit of three enzymes A, B, and C of Ma et al., whose output C may adapt to a step of the input.
The input I activates A, and links[i][j], 1, -1, or 0, says whether enzyme j activates, deactivates, or
leaves enzyme i, with Michaelis-Menten kinetics of the rate k[j][i] and the constant K[j][i], the last row of
k and K for the input. A node with no activator gets a basal activating enzyme and one with no deactivator a
basal deactivating enzyme, both of concentration 0.5 with the constants k_basal and K_basal. The input steps
from level by change at the time at. Ma et al. enumerated the 16,038 topologies of three nodes whose input
reaches C and found that adaptation, a sensitive transient followed by a precise return, needs a negative feedback
loop with a buffer node or an incoherent feedforward loop with a proportioner node. The default is the negative
feedback loop A to C to B, B deactivating A, with a parameter set that adapts: the buffer B works in saturation, so
its steady state fixes the output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
links
|
Sequence[Sequence[int]]
|
The signs of the regulations, one row per regulated node and one column per regulating node. |
NEGATIVE_FEEDBACK_BUFFER
|
k
|
Sequence[Sequence[float]]
|
The catalytic rates, one row per regulating node and the input last, one column per regulated node. |
RATES
|
K
|
Sequence[Sequence[float]]
|
The Michaelis constants, in the layout of |
CONSTANTS
|
k_basal
|
Sequence[float]
|
The catalytic rates of the basal enzymes of every node. |
BASAL_RATES
|
K_basal
|
Sequence[float]
|
The Michaelis constants of the basal enzymes of every node. |
BASAL_CONSTANTS
|
level
|
float
|
The input before the step. |
0.5
|
change
|
float
|
The step of the input. |
0.1
|
at
|
float
|
The time of the step. |
300.0
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the active fractions |
Raises:
| Type | Description |
|---|---|
ValidationError
|
The links are not a three by three matrix of 1, -1, and 0. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import enzyme_adaptation_circuit
>>> [interaction.label for interaction in enzyme_adaptation_circuit().interactions][:3]
['input', 'B_A', 'C_B']
Source code in src/skcomplex/systems/biology/systems_biology/_adaptation.py
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | |
flux_balance(network='toy', *, oxygen=1000.0, parsimonious=False)
Return flux balance analysis of a metabolic network, which sets its fluxes to maximise growth.
The steady-state balances of the metabolites and the bounds of the reactions confine the fluxes, and the optimum of
the growth flux sets them (Raman 2021, Section 8.6). The toy network of Table 8.2 reaches growth 50, set by the
bound 1000 on v6. The E. coli core system needs the extra metabolism, and grows at 0.8739 h^-1 on glucose with
oxygen and at 0.2117 h^-1 without.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
str
|
|
'toy'
|
oxygen
|
float
|
The largest oxygen uptake of the E. coli core system. |
1000.0
|
parsimonious
|
bool
|
Whether to minimise the total absolute flux after growth. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
The network is unknown. |
MissingExtraError
|
The E. coli core system needs the extra, which is not installed. |
Examples:
>>> from skcomplex.core.engine.runtime import Simulation
>>> from skcomplex.systems.biology.systems_biology import flux_balance
>>> trajectory = Simulation(flux_balance()).prepare().run(0.0).trajectory_
>>> round(float(trajectory.values('cell.v_vbio')[0]), 6)
50.0
Source code in src/skcomplex/systems/biology/systems_biology/_flux_balance.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
fuzzy_oil_drop(entry=ENTRY, *, dynamics='replay', proposals=1, width=60.0, temperature=0.0)
Return the fuzzy oil drop of a protein, an ensemble replayed one member per frame or a chain folded by moves.
The default replays the systems of an entry, which sets the effective atoms of the chain, the mean atom of each
residue, to one system per unit of time. With dynamics='folding', the chain starts extended, with all phi =
-120° and psi = 130°, and each unit of time proposes moves of its dihedral angles, accepted by the row score RD
plus one for every pair of effective atoms closer than 3 Å and at least two residues apart. The observables RD and
K follow Konieczny et al. (2023 §1.3.1) through FuzzyOilDropAnalysis. The book gives no folding dynamics, so the
extended start, the clash rule, the rotation width of 60°, and the temperature are choices of this system.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entry
|
str
|
The bundled entry, |
ENTRY
|
dynamics
|
str
|
|
'replay'
|
proposals
|
int
|
The number of dihedral moves per unit of time of the folding. |
1
|
width
|
float
|
The largest rotation of a dihedral move, in degrees. |
60.0
|
temperature
|
float
|
The temperature of the folding, one over the intensity of its sampling, where 0 accepts only moves that do not raise the score. |
0.0
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the lattice |
Raises:
| Type | Description |
|---|---|
MissingExtraError
|
The extra |
ValidationError
|
The dynamics are unknown. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import fuzzy_oil_drop
>>> fuzzy_oil_drop().elements[0].space.shape
(20, 3)
Source code in src/skcomplex/systems/biology/systems_biology/_fuzzy_oil_drop.py
493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 | |
generalized_logical_network(regulations=None, levels=None)
Return a generalised logical network of Thomas, whose variables step asynchronously towards focal levels.
Every variable takes discrete levels, and each of its regulators acts once its level reaches a threshold. The
logical parameters give the focal level of the variable for every combination of acting regulators, and the
variable rises or falls one level at a time towards it, each step a random event, so the dynamics explores the
asynchronous state transition graph. The default is the negative circuit of a three-level x that activates y at
its second threshold and a Boolean y that represses x, whose state graph is a cycle, a sustained oscillation.
A positive circuit, two mutual repressors, has two stable states instead.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
regulations
|
Regulations | None
|
For every variable, its regulators, their thresholds, and the logical parameters of its focal level, or
|
None
|
levels
|
Mapping[str, int] | None
|
The initial level of every variable, or |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the levels |
Examples:
>>> from skcomplex.systems.biology.systems_biology import generalized_logical_network
>>> [element.label for element in generalized_logical_network().elements]
['x', 'y']
Source code in src/skcomplex/systems/biology/systems_biology/_logical_networks.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | |
glycolysis_oscillations(*, flow=0.011, V4=10.0)
Return the glycolysis of a yeast extract in a flow reactor, whose NADH oscillates with a period of minutes.
The model of Nielsen et al. (1998), BioModels BIOMD0000000042, has fifteen metabolites, the inhibition of
phosphofructokinase by ATP and its activation by AMP, and the exchange with the feed of the reactor at the rate
flow. With the published parameters the reactor settles on sustained oscillations of NADH and of all the
other metabolites. Raman (2021, exercise 5.7) varies V4, K4GAP, K4NAD, k8f, and k8b by half to study
their effect on NAD and NADH.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flow
|
float
|
The flow rate of the reactor, per minute. |
0.011
|
V4
|
float
|
The largest rate of glyceraldehyde phosphate dehydrogenase, in mM per minute. |
10.0
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the concentrations |
Examples:
>>> from skcomplex.systems.biology.systems_biology import glycolysis_oscillations
>>> glycolysis_oscillations(flow=0.02).elements[0].get_value('flow')
0.02
Source code in src/skcomplex/systems/biology/systems_biology/_networks.py
784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 | |
goodwin_oscillator(variables=3, x=None, *, a=100.0, b=1.0, K=1.0, n=12.0, k=1.0)
Return the Goodwin oscillator, a chain of stages whose last one represses the synthesis of the first.
The first stage, an mRNA, is synthesized at a / (1 + (x_N / K)^n) and every later stage at k times the stage
before it, and every stage decays at rate b: dx_1/dt = a / (1 + (x_N / K)^n) - b x_1 and
dx_i/dt = k x_(i-1) - b x_i. The book points to BioModels and prints no equations, so the system takes the
standard form of Goodwin with the degradation of Griffith. With equal degradation rates the fixed point loses
stability when the loop gain passes sec(pi / N)^N, 8 for three stages. When a is large the repressor saturates
and the gain is close to n, so three stages oscillate for Hill coefficients above about 8 and settle for lower
ones. The concentrations and the time are dimensionless.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
variables
|
int
|
The number of stages, at least 2. |
3
|
x
|
Sequence[float] | None
|
The initial concentrations of the stages, or |
None
|
a
|
float
|
The maximal synthesis rate of the first stage. |
100.0
|
b
|
float
|
The degradation rate of every stage. |
1.0
|
K
|
float
|
The concentration of the last stage at half repression. |
1.0
|
n
|
float
|
The Hill coefficient of the repression. |
12.0
|
k
|
float
|
The synthesis rate of every later stage per unit of the stage before it. |
1.0
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the concentrations |
Raises:
| Type | Description |
|---|---|
ValidationError
|
There are fewer than two stages, or the initial concentrations do not match them. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import goodwin_oscillator
>>> [stage.label for stage in goodwin_oscillator(4).elements]
['x1', 'x2', 'x3', 'x4']
Source code in src/skcomplex/systems/biology/systems_biology/_networks.py
701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 | |
hormone_cascade_amplifier(alpha=(10.0, 100.0, 1.0, 10.0, 10.0), beta=(1.0, 2.0, 0.5, 1.0, 1.0), *, k_on=1.0, k_gtp=0.5, hormone=1.0, start=1.0, width=1.0)
Return the adenylate cyclase cascade, which amplifies a hormone pulse and ends it by the G-protein timer.
A hormone pulse activates the G protein, which activates adenylate cyclase, which makes cyclic AMP, which activates
protein kinase A, phosphorylase kinase, and glycogen phosphorylase in turn (Konieczny et al. 4.4.3). Every stage is
activated at the rate alpha_i times the active amount of the stage above it and inactivated at the rate
beta_i, so the integral of every stage over the signal is the integral of the stage above it times the gain
alpha_i / beta_i, and the cascade multiplies the integral of the G-protein signal by the product of the gains,
100,000 with the defaults. The G protein inactivates itself by GTP hydrolysis at the rate k_gtp, the timer of
Konieczny et al. 4.4.6, so blocking it, as cholera toxin does, prolongs the signal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alpha
|
Sequence[float]
|
The activation rates of adenylate cyclase, cyclic AMP, protein kinase A, phosphorylase kinase, and phosphorylase. |
(10.0, 100.0, 1.0, 10.0, 10.0)
|
beta
|
Sequence[float]
|
The inactivation rates of the five stages. |
(1.0, 2.0, 0.5, 1.0, 1.0)
|
k_on
|
float
|
The activation rate of the G protein per unit of hormone. |
1.0
|
k_gtp
|
float
|
The rate of GTP hydrolysis of the G protein. |
0.5
|
hormone
|
float
|
The height of the hormone pulse. |
1.0
|
start
|
float
|
The time the hormone pulse starts. |
1.0
|
width
|
float
|
The duration of the hormone pulse. |
1.0
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the active G protein |
Raises:
| Type | Description |
|---|---|
ValidationError
|
The activation and inactivation rates do not give one value per stage. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import hormone_cascade_amplifier
>>> [element.label for element in hormone_cascade_amplifier().elements][-1]
'phosphorylase'
Source code in src/skcomplex/systems/biology/systems_biology/_cascades.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | |
mammalian_cell_cycle(active=CELL_CYCLE_START, *, knockouts=())
Return the Boolean system of the mammalian cell cycle of Faure et al., ten proteins updated synchronously.
The rules are those printed by Raman for CycD, Rb, E2F, CycE, CycA, p27, Cdc20, Cdh1, UbcH10 (Ubc), and CycB.
The growth signal CycD keeps its value. Without it the network rests in the quiescent state with Rb, p27, and Cdh1
on. With it the network leaves that state and runs through a cycle of period 7 in which the cyclins E, A, and B
rise and fall in turn. A knocked-out protein stays off.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
active
|
Sequence[str]
|
The proteins that are on at the start. |
CELL_CYCLE_START
|
knockouts
|
Sequence[str]
|
The proteins that are knocked out. |
()
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the values |
Raises:
| Type | Description |
|---|---|
ValidationError
|
A name is not one of the ten proteins. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import mammalian_cell_cycle
>>> [node.label for node in mammalian_cell_cycle().elements if node.x]
['CycD', 'Rb', 'p27', 'Cdh1']
Source code in src/skcomplex/systems/biology/systems_biology/_boolean_systems.py
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | |
metabolic_perturbations(genes=())
Return the E. coli core system with some genes knocked out, which needs the extra metabolism.
A gene that is off closes the reactions whose rules need it (Raman 2021, Section 9.1). CobraAnalysis scans the
deletions and adjusts the fluxes by MoMA and ROOM, StrainDesignAnalysis finds OptKnock designs, and
ProductionScanAnalysis scans fluxes with an enforced product.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
genes
|
Sequence[str]
|
The names of the genes to knock out. |
()
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system. |
Raises:
| Type | Description |
|---|---|
MissingExtraError
|
The extra is not installed. |
Examples:
>>> from skcomplex.core.engine.runtime import Simulation
>>> from skcomplex.systems.biology.systems_biology import metabolic_perturbations
>>> system = metabolic_perturbations(genes=('b4025',))
>>> trajectory = Simulation(system).prepare().run(0.0).trajectory_
>>> round(float(trajectory.values('cell.objective_0')[0]), 3)
0.863
Source code in src/skcomplex/systems/biology/systems_biology/_metabolic_perturbations.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
min_protein_skeleton(n_sites=128, *, length=100.0, total_D=200.0, total_E=120.0, random_state=0)
Return the skeleton system of the Min proteins on a periodic line, a mass-conserving reaction-diffusion system.
MinD and MinE cycle between the membrane, where they diffuse slowly, and the cytosol, where they diffuse fast,
with the reactions of MinSkeletonElement. The reactions conserve the totals of MinD and MinE, so only diffusion
moves mass, and the local reactive equilibria map the dynamics onto conserved fields with nonreciprocal
cross-diffusion (Brauns and Marchetti, App. F). With the default totals, the uniform state is unstable to an
oscillatory band of wavelengths near 17, and narrow bands of membrane MinD travel along the line and meet head-on.
The fast cytosolic diffusion and the fast recruitment make the system stiff, so the catalog registers the implicit
BDF method with the exact Jacobian.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_sites
|
int
|
The number of sites of the periodic line. |
128
|
length
|
float
|
The length of the line. |
100.0
|
total_D
|
float
|
The mean total density of MinD. |
200.0
|
total_E
|
float
|
The mean total density of MinE. |
120.0
|
random_state
|
int | Generator | None
|
The seed or generator of the 1% noise that moves MinD between the membrane and the cytosol. |
0
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the membrane fields |
Examples:
>>> from skcomplex.systems.biology.systems_biology import min_protein_skeleton
>>> values = min_protein_skeleton(32).elements[0].values
>>> round(float(values['ce'].mean() + values['mde'].mean()), 6)
120.0
Source code in src/skcomplex/systems/biology/systems_biology/_min_proteins.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |
negative_autoregulation(p=0.0, *, alpha=2.0, K=50.0, n=1.0, b=10.0, beta=0.1, delta=1.0, stochastic=True)
Return a gene that represses its own transcription and makes its protein in bursts.
Every mRNA molecule yields on average b / delta proteins before it decays, so with fast mRNA decay the protein
arrives in geometric bursts and its count fluctuates far more than a Poisson count. Negative feedback lowers the
mean and the noise. A very large K removes the feedback.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p
|
float
|
The initial protein count, with no mRNA. |
0.0
|
alpha
|
float
|
The transcription rate without repressor. |
2.0
|
K
|
float
|
The protein count at half repression. |
50.0
|
n
|
float
|
The Hill coefficient of repression. |
1.0
|
b
|
float
|
The translation rate per mRNA molecule. |
10.0
|
beta
|
float
|
The decay rate of the protein. |
0.1
|
delta
|
float
|
The decay rate of mRNA. |
1.0
|
stochastic
|
bool
|
Whether the system is a jump process. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the counts |
Examples:
>>> from skcomplex.systems.biology.systems_biology import negative_autoregulation
>>> negative_autoregulation().interactions[0].modifiers
{('gene', 'p'): 1}
Source code in src/skcomplex/systems/biology/systems_biology/_genes.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | |
noisy_boolean_network(n=1000, *, k=3, eta=0.1, seed=0)
Return the Boolean network of Huepe and Aldana-González, nodes that follow the noisy majority of k inputs.
Every node takes the sign of the sum of its k random inputs, flipped with the probability eta. The order
parameter Psi, the time average of the absolute mean state, undergoes a continuous phase transition at the noise
eta_c = (1 - 1 / Phi'(0)) / 2 of mean-field theory, with Phi'(0) = k C(k - 1, (k - 1) / 2) / 2^(k - 1), which is
1/6 for k = 3. Below it the network orders, above it the mean state falls to fluctuations of order 1 /
sqrt(n).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
The number of nodes. |
1000
|
k
|
int
|
The number of inputs of every node, odd. |
3
|
eta
|
float
|
The noise, the probability of a flip. |
0.1
|
seed
|
int | None
|
The seed of the inputs. |
0
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the states |
Raises:
| Type | Description |
|---|---|
ValidationError
|
The number of inputs is even. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import noisy_boolean_network
>>> noisy_boolean_network(10).elements[0].prepare().size_
10
Source code in src/skcomplex/systems/biology/systems_biology/_boolean_systems.py
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 | |
petri_net(places=None, transitions=None, *, stochastic=True)
Return a Petri net, places that hold tokens and transitions that consume and produce them when they fire.
Every transition is a pair of input and output arcs with weights and a rate. In a stochastic Petri net it fires at
random times with the mass-action propensity of its input places, consuming the tokens of its input arcs and
producing those of its output arcs, and otherwise it is a continuous Petri net of rate equations. Every place
invariant, a weighted sum of tokens that no transition changes, is conserved. The default net is the expression
of a gene that switches on, is transcribed and translated, and is switched off by its own protein, with the
invariant gene_on + gene_off = 1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
places
|
Mapping[str, int] | None
|
The initial tokens of every place, or |
None
|
transitions
|
Transitions | None
|
For every transition, its label, input arcs, output arcs, and rate, or |
None
|
stochastic
|
bool
|
Whether the transitions fire at random times. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the tokens |
Examples:
>>> from skcomplex.systems.biology.systems_biology import petri_net
>>> [element.label for element in petri_net().elements]
['gene_off', 'gene_on', 'mRNA', 'protein']
Source code in src/skcomplex/systems/biology/systems_biology/_logical_networks.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | |
phosphorylation_oscillator(A=1.0, B=0.0, C=0.0, *, kp1=1.0, kd1=2.0, kp2=2.0, kd2=1.0, kp3=2.0, kd3=1.0, K=0.01)
Return three proteins whose phosphorylation cycles regulate each other in a loop that oscillates.
C converts A, A converts B, and B converts C, each reaction with Michaelis-Menten kinetics and each total
conserved, so the loop is a negative feedback of three steps. The book prints the equations and no parameter
values. The defaults are a choice: totals of 1, Michaelis constants K far below the totals, which make every
cycle an ultrasensitive switch, and rates that put every switch at half the total of its enzyme. The proteins then
switch on and off in turn on a limit cycle of period about 4.2. With large K the switches become graded and the
loop settles on a fixed point. The amounts are fractions of the totals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
A
|
float
|
The initial amount of unphosphorylated A. |
1.0
|
B
|
float
|
The initial amount of unphosphorylated B. |
0.0
|
C
|
float
|
The initial amount of unphosphorylated C. |
0.0
|
kp1
|
float
|
The maximal rate that restores A. |
1.0
|
kd1
|
float
|
The catalytic rate of the conversion of A by C. |
2.0
|
kp2
|
float
|
The catalytic rate of the conversion of B by A. |
2.0
|
kd2
|
float
|
The maximal rate that removes B. |
1.0
|
kp3
|
float
|
The catalytic rate of the conversion of C by B. |
2.0
|
kd3
|
float
|
The maximal rate that removes C. |
1.0
|
K
|
float
|
The Michaelis constant of every reaction. |
0.01
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the amounts |
Examples:
>>> from skcomplex.systems.biology.systems_biology import phosphorylation_oscillator
>>> phosphorylation_oscillator(K=0.1).elements[0].K2
0.1
Source code in src/skcomplex/systems/biology/systems_biology/_networks.py
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 | |
probabilistic_boolean_network(network=None, *, inputs=SHMULEVICH_INPUTS, active=('x1',))
Return a probabilistic Boolean network, whose nodes draw one of their candidate functions at every step.
Every node has candidate truth tables of the inputs, each with a probability, and at every step every node draws
one of its tables independently and takes its value, all nodes together. The default network follows the three-gene
example of Shmulevich et al., in which x1 and x3 have two candidate functions and x2 one. From one initial
state the network reaches different attractors in different runs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
network
|
Mapping[str, Candidates] | None
|
A mapping from node name to its candidate tables with their probabilities, or |
None
|
inputs
|
Sequence[str]
|
The nodes every table reads, in the order of its bits, from the most significant. |
SHMULEVICH_INPUTS
|
active
|
Sequence[str]
|
The nodes that are on at the start. |
('x1',)
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the values |
Examples:
>>> from skcomplex.systems.biology.systems_biology import probabilistic_boolean_network
>>> probabilistic_boolean_network().interactions[0].probabilities
(0.6, 0.4)
Source code in src/skcomplex/systems/biology/systems_biology/_probabilistic.py
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | |
random_boolean_network(n_nodes=20, k=2, *, bias=0.5, random_state=0)
Return a Kauffman random Boolean network, nodes updated together by random functions of k random inputs.
Each node reads k distinct nodes, possibly itself, through a truth table whose entries are 1 with probability
bias. The finite state space makes every run end on a cycle. With k = 2 and bias = 0.5 the network is
critical, between frozen and chaotic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_nodes
|
int
|
The number of nodes. |
20
|
k
|
int
|
The number of inputs per node, at most the number of nodes. |
2
|
bias
|
float
|
The probability that an entry of a truth table is 1. |
0.5
|
random_state
|
int | Generator | None
|
The seed or generator of the wiring, the tables, and the initial values. |
0
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the values |
Raises:
| Type | Description |
|---|---|
ValidationError
|
|
Examples:
>>> from skcomplex.systems.biology.systems_biology import random_boolean_network
>>> len(random_boolean_network(10, 3).interactions[0].table)
8
Source code in src/skcomplex/systems/biology/systems_biology/_boolean.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
read_biopython_structure(structure, systems=None)
Return a structure as an object of Biopython.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
structure
|
StructureSpec
|
The structure. |
required |
systems
|
tuple[int, ...] | None
|
The indices of the systems to keep, or |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
object |
BiopythonStructureProtocol
|
The |
Raises:
| Type | Description |
|---|---|
MissingExtraError
|
The extra |
Examples:
>>> from skcomplex.systems.biology.systems_biology import read_biopython_structure, read_structure
>>> len(list(read_biopython_structure(read_structure('1L2Y'), (0, 1)).get_chains()))
2
Source code in src/skcomplex/systems/biology/systems_biology/_structures.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |
read_cell_probabilities(cells=CELLS)
cached
Return the probability of every cell of the ellipse path per amino acid, from the native bundled structures.
The projected native angles of the bundled entries are counted per amino acid and cell, with one added to every count. The bundled entries and the added one are choices of this function, since Konieczny et al. (2023 §3.7.1) print entropies of such probabilities (Table 3.3) and not the probabilities or how they are estimated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cells
|
int
|
The number of cells of the path. |
CELLS
|
Returns:
| Name | Type | Description |
|---|---|---|
probabilities |
Array
|
One row per amino acid, in the order of |
Raises:
| Type | Description |
|---|---|
MissingExtraError
|
The extra |
Examples:
>>> from skcomplex.systems.biology.systems_biology import read_cell_probabilities
>>> read_cell_probabilities().sum(axis=1).round(9).tolist() == [1.0] * 20
True
Source code in src/skcomplex/systems/biology/systems_biology/_early_stage.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | |
read_kyte_doolittle_scale()
Return the Kyte-Doolittle hydrophobicity of the twenty amino acids of Biopython, rescaled to [0, 1].
Returns:
| Name | Type | Description |
|---|---|---|
scale |
dict[str, float]
|
The hydrophobicity by the three-letter name of a residue. |
Raises:
| Type | Description |
|---|---|
MissingExtraError
|
The extra |
Examples:
>>> from skcomplex.systems.biology.systems_biology import read_kyte_doolittle_scale
>>> scale = read_kyte_doolittle_scale()
>>> scale['ILE'], scale['ARG']
(1.0, 0.0)
Source code in src/skcomplex/systems/biology/systems_biology/_fuzzy_oil_drop.py
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | |
read_native_pairs(structure)
Return the residues with both a phi and a psi in the first system of a structure, and these angles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
structure
|
StructureSpec
|
The structure, of one chain. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
pairs |
tuple[list[str], Array]
|
The names of the residues, and their |
Raises:
| Type | Description |
|---|---|
MissingExtraError
|
The extra |
Examples:
>>> from skcomplex.systems.biology.systems_biology import read_native_pairs, read_structure
>>> names, angles = read_native_pairs(read_structure('1L2Y'))
>>> len(names), angles.shape
(18, (18, 2))
Source code in src/skcomplex/systems/biology/systems_biology/_early_stage.py
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | |
read_structure(source)
Return the polymer atoms of every system of a bundled entry, or of a PDB or an mmCIF file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str | Path
|
The name of a bundled entry, |
required |
Returns:
| Name | Type | Description |
|---|---|---|
structure |
StructureSpec
|
The structure. |
Raises:
| Type | Description |
|---|---|
MissingExtraError
|
The extra |
ValidationError
|
The source is no bundled entry and no file of a known format. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import read_structure
>>> read_structure('1L2Y').coordinates.shape
(38, 304, 3)
Source code in src/skcomplex/systems/biology/systems_biology/_structures.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
read_trajectory(path, topology)
Return the frames of a molecular dynamics trajectory as the systems of a structure, through MDTraj.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
The path of a DCD, XTC, TRR, NetCDF, or HDF5 trajectory. |
required |
topology
|
str | Path
|
The path of a file that gives the atoms, such as a PDB file. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
structure |
StructureSpec
|
The structure, with one system per frame, in ångström. |
Raises:
| Type | Description |
|---|---|
MissingExtraError
|
The extra |
Source code in src/skcomplex/systems/biology/systems_biology/_structures.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | |
regulatory_fba(*, biomass=0.01, glucose=10.0, acetate=10.0, threshold=0.1, lag=10, acetate_vmax=10.0, km=0.015)
Return a batch culture on glucose and acetate with Boolean catabolite repression, which needs the extra.
Boolean rules alternate with the program (Raman 2021, Eq. 9.7). A node reads whether glucose lies above a threshold, a chain of nodes delays it, and while the last node is on it holds the genes of acetate kinase off through update laws. So the culture leaves acetate alone while glucose lasts, stops at depletion, and grows again on acetate after the lag of the chain.
The alternation is that of Raman, but the rules are an illustration and not those of Covert et al. (2001): the genes of acetate kinase, the threshold, and the chain of nodes come from no source, and the diauxie of Raman is on glucose and lactose, which the E. coli core system cannot take up.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
biomass
|
float
|
The initial biomass in gDW per L. |
0.01
|
glucose
|
float
|
The initial glucose in mM. |
10.0
|
acetate
|
float
|
The initial acetate in mM. |
10.0
|
threshold
|
float
|
The glucose above which the sensor is on, in mM. |
0.1
|
lag
|
int
|
The number of nodes after the sensor, each a synchronisation interval of delay. |
10
|
acetate_vmax
|
float
|
The largest acetate uptake in mmol per gDW per h. |
10.0
|
km
|
float
|
The half-saturation concentration of both substrates in mM. |
0.015
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system. |
Raises:
| Type | Description |
|---|---|
MissingExtraError
|
The extra is not installed. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import regulatory_fba
>>> [system.label for system in regulatory_fba(lag=1).systems]
['control', 'culture']
Source code in src/skcomplex/systems/biology/systems_biology/_regulatory_fba.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |
repressilator(proteins=(20.0, 0.0, 0.0), *, alpha=40.0, alpha0=0.04, K=20.0, n=2.0, b=2.0, beta=0.2, delta=1.0, stochastic=False)
Return the repressilator of Elowitz and Leibler, three genes in a ring that each repress the next.
Gene i is repressed by gene i - 1, so the ring has an odd number of repressions and oscillates when
transcription is strong and repression steep. Counts are molecule numbers, so the same rates run as differential
equations or, with stochastic=True, as a jump process of single transcriptions, translations, and decays.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
proteins
|
Sequence[float]
|
The initial protein counts of the three genes, with no mRNA. |
(20.0, 0.0, 0.0)
|
alpha
|
float
|
The transcription rate without repressor. |
40.0
|
alpha0
|
float
|
The leaky transcription rate. |
0.04
|
K
|
float
|
The repressor count at half repression. |
20.0
|
n
|
float
|
The Hill coefficient of repression. |
2.0
|
b
|
float
|
The translation rate per mRNA molecule. |
2.0
|
beta
|
float
|
The decay rate of the proteins. |
0.2
|
delta
|
float
|
The decay rate of mRNA. |
1.0
|
stochastic
|
bool
|
Whether the system is a jump process. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the counts |
Examples:
>>> from skcomplex.systems.biology.systems_biology import repressilator
>>> [interaction.modifiers for interaction in repressilator().interactions[:3]]
[{('gene_2', 'p'): 1}, {('gene_0', 'p'): 1}, {('gene_1', 'p'): 1}]
Source code in src/skcomplex/systems/biology/systems_biology/_genes.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
tca_labelling_analysis(kind='estimation', *, noise=DEVIATION, random_state=0, starts=5, intervals='linear')
Return the labelling analysis of the TCA example, with data simulated from its known fluxes plus seeded noise.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kind
|
str
|
|
'estimation'
|
noise
|
float
|
The standard deviation of the noise of the data. |
DEVIATION
|
random_state
|
int
|
The seed of the noise and of the starts. |
0
|
starts
|
int
|
The number of feasible starts of the fit. |
5
|
intervals
|
str
|
|
'linear'
|
Returns:
| Name | Type | Description |
|---|---|---|
analysis |
LabellingAnalysis
|
The analysis, not checked yet. |
Examples:
>>> from skcomplex.systems.biology.systems_biology import carbon_13_mfa, tca_labelling_analysis
>>> analysis = tca_labelling_analysis('simulation').prepare(carbon_13_mfa()).run()
>>> [round(float(item), 4) for item in analysis.distributions_['published']['Glu']]
[0.3464, 0.2695, 0.2708, 0.0807, 0.0286, 0.0039]
Source code in src/skcomplex/systems/biology/systems_biology/_carbon_13_mfa.py
966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 | |
three_gene_boolean_network(x=(1, 0, 0))
Return the three-gene Boolean network of Raman, updated synchronously.
The genes follow g1* = g2 AND NOT g3, g2* = NOT g1, and g3* = NOT g3 OR g2. Its eight states fall into two
basins: the point attractor 011 and the cycle 001 -> 010 -> 111 of period three, which the state 100 enters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Sequence[int]
|
The initial values of |
(1, 0, 0)
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the values |
Examples:
>>> from skcomplex.systems.biology.systems_biology import three_gene_boolean_network
>>> three_gene_boolean_network().interactions[2].table
(1, 0, 1, 1)
Source code in src/skcomplex/systems/biology/systems_biology/_boolean_systems.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |
three_way_fate_decision(cells=30, *, a=-0.2, theta1=0.0, theta2=0.0, v1=0.0, v2=0.0, spread=0.6, seed=0)
Return cells that choose among three fates on the compactified elliptic umbilic landscape of Rand et al.
Every cell descends the potential x^4 + y^4 + x^3 - 2 x y^2 + a (x^2 + y^2) + theta1 x + theta2 y. With a < 0
and no signal the centre is a repellor and three attractors, the fates, lie around it, separated by three saddles,
so cells that start near the centre split among the three fates. Signals that drift at the rates v1 and v2
move the system across the fold curves of its parameter space, where a fate disappears and its cells switch to
another.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cells
|
int
|
The number of cells. |
30
|
a
|
float
|
The curvature of the potential at the centre. |
-0.2
|
theta1
|
float
|
The first signal at the start. |
0.0
|
theta2
|
float
|
The second signal at the start. |
0.0
|
v1
|
float
|
The rate of change of the first signal. |
0.0
|
v2
|
float
|
The rate of change of the second signal. |
0.0
|
spread
|
float
|
The half-width of the uniform initial states around the centre. |
0.6
|
seed
|
int | None
|
The seed of the initial states. |
0
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the states |
Examples:
>>> from skcomplex.systems.biology.systems_biology import three_way_fate_decision
>>> three_way_fate_decision(5).elements[0].prepare().size_
5
Source code in src/skcomplex/systems/biology/systems_biology/_fates.py
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
toggle_switch(proteins=(60.0, 0.0), *, alpha=20.0, alpha0=0.0, K=20.0, n=2.0, b=2.0, beta=0.2, delta=1.0, stochastic=False)
Return the genetic toggle switch of Gardner, Cantor, and Collins, two genes that repress each other.
With steep and strong repression the switch is bistable: one gene is expressed and silences the other, and the initial protein counts decide which. The stochastic mode lets noise flip the switch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
proteins
|
Sequence[float]
|
The initial protein counts of the two genes, with no mRNA. |
(60.0, 0.0)
|
alpha
|
float
|
The transcription rate without repressor. |
20.0
|
alpha0
|
float
|
The leaky transcription rate. |
0.0
|
K
|
float
|
The repressor count at half repression. |
20.0
|
n
|
float
|
The Hill coefficient of repression. |
2.0
|
b
|
float
|
The translation rate per mRNA molecule. |
2.0
|
beta
|
float
|
The decay rate of the proteins. |
0.2
|
delta
|
float
|
The decay rate of mRNA. |
1.0
|
stochastic
|
bool
|
Whether the system is a jump process. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the counts |
Examples:
>>> from skcomplex.systems.biology.systems_biology import toggle_switch
>>> [element.p for element in toggle_switch((0.0, 50.0)).elements]
[0.0, 50.0]
Source code in src/skcomplex/systems/biology/systems_biology/_genes.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | |
write_structure(structure, path)
Write every system of a structure to a .pdb, .cif, or .mmcif file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
structure
|
StructureSpec
|
The structure. |
required |
path
|
str | Path
|
The path of the file, whose suffix gives the format. |
required |
Raises:
| Type | Description |
|---|---|
MissingExtraError
|
The extra |
ValidationError
|
The suffix of the path names no known format. |
Examples:
>>> import tempfile
>>> from pathlib import Path
>>> from skcomplex.systems.biology.systems_biology import read_structure, write_structure
>>> with tempfile.TemporaryDirectory() as folder:
... write_structure(read_structure('1UBQ'), Path(folder) / 'copy.cif')
... read_structure(Path(folder) / 'copy.cif').coordinates.shape
(1, 602, 3)
Source code in src/skcomplex/systems/biology/systems_biology/_structures.py
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
yeast_cell_cycle(active=YEAST_START)
Return the Boolean network of the budding yeast cell cycle of Li et al., eleven proteins and their regulation.
Every protein turns on or off with the sign of the summed activations and inhibitions by the active proteins, and the proteins Cln3, Cln1,2, Swi5, Cdc20, and Mcm1 decay without input. Started from the G1 state with Cln3 on, the cell size signal, the network runs through the phases of the cycle into the stationary G1 state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
active
|
Sequence[str]
|
The proteins that are on at the start, among |
YEAST_START
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the values |
Examples:
>>> from skcomplex.systems.biology.systems_biology import yeast_cell_cycle
>>> [node.label for node in yeast_cell_cycle().elements if node.x]
['Cln3', 'Cdh1', 'Sic1']
Source code in src/skcomplex/systems/biology/systems_biology/_boolean.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | |