Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion biocrnpyler/components/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""BioCRNpyler component library (including DNA components).
r"""BioCRNpyler component library (including DNA components).

Components are the primary building blocks of models in BioCRNpyler.
They represent biomolecular parts or motifs such as promoters,
Expand Down
6 changes: 3 additions & 3 deletions biocrnpyler/components/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class DNA(Component):
"""DNA sequence component with specified length.
r"""DNA sequence component with specified length.

A `DNA` component represents a DNA sequence with a given length in base
pairs. This component has no associated mechanism to generate species or
Expand Down Expand Up @@ -665,7 +665,7 @@ def update_reactions(self) -> List[Reaction]:


class Enzyme(Component):
"""Enzyme that catalyzes conversion of substrates to products.
r"""Enzyme that catalyzes conversion of substrates to products.

An `Enzyme` component represents an enzyme that catalyzes the conversion
of one or more substrates into one or more products. The enzyme itself
Expand Down Expand Up @@ -712,7 +712,7 @@ class Enzyme(Component):
The `Enzyme` component assumes all substrates are converted to all
products in a single enzymatic step:

S1 + S2 + ... + SN + E --> P1 + P2 + ... + PM + E
$$ 'S1' + 'S2' + ... + 'S'_N + 'E' --> 'P1' + 'P2' + ... + 'P'_M + 'E' $$

For enzymes that catalyze multiple distinct reactions, create separate
`Enzyme` components with the same internal enzyme species.
Expand Down
11 changes: 6 additions & 5 deletions biocrnpyler/components/combinatorial_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class CombinatorialComplex(Component):
"""Complex formed through combinatorial binding of multiple species.
r"""Complex formed through combinatorial binding of multiple species.

A `CombinatorialComplex` component represents a complex that can form
through multiple combinatorial binding pathways. The component
Expand Down Expand Up @@ -69,22 +69,22 @@ class CombinatorialComplex(Component):
Case 1 - only `final_states` given: all species in final_states bind
combinatorially:

individual_species <--> all_intermediates <--> final_states
$$'individual species' <--> 'all intermediates' <--> 'final states'$$

Case 2 - `final_states` + `initial_states`: binding starts from
specified initial states directly to final states:

initial_states <--> final_states
$$'initial_states' <--> 'final_states'$$

Case 3 - `final_states` + `intermediate_states`: binding restricted to
specified intermediates:

individual_species <--> intermediate_states <--> final_states
$$'individual species' <--> 'intermediate states' <--> 'final states'$$

Case 4 - `final_states` + `initial_states` + `intermediate_states`: both
initial and intermediate constraints applied:

initial_states <--> intermediate_states <--> final_states
$$'initial states' <--> 'intermediate states' <--> 'final states'$$

The component name is automatically generated as a concatenation of
final_states names separated by underscores if not provided.
Expand Down Expand Up @@ -700,6 +700,7 @@ def update_reactions(self):
2. Generate reactions: intermediate_states <--> final_states

Without intermediate_states:

Generate reactions: initial_states <--> final_states directly

Duplicate reactions are automatically filtered out. The method uses
Expand Down
8 changes: 4 additions & 4 deletions biocrnpyler/components/dna/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class DNAassembly(DNA):
"""High-level representation of a gene expression construct.

A DNAassembly represents a complete gene expression unit combining a
promoter region, ribosome binding site (RBS), coding sequence, and the
RNA and protein products. This class provides a convenient interface for
modeling the central dogma pathway: DNA --> RNA --> Protein, where the
promoter controls transcription and the RBS controls translation.
promoter region, ribosome binding site (RBS), coding sequence, and the RNA
and protein products. This class provides a convenient interface for
modeling the central dogma pathway: DNA --> RNA --> Protein, where
the promoter controls transcription and the RBS controls translation.

Parameters
----------
Expand Down
26 changes: 10 additions & 16 deletions biocrnpyler/components/dna/promoter.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,14 +646,11 @@ class ActivatablePromoter(Promoter):
Notes
-----
The activation follows a Hill function:

.. math::

\text{rate} = k_{\text{max}} \frac{[A]^n}{K_d^n + [A]^n}
+ k_{\text{leak}}

where [A] is activator concentration, n is the Hill coefficient, and
:math:`K_d` is the dissociation constant.
$$
'rate' = k_'max' \frac{[A]^n}{K_d^n + [A]^n} + k_'leak'
$$
where [A] is activator concentration, $n$ is the Hill coefficient, and
$K_d$ is the dissociation constant.

Examples
--------
Expand Down Expand Up @@ -792,14 +789,11 @@ class RepressiblePromoter(Promoter):
Notes
-----
The repression follows a Hill function:

.. math::

\text{rate} = k_{\text{max}} \frac{K_d^n}{K_d^n + [R]^n}
+ k_{\text{leak}}

where [R] is repressor concentration, n is the Hill coefficient, and
:math:`K_d` is the dissociation constant.
$$
'rate' = k_'max' \frac{K_d^n}{K_d^n + [R]^n} + k_'leak'
$$
where [R] is repressor concentration, $n$ is the Hill coefficient, and
$K_d$ is the dissociation constant.

