biocrnpyler.components.dna.construct
Classes
|
This represents a bunch of parts in a row. |
|
This represents a bunch of parts in a row. |
|
this represents a modular component sequence. |
|
an RNA_construct is a lot like a DNA_construct except it can only translate, and can only be linear |
- class biocrnpyler.components.dna.construct.Construct(parts_list, name=None, circular=False, mechanisms=None, parameters=None, attributes=None, initial_concentration=None, component_enumerators=None, make_dirless_hash=True, **keywords)[source]
This represents a bunch of parts in a row.
A parts list has [[part,direction],[part,direction],…] Each part must be an OrderedMonomer
- add_mechanism(mechanism, mech_type=None, overwrite=False, optional_mechanism=False)[source]
adds a mechanism of type mech_type to the Component Mechanism dictionary.
- Parameters:
mechanism
mech_type
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:
- 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:
- combinatorial_enumeration()[source]
Returns a list of new components that are copies of existing components, but with a different species placed inside.
This different species represents different combinatorial states of the polymer. for example:
construct: <A,B,C>
two new species are possible: <[A:RNAP],B,C>; <A,[B:RNAP],C> combinatorial species is also possible (since A and B are assumed to act independantly)
<[A:RNAP],[B:RNAP],C>
Thus, this function returns A which binds to <A,B,C> (creating <[A:RNAP],B,C>) AND also A which binds to <A,[B:RNAP],C> (creating <[A:RNAP],[B:RNAP],C>). Likewise for B In total two A components are returned, and two B components are returned.
- property compartment
The compartment of the Component.
- Returns:
Compartment
- classmethod create_hashless_reverse(construct)[source]
create a reverse construct but don’t calculate its hash (because that would make an infinite loop)
- classmethod direction_rotation_free_hash(construct)[source]
computes the best circular permutation of a construct, forward and reverse. Then returns whichever one of those comes alphabetically first
returns: hash of the most alphabetical ordering, direction of the ordering (1 or -1), first position of the best rotation
thus, to recreate the conformation of the construct used to make this hash you would have to 1) invert the construct (or not), then 2) use the indicated position as the first position
- enumerate_components(previously_enumerated=None)[source]
returns a list of new components and constructs. New components are generated if: - a component creates a species which results in binding to part of the construct
Example: <A,B,C> -> <[A:RNAP],B,C> Then, A would be returned since a new species is created
- more than one such component exist in the same construct, for example:
construct: <A,B,C> two new species are possible: <[A:RNAP],B,C>; <A,[B:RNAP],C> combinatorial species is also possible (since A and B are assumed to act independantly)
<[A:RNAP],[B:RNAP],C>
Thus, this function returns A which binds to <A,B,C> (creating <[A:RNAP],B,C>) AND also A which binds to <A,[B:RNAP],C> (creating <[A:RNAP],[B:RNAP],C>). Likewise for B In total two A components are returned, and two B components are returned.
- New constructs are generated if:
self.enumerate_construcs() says so. For example, in <A,B,C>, A is a promoter and makes an RNA_construct containing <B,C>
- enumerate_constructs(previously_enumerated=None)[source]
Runs all our component enumerators to generate new constructs
- get_circularly_permuted(new_first_position)[source]
returns a new construct which has the first position changed to new_first_position
- 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:
tries to find the Parameter in Component.parameter_database
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_part(part=None, part_type=None, name=None, index=None)[source]
Function to get parts from Construct.parts_list.
One of the 3 keywords must not be None.
part: an instance of a DNA_part. Searches Construct.parts_list for a DNA_part with the same type and name. part_type: a class of DNA_part. For example, Promoter. Searches Construct.parts_list for a DNA_part with the same type. name: str. Searches Construct.parts_list for a DNA_part with the same name index: int. returns Construct.parts_list[index]
if nothing is found, returns None.
- classmethod get_partlist_hash(partlist)[source]
creates a string containing the name and direction of all parts in a list of parts (but not their position)
- classmethod get_partstring(part)[source]
a string name of a part including its name and direction (and not position)
- get_reversed()[source]
returns a reversed version of this construct without changing this construct
- classmethod linear_direction_free_hash(construct)[source]
creates a string representing the construct forward or reverse, and returns whichever of those is alphabetically first
returns:
hash of the most alphabetical ordering, direction of the ordering (1 or -1), first position of the best rotation (always 0)
thus, to recreate the conformation of the construct used to make this hash you would have to 1) invert the construct (or not), then 2) use the indicated position as the first position
- located_allcomb(spec_list)[source]
recursively trace all paths through a list [[[part1,1],[part2,5]],[[part3,1]],[[part4,5],[part5,12]]] ====================> compacted_indexes = [1,5,12] prototype_list = [[part1,part3],[part2,part4],[part5]] comb_list = [[1],[5],[12],[1,5],[1,12],[5,12],[1,5,12]] =========================== then, take the lists from comb_list and create all possible lists out of prototype_list that includes those elements
- make_polymers(species_lists, backbone)[source]
makes polymers from lists of species inputs: species_lists: list of species which are to be assembled into a polymer backbone: the base_species which all these polymers should have
- classmethod omnihash(construct)[source]
a construct can exist forwards or backwards, and circularly permuted (but only if it’s a circular construct). This function creates the “best” circular permutation and ordering of a construct. But the circular permutation is only calculated if the construct is circular. Best is calculated based on which orientation/ permutation has the most part names in alphabetical order.
returns: hash of the most alphabetical ordering (string), direction of the ordering (1 or -1), first position of the best rotation
thus, to recreate the conformation of the construct used to make this hash you would have to 1) invert the construct (or not), then 2) use the indicated position as the first position
- reverse()[source]
reverses everything, without actually changing the DNA. also updates the name and stuff, since this is now a different Construct
- classmethod rotation_free_hash(construct)[source]
calculates a unique circular permutation that is the most alphabetically ordered. Every part is considered as a potential starting point, and the most alphabetically ordered order is then chosen as the best permutation
returns: hash of the most alphabetical ordering, direction of the ordering (always 1), first position of the best rotation
thus, to recreate the conformation of the construct used to make this hash you would have to 1) invert the construct (or not), then 2) use the indicated position as the first position
- set_mixture(mixture)[source]
Set the mixture the Component is in.
- Parameters:
mixture
- 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_combinatorial_complexes(active_components)[source]
given an input list of components, we produce all complexes yielded by those components, mixed and matched to make all possible combinatorial complexes, where each component is assumed to only care about binding to one spot. First, the components are asked what species they make, then these species are sifted to reveal only the ones which are versions of the same polymer, just with different locations bound. Then, combinatorial combinations are made. for example:
construct: <A,B,C>
two new species are possible: <[A:RNAP],B,C>; <A,[B:RNAP],C> combinatorial species is also possible (since A and B are assumed to act independantly)
<[A:RNAP],[B:RNAP],C>
complexes, where each component is assumed to only care about binding to one spot
- update_parameters(overwrite_parameters=True)[source]
update parameters of all parts in the construct
- update_permutation_hash()[source]
update the unique string generated to represent the content of this dna construct regardless of orientation and rotation
- class biocrnpyler.components.dna.construct.DNA_construct(parts_list, name=None, circular=False, mechanisms=None, parameters=None, attributes=None, initial_concentration=None, copy_parts=True, component_enumerators=None, **keywords)[source]
This represents a bunch of parts in a row.
A parts list has [[part,direction],[part,direction],…] Each part must be an OrderedMonomer
- add_mechanism(mechanism, mech_type=None, overwrite=False, optional_mechanism=False)[source]
adds a mechanism of type mech_type to the Component Mechanism dictionary.
- Parameters:
mechanism
mech_type
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:
- 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:
- combinatorial_enumeration()[source]
Returns a list of new components that are copies of existing components, but with a different species placed inside.
This different species represents different combinatorial states of the polymer. for example:
construct: <A,B,C>
two new species are possible: <[A:RNAP],B,C>; <A,[B:RNAP],C> combinatorial species is also possible (since A and B are assumed to act independantly)
<[A:RNAP],[B:RNAP],C>
Thus, this function returns A which binds to <A,B,C> (creating <[A:RNAP],B,C>) AND also A which binds to <A,[B:RNAP],C> (creating <[A:RNAP],[B:RNAP],C>). Likewise for B In total two A components are returned, and two B components are returned.
- property compartment
The compartment of the Component.
- Returns:
Compartment
- classmethod create_hashless_reverse(construct)[source]
create a reverse construct but don’t calculate its hash (because that would make an infinite loop)
- classmethod direction_rotation_free_hash(construct)[source]
computes the best circular permutation of a construct, forward and reverse. Then returns whichever one of those comes alphabetically first
returns: hash of the most alphabetical ordering, direction of the ordering (1 or -1), first position of the best rotation
thus, to recreate the conformation of the construct used to make this hash you would have to 1) invert the construct (or not), then 2) use the indicated position as the first position
- enumerate_components(previously_enumerated=None)[source]
returns a list of new components and constructs. New components are generated if: - a component creates a species which results in binding to part of the construct
Example: <A,B,C> -> <[A:RNAP],B,C> Then, A would be returned since a new species is created
- more than one such component exist in the same construct, for example:
construct: <A,B,C> two new species are possible: <[A:RNAP],B,C>; <A,[B:RNAP],C> combinatorial species is also possible (since A and B are assumed to act independantly)
<[A:RNAP],[B:RNAP],C>
Thus, this function returns A which binds to <A,B,C> (creating <[A:RNAP],B,C>) AND also A which binds to <A,[B:RNAP],C> (creating <[A:RNAP],[B:RNAP],C>). Likewise for B In total two A components are returned, and two B components are returned.
- New constructs are generated if:
self.enumerate_construcs() says so. For example, in <A,B,C>, A is a promoter and makes an RNA_construct containing <B,C>
- enumerate_constructs(previously_enumerated=None)[source]
Runs all our component enumerators to generate new constructs
- get_circularly_permuted(new_first_position)[source]
returns a new construct which has the first position changed to new_first_position
- 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:
tries to find the Parameter in Component.parameter_database
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_part(part=None, part_type=None, name=None, index=None)[source]
Function to get parts from Construct.parts_list.
One of the 3 keywords must not be None.
part: an instance of a DNA_part. Searches Construct.parts_list for a DNA_part with the same type and name. part_type: a class of DNA_part. For example, Promoter. Searches Construct.parts_list for a DNA_part with the same type. name: str. Searches Construct.parts_list for a DNA_part with the same name index: int. returns Construct.parts_list[index]
if nothing is found, returns None.
- classmethod get_partlist_hash(partlist)[source]
creates a string containing the name and direction of all parts in a list of parts (but not their position)
- classmethod get_partstring(part)[source]
a string name of a part including its name and direction (and not position)
- get_reversed()[source]
returns a reversed version of this construct without changing this construct
- classmethod linear_direction_free_hash(construct)[source]
creates a string representing the construct forward or reverse, and returns whichever of those is alphabetically first
returns:
hash of the most alphabetical ordering, direction of the ordering (1 or -1), first position of the best rotation (always 0)
thus, to recreate the conformation of the construct used to make this hash you would have to 1) invert the construct (or not), then 2) use the indicated position as the first position
- located_allcomb(spec_list)[source]
recursively trace all paths through a list [[[part1,1],[part2,5]],[[part3,1]],[[part4,5],[part5,12]]] ====================> compacted_indexes = [1,5,12] prototype_list = [[part1,part3],[part2,part4],[part5]] comb_list = [[1],[5],[12],[1,5],[1,12],[5,12],[1,5,12]] =========================== then, take the lists from comb_list and create all possible lists out of prototype_list that includes those elements
- make_polymers(species_lists, backbone)[source]
makes polymers from lists of species inputs: species_lists: list of species which are to be assembled into a polymer backbone: the base_species which all these polymers should have
- classmethod omnihash(construct)[source]
a construct can exist forwards or backwards, and circularly permuted (but only if it’s a circular construct). This function creates the “best” circular permutation and ordering of a construct. But the circular permutation is only calculated if the construct is circular. Best is calculated based on which orientation/ permutation has the most part names in alphabetical order.
returns: hash of the most alphabetical ordering (string), direction of the ordering (1 or -1), first position of the best rotation
thus, to recreate the conformation of the construct used to make this hash you would have to 1) invert the construct (or not), then 2) use the indicated position as the first position
- reverse()[source]
reverses everything, without actually changing the DNA. also updates the name and stuff, since this is now a different Construct
- classmethod rotation_free_hash(construct)[source]
calculates a unique circular permutation that is the most alphabetically ordered. Every part is considered as a potential starting point, and the most alphabetically ordered order is then chosen as the best permutation
returns: hash of the most alphabetical ordering, direction of the ordering (always 1), first position of the best rotation
thus, to recreate the conformation of the construct used to make this hash you would have to 1) invert the construct (or not), then 2) use the indicated position as the first position
- set_mixture(mixture)[source]
Set the mixture the Component is in.
- Parameters:
mixture
- 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_combinatorial_complexes(active_components)[source]
given an input list of components, we produce all complexes yielded by those components, mixed and matched to make all possible combinatorial complexes, where each component is assumed to only care about binding to one spot. First, the components are asked what species they make, then these species are sifted to reveal only the ones which are versions of the same polymer, just with different locations bound. Then, combinatorial combinations are made. for example:
construct: <A,B,C>
two new species are possible: <[A:RNAP],B,C>; <A,[B:RNAP],C> combinatorial species is also possible (since A and B are assumed to act independantly)
<[A:RNAP],[B:RNAP],C>
complexes, where each component is assumed to only care about binding to one spot
- update_parameters(overwrite_parameters=True)[source]
update parameters of all parts in the construct
- update_permutation_hash()[source]
update the unique string generated to represent the content of this dna construct regardless of orientation and rotation
- class biocrnpyler.components.dna.construct.DNA_part(name, **keywords)[source]
this represents a modular component sequence. These get compiled into working components
- add_mechanism(mechanism: Mechanism, mech_type=None, overwrite=False, optional_mechanism=False)[source]
adds a mechanism of type mech_type to the Component Mechanism dictionary.
- Parameters:
mechanism
mech_type
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:
- 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_orphan()[source]
returns a copy of this monomer, except with no parent. But it still has a position and direction
- 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:
tries to find the Parameter in Component.parameter_database
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
- set_mixture(mixture) None[source]
Set the mixture the Component is in.
- Parameters:
mixture
- 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_parameters(parameter_file=None, parameters=None, parameter_database=None, overwrite_parameters=True)[source]
Updates the ParameterDatabase inside a Component
- Possible inputs:
parameter_file (string) parameters (dict) parameter_database (ParameterDatabase)
- class biocrnpyler.components.dna.construct.RNA_construct(parts_list, name=None, promoter=None, component_enumerators=None, **keywords)[source]
an RNA_construct is a lot like a DNA_construct except it can only translate, and can only be linear
- add_mechanism(mechanism, mech_type=None, overwrite=False, optional_mechanism=False)[source]
adds a mechanism of type mech_type to the Component Mechanism dictionary.
- Parameters:
mechanism
mech_type
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:
- 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:
- combinatorial_enumeration()[source]
Returns a list of new components that are copies of existing components, but with a different species placed inside.
This different species represents different combinatorial states of the polymer. for example:
construct: <A,B,C>
two new species are possible: <[A:RNAP],B,C>; <A,[B:RNAP],C> combinatorial species is also possible (since A and B are assumed to act independantly)
<[A:RNAP],[B:RNAP],C>
Thus, this function returns A which binds to <A,B,C> (creating <[A:RNAP],B,C>) AND also A which binds to <A,[B:RNAP],C> (creating <[A:RNAP],[B:RNAP],C>). Likewise for B In total two A components are returned, and two B components are returned.
- property compartment
The compartment of the Component.
- Returns:
Compartment
- classmethod create_hashless_reverse(construct)[source]
create a reverse construct but don’t calculate its hash (because that would make an infinite loop)
- classmethod direction_rotation_free_hash(construct)[source]
computes the best circular permutation of a construct, forward and reverse. Then returns whichever one of those comes alphabetically first
returns: hash of the most alphabetical ordering, direction of the ordering (1 or -1), first position of the best rotation
thus, to recreate the conformation of the construct used to make this hash you would have to 1) invert the construct (or not), then 2) use the indicated position as the first position
- enumerate_components(previously_enumerated=None)[source]
returns a list of new components and constructs. New components are generated if: - a component creates a species which results in binding to part of the construct
Example: <A,B,C> -> <[A:RNAP],B,C> Then, A would be returned since a new species is created
- more than one such component exist in the same construct, for example:
construct: <A,B,C> two new species are possible: <[A:RNAP],B,C>; <A,[B:RNAP],C> combinatorial species is also possible (since A and B are assumed to act independantly)
<[A:RNAP],[B:RNAP],C>
Thus, this function returns A which binds to <A,B,C> (creating <[A:RNAP],B,C>) AND also A which binds to <A,[B:RNAP],C> (creating <[A:RNAP],[B:RNAP],C>). Likewise for B In total two A components are returned, and two B components are returned.
- New constructs are generated if:
self.enumerate_construcs() says so. For example, in <A,B,C>, A is a promoter and makes an RNA_construct containing <B,C>
- enumerate_constructs(previously_enumerated=None)[source]
Runs all our component enumerators to generate new constructs
- get_circularly_permuted(new_first_position)[source]
returns a new construct which has the first position changed to new_first_position
- 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:
tries to find the Parameter in Component.parameter_database
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_part(part=None, part_type=None, name=None, index=None)[source]
Function to get parts from Construct.parts_list.
One of the 3 keywords must not be None.
part: an instance of a DNA_part. Searches Construct.parts_list for a DNA_part with the same type and name. part_type: a class of DNA_part. For example, Promoter. Searches Construct.parts_list for a DNA_part with the same type. name: str. Searches Construct.parts_list for a DNA_part with the same name index: int. returns Construct.parts_list[index]
if nothing is found, returns None.
- classmethod get_partlist_hash(partlist)[source]
creates a string containing the name and direction of all parts in a list of parts (but not their position)
- classmethod get_partstring(part)[source]
a string name of a part including its name and direction (and not position)
- get_reversed()[source]
returns a reversed version of this construct without changing this construct
- classmethod linear_direction_free_hash(construct)[source]
creates a string representing the construct forward or reverse, and returns whichever of those is alphabetically first
returns:
hash of the most alphabetical ordering, direction of the ordering (1 or -1), first position of the best rotation (always 0)
thus, to recreate the conformation of the construct used to make this hash you would have to 1) invert the construct (or not), then 2) use the indicated position as the first position
- located_allcomb(spec_list)[source]
recursively trace all paths through a list [[[part1,1],[part2,5]],[[part3,1]],[[part4,5],[part5,12]]] ====================> compacted_indexes = [1,5,12] prototype_list = [[part1,part3],[part2,part4],[part5]] comb_list = [[1],[5],[12],[1,5],[1,12],[5,12],[1,5,12]] =========================== then, take the lists from comb_list and create all possible lists out of prototype_list that includes those elements
- make_polymers(species_lists, backbone)[source]
makes polymers from lists of species inputs: species_lists: list of species which are to be assembled into a polymer backbone: the base_species which all these polymers should have
- classmethod omnihash(construct)[source]
a construct can exist forwards or backwards, and circularly permuted (but only if it’s a circular construct). This function creates the “best” circular permutation and ordering of a construct. But the circular permutation is only calculated if the construct is circular. Best is calculated based on which orientation/ permutation has the most part names in alphabetical order.
returns: hash of the most alphabetical ordering (string), direction of the ordering (1 or -1), first position of the best rotation
thus, to recreate the conformation of the construct used to make this hash you would have to 1) invert the construct (or not), then 2) use the indicated position as the first position
- reverse()[source]
reverses everything, without actually changing the DNA. also updates the name and stuff, since this is now a different Construct
- classmethod rotation_free_hash(construct)[source]
calculates a unique circular permutation that is the most alphabetically ordered. Every part is considered as a potential starting point, and the most alphabetically ordered order is then chosen as the best permutation
returns: hash of the most alphabetical ordering, direction of the ordering (always 1), first position of the best rotation
thus, to recreate the conformation of the construct used to make this hash you would have to 1) invert the construct (or not), then 2) use the indicated position as the first position
- set_mixture(mixture)[source]
Set the mixture the Component is in.
- Parameters:
mixture
- 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_combinatorial_complexes(active_components)[source]
given an input list of components, we produce all complexes yielded by those components, mixed and matched to make all possible combinatorial complexes, where each component is assumed to only care about binding to one spot. First, the components are asked what species they make, then these species are sifted to reveal only the ones which are versions of the same polymer, just with different locations bound. Then, combinatorial combinations are made. for example:
construct: <A,B,C>
two new species are possible: <[A:RNAP],B,C>; <A,[B:RNAP],C> combinatorial species is also possible (since A and B are assumed to act independantly)
<[A:RNAP],[B:RNAP],C>
complexes, where each component is assumed to only care about binding to one spot
- update_parameters(overwrite_parameters=True)[source]
update parameters of all parts in the construct
- update_permutation_hash()[source]
update the unique string generated to represent the content of this dna construct regardless of orientation and rotation