fractaldna.dna_models.molecules.Molecule¶
- class fractaldna.dna_models.molecules.Molecule(name, shape, dimensions, strand=-1, chain=-1, position=array([0., 0., 0.]), rotation=array([0., 0., 0.]), index=0)¶
Bases:
object
Create a molecule
- Parameters:
name (
str
) – molecule nameshape (
str
) – shape of moleculedimensions (
array
) – dimensions of molecule shape (3-vector for xyz-dims, int/float for radius)strand (
int
) – int to hold an ID related to a localised strandchain (
int
) – int to hold an ID related to a macromolecule/protein or DNA chainposition (
array
) – 3-vector for molecule position relative to global axisrotation (
array
) – 3-vector of euler angles (radians) for molecule rotation relative to the global xyz axisindex (
int
) – index of base pair along chain
- __init__(name, shape, dimensions, strand=-1, chain=-1, position=array([0., 0., 0.]), rotation=array([0., 0., 0.]), index=0)¶
constructor
Methods
__init__
(name, shape, dimensions[, strand, ...])constructor
point_in_molecule
(point)Assert whether a point (x, y, z) is inside the molecule.
rotate
(rotation)Rotate molecule by [X_angle, Y_angle, Z_angle]
Convert molecule to a pandas series
to_text
([seperator])Return a text description of the molecule Molecule.toText(seperator=" ")
translate
(translation)- type translation:
array
- point_in_molecule(point)¶
Assert whether a point (x, y, z) is inside the molecule.
- Param:
point (x, y, z)
- Return type:
bool
- Returns:
True/False point in molecule
- rotate(rotation)¶
Rotate molecule by [X_angle, Y_angle, Z_angle]
- Parameters:
rotation (
array
) – Euler angles for rotation- Return type:
None
- to_series()¶
Convert molecule to a pandas series
- Return type:
Series
- Returns:
Series representation of the molecule
- to_text(seperator=' ')¶
Return a text description of the molecule Molecule.toText(seperator=” “)
- Parameters:
seperator (
str
) – seperation character- Return type:
str
- translate(translation)¶
- Parameters:
translation (
array
) – Translate the molecule by (x, y, z)- Return type:
None