biocrnpyler.components.dna.assembly

Classes

DNAassembly(name[, dna, promoter, ...])

A class that contains a Promoter, RBS, transcript, and protein.

class biocrnpyler.components.dna.assembly.DNAassembly(name: str, dna=None, promoter=None, transcript=None, rbs=None, protein=None, length=None, attributes=None, mechanisms=None, parameters=None, initial_concentration=None, **keywords)[source]

A class that contains a Promoter, RBS, transcript, and protein.

Note: If transcript is None and protein is not None, the DNAassembly will use its transcription mechanisms to produce the protein. This is used by Expression Mixtures.

Parameters:
  • name – name of the DNA assembly

  • dna

  • promoter

  • transcript

  • rbs

  • protein

  • length

  • attributes

  • mechanisms

  • parameters

  • initial_concentration

  • keywords – passed into the parent object (DNA)

add_mechanism(mechanism: Mechanism, mech_type: str = None, overwrite: bool = False, optional_mechanism: bool = False) None[source]

adds a mechanism of type mech_type to the Component Mechanism dictionary.

DNA_assembly also adds the mechanisms to its promoter and rbs (but never overwrites them!)

Parameters:
  • mechanism – reference to a Mechanism instance

  • mech_type – type of mechanism

  • overwrite – whether to overwrite the mechanism in Component

  • optional_mechanism

Returns:

None

add_mechanisms(mechanisms: Mechanism | GlobalMechanism, overwrite=False, optional_mechanism=False)[source]

This function adds a list or dictionary of mechanisms to the mixture.

Parameters:
  • mechanisms – Can take both GlobalMechanisms and Mechanisms

  • overwrite – toggles whether the mechanism is added overwriting any mechanism with the same key.

  • optional_mechanism – toggles whether an error is thrown if a Mechanism is added that conflicts with an exising Mechanism

Returns:

property compartment

The compartment of the Component.

Returns:

Compartment

enumerate_components(**keywords) List[source]

this is for component enumeration. Usually you will return a list of components that are copies of existing ones (first list) and new components (second list). For example, A DNA_construct makes a list of copies of its parts as the first output, and a list of RNA_constructs as the second output. An RNA_construct will make a list of copies of its parts as the first output, and a list of Protein components as its second output (if it makes any proteins)

get_mechanism(mechanism_type, optional_mechanism=False)[source]

Searches the Component for a Mechanism of the correct type.

If the Component does not have the mechanism, searches the Components’ Mixture for the Mechanism.

Parameters:
  • mechanism_type

  • optional_mechanism – toggles whether an error is thrown if no mechanism is found

Returns:

get_parameter(param_name: str, part_id=None, mechanism=None, return_numerical=False, return_none=False, check_mixture=True) Parameter | Real[source]

Get a parameter from different objects that hold parameters.

Hierarchy:
  1. tries to find the Parameter in Component.parameter_database

  2. tries to find the parameter in Component.mixture.parameter_database

Parameters:
  • param_name

  • part_id

  • mechanism

  • return_numerical – numerical value or the parameter object is returned

  • return_none – returns None instead of throwing an error if a parameter isn’t found

  • check_mixture – toggle whether or not to check the Component’s Mixture as well

Returns:

Parameter object or a Real number

get_species()[source]

The subclasses should implement this method!

Returns:

None

set_mixture(mixture: Mixture) None[source]

Set the mixture the Component is in.

Parameters:

mixture – reference to a Mixture instance

Returns:

None

classmethod set_species(species: Species | str, material_type=None, compartment=None, attributes=None) Species[source]

Helper function that allows species to be set from strings, species, or Components

Parameters:
  • species – Species, str, Component

  • material_type

  • compartment

  • attributes

Returns:

Species

update_dna(dna: None | DNA | str, attributes=None) None[source]

sets up the dna attribute with a valid DNA instance.

Parameters:
  • dna – name of a dna sequence or a DNA instance

  • attributes – Species attribute

Returns:

None

update_parameters(parameter_file: str = None, parameters: ParameterDatabase = None, overwrite_parameters: bool = True) None[source]

updates the parameters stored in dna, promoter and rbs.

Parameters:
  • parameter_file – valid parameter file

  • parameters – a parameter database instance

  • overwrite_parameters – whether to overwrite existing parameters

Returns:

None

update_promoter(promoter: Protein | str, transcript: RNA = None, protein: Protein = None) None[source]

sets up the promoter attribute with a valid Promoter instance.

Parameters:
  • promoter – name of a promoter or Promoter instance

  • transcript – reference to the RNA transcript

  • protein

Returns:

None

update_protein(protein: None | Protein | str, attributes=None) None[source]

sets up the protein attribute with a valid Protein instance.

Parameters:
  • protein – name of a protein or Protein instance

  • attributes – Species attribute

Returns:

None

update_rbs(rbs: RBS | str, transcript: RNA = None, protein: Protein = None) None[source]

sets up the rbs attribute with a valid RBS instance.

Parameters:
  • rbs – name of the ribosome binding site or RBS instance

  • transcript – RNA that contains the ribosome binding site

  • protein – protein that RNA contains

Returns:

None

update_reactions() List[Reaction][source]

collects the list of Reactions that a DNAassemlby instance holds.

Returns:

list of Reactions that a DNAassemlby instance holds.

update_species() List[Species][source]

collects the list of Species that a DNAassemlby instance holds.

Returns:

list of Species that a DNAassemlby instance holds

update_transcript(transcript: None | RNA | str | bool, attributes=None) None[source]

sets up the transcript attribute with a valid RNA instance.

Parameters:
  • transcript – name of a RNA transcript or RNA instance

  • attributes – Species attribute

Returns:

None