spyrmsd.molecule module
- class spyrmsd.molecule.Molecule(atomicnums: ndarray | List[int], coordinates: ndarray | List[List[float]], adjacency_matrix: ndarray | List[List[int]] | None = None)[source]
Bases:
object- center_of_geometry() ndarray[source]
Center of geometry.
- Returns:
Center of geometry
- Return type:
np.ndarray
- center_of_mass() ndarray[source]
Center of mass.
- Returns:
Center of mass
- Return type:
np.ndarray
Notes
Atomic masses are cached.
- classmethod from_rdkit(rdmol, adjacency: bool = True)[source]
Constructor from RDKit molecule.
- Parameters:
rdmol – RDKit molecule
adjacency – Flag to compute the adjacency matrix
- Returns:
spyrmsdMolecule- Return type:
- rotate(angle: float, axis: ndarray | List[float], units: str = 'rad') None[source]
Rotate molecule.
- Parameters:
angle (float) – Rotation angle
axis (np.ndarray) – Axis of rotation (in 3D)
units ({“rad”, “deg”}) – Units of the angle (radians rad or degrees deg)
- spyrmsd.molecule.coords_from_molecule(mol: Molecule, center: bool = False) ndarray[source]
Atomic coordinates from molecule.
- Parameters:
mol (molecule.Molecule) – Molecule
center (bool) – Center flag
- Returns:
Atomic coordinates (possibly centred)
- Return type:
np.ndarray
Notes
Atomic coordinates are centred according to the center of geometry, not the center of mass.