Examples
--------
Expand Down
27 changes: 16 additions & 11 deletions biocrnpyler/components/membrane.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class DiffusibleMolecule(Component):
"""Molecule that diffuses passively through a membrane.
r"""Molecule that diffuses passively through a membrane.

A `DiffusibleMolecule` component represents a molecule that undergoes
passive diffusion across a membrane between two compartments. The
Expand Down Expand Up @@ -54,6 +54,7 @@ class DiffusibleMolecule(Component):
energy. The diffusion mechanism generates bidirectional reactions:

- Forward: substrate_internal --> substrate_external

- Reverse: substrate_external --> substrate_internal

If not specified using the `name` keyword, the component name is
Expand Down Expand Up @@ -442,9 +443,11 @@ class MembraneChannel(Component):
The transport mechanism generates reactions based on the direction:

- 'Importer': substrate_external + channel
--> substrate_internal + channel
--> substrate_internal + channel

- 'Exporter': substrate_internal + channel
--> substrate_external + channel
--> substrate_external + channel

- 'Passive': bidirectional transport following gradients

The component name is automatically generated as:
Expand Down Expand Up @@ -679,9 +682,10 @@ class MembranePump(Component):
against concentration gradients. The typical reaction scheme is:

- Exporter: substrate_internal + ATP + pump -->
substrate_external + ADP + pump
substrate_external + ADP + pump

- Importer: substrate_external + ATP + pump -->
substrate_internal + ADP + pump
substrate_internal + ADP + pump

The ATP parameter controls the stoichiometry of ATP consumption per
transport event.
Expand Down Expand Up @@ -877,7 +881,7 @@ def get_species(self):
return self.membrane_pump

def update_species(self):
"""Use 'trasnport' mechanism to generate ATP-dependent species.
r"""Use 'transport' mechanism to generate ATP-dependent species.

Uses the 'transport' mechanism to generate species including the
pump protein, substrate, product, ATP, and ADP.
Expand All @@ -899,7 +903,7 @@ def update_species(self):
)

def update_reactions(self):
"""Use 'trasnport' mechanism to generate ATP-dependent reactions.
"""Use 'transport' mechanism to generate ATP-dependent reactions.

Uses the 'transport' mechanism to generate reactions for active
transport coupled to ATP hydrolysis.
Expand All @@ -923,7 +927,7 @@ def update_reactions(self):


class MembraneSensor(Component):
"""Two-component system (TCS) membrane sensor protein.
r"""Two-component system (TCS) membrane sensor protein.

A `MembraneSensor` component represents a membrane sensor protein in a
two-component signaling system. The sensor detects external signal
Expand Down Expand Up @@ -995,9 +999,10 @@ class MembraneSensor(Component):
4. Activated response regulator regulates gene expression

The general reaction scheme:

signal + sensor + ATP + response_protein -->
signal + sensor + ADP + response_protein-P
$$
& 'signal' + 'sensor' + 'ATP' + 'response_protein' \\
& --> 'signal' + 'sensor' + 'ADP' + 'response_protein-P'
$$

The component name is automatically generated as:
'<membrane_sensor_protein_name>_<compartment_name>'
Expand Down
6 changes: 3 additions & 3 deletions biocrnpyler/core/chemical_reaction_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ class ChemicalReactionNetwork(object):
-----
Mass action reactions follow standard mass action kinetics:

- Deterministic propensity: :math:`k \prod_{i} [S_i]^{a_i}`
- Stochastic propensity: :math:`k \prod_{i} \frac{S_i!}{(S_i - a_i)!}`
- Deterministic propensity: $k \prod_i [S$_i$]^{a_i}$
- Stochastic propensity: $k \prod_i \frac{S_i!}{(S_i - a_i)!}$

where :math:`a_i` is the stoichiometric coefficient of species :math:`i`.
where $a_i$ is the stoichiometric coefficient of species $i$.

A valid CRN requires:

Expand Down
6 changes: 3 additions & 3 deletions biocrnpyler/core/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,9 @@ def add_attribute(self, attribute: str):
['fluorescent', 'ssrAtagged']

"""
assert (
isinstance(attribute, str) and attribute is not None
), f"Attribute: {attribute} must be a str"
assert isinstance(attribute, str) and attribute is not None, (
f"Attribute: {attribute} must be a str"
)

self.attributes.append(attribute)
if hasattr(self, 'species') and self.species is not None:
Expand Down
6 changes: 3 additions & 3 deletions biocrnpyler/core/mixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ def add_species(self, species: Union[List[Species], Species]):
else:
species_list = species

assert all(
isinstance(x, Species) for x in species_list
), 'only Species type is accepted!'
assert all(isinstance(x, Species) for x in species_list), (
'only Species type is accepted!'
)

self.added_species += species_list

Expand Down
6 changes: 3 additions & 3 deletions biocrnpyler/core/polymer.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ def polymer(self, parts):

"""
polymer = []
assert isinstance(
parts, (list, tuple)
), 'OrderedPolymer must be instantiated with a list'
assert isinstance(parts, (list, tuple)), (
'OrderedPolymer must be instantiated with a list'
)
for item in parts:
if isinstance(item, (list, tuple)):
part = item[0]
Expand Down
Loading
Loading