biocrnpyler.Species
- class biocrnpyler.Species(name: str, material_type='', attributes: List | None = None, compartment=None, **keywords)[source]
A formal species object for a chemical reaction network (CRN).
A Species must have a name. They may also have a material_type (such as DNA, RNA, Protein), and a list of attributes.
the default is that the monomer is not part of a polymer
- __init__(name: str, material_type='', attributes: List | None = None, compartment=None, **keywords)[source]
the default is that the monomer is not part of a polymer
Methods
__init__(name[, material_type, attributes, ...])the default is that the monomer is not part of a polymer
add_attribute(attribute)Adds attributes to a Species
Checks if the Species has a monomer (Species) inside of it, but without checking Species.parent, Species.position, or direction.
find_polymer_component()flatten_list(in_list)Helper function to flatten lists
returns a copy of this monomer, except with no parent.
get_removed()get_species(**kwargs)Used in some recursive calls where ComplexSpecies returns a list and Species will return just themselves (in a list)
monomer_eq(other)Same as normal equality, but does not check for parents or positions.
monomer_insert(parent, position[, direction])pretty_print([show_material, ...])#A more powerful printing function.
remove()Added functionality to remove direction as an attribute.
remove_attribute(attribute)removes an attribute from a Species
replace_species(species, new_species)set_dir(direction)subhash()Attributes
attributescompartmentdirectionmaterial_typenameparentposition- contains_species_monomer(s)[source]
Checks if the Species has a monomer (Species) inside of it, but without checking Species.parent, Species.position, or direction. In effect, a less stringent version of __contains__.
- get_orphan()[source]
returns a copy of this monomer, except with no parent. But it still has a position and direction
- get_species(**kwargs)[source]
Used in some recursive calls where ComplexSpecies returns a list and Species will return just themselves (in a list)
- pretty_print(show_material=True, show_compartment=False, show_attributes=True, show_initial_condition=False, **kwargs)[source]
#A more powerful printing function. Useful for understanding CRNs but does not return string identifiers. show_material toggles whether species.material is printed. show_attributes toggles whether species.attributes is printed