moleculekit.smallmol.smallmolcdp module#
- class moleculekit.smallmol.smallmolcdp.SmallMolCDP(filename)#
Bases:
objectClass to manipulate small molecule structures backed by the Chemical Data Processing Library (CDPKit).
The molecule is stored internally as a
CDPL.Chem.BasicMoleculeand atom/bond properties are exposed as numpy arrays. This class is primarily useful for CDPKit-based conformer generation.- Parameters:
filename (
strormoleculekit.molecule.Molecule) – Either the path to a molecule file readable by CDPKit, or a moleculekit moleculekit.molecule.Molecule object, which is written to a temporary SDF file and read back.
- property atomtype: ndarray#
The Sybyl atom type of each atom.
Returns the Sybyl atom type of each atom, defaulting to an empty string when not set.
- Returns:
atomtype – An object array with the Sybyl atom type of each atom
- Return type:
- property bonds: ndarray#
The bonds of the molecule as pairs of atom indices.
- Returns:
bonds – An array of shape (nbonds, 2) with the begin and end atom indices of each bond
- Return type:
- property bondtype: ndarray#
The bond order of each bond as a string.
- Returns:
bondtype – An object array with the bond order of each bond
- Return type:
- property charge: ndarray#
The partial charge of each atom.
Returns the MOL2 partial charge of each atom, defaulting to 0 when not set.
- Returns:
charge – An object array with the partial charge of each atom
- Return type:
- property coords: ndarray#
The atom coordinates of the molecule.
- Returns:
coords – A float32 array of shape (natoms, 3, nframes) with the coordinates of each atom for each conformer
- Return type:
- property element: ndarray#
The element symbol of each atom.
- Returns:
element – An object array with the element symbol of each atom
- Return type:
- property formalcharge: ndarray#
The formal charge of each atom.
- Returns:
formalcharge – An object array with the formal charge of each atom
- Return type:
- generateConformers(num_confs=1, timeout=3600, min_rmsd=0.5, e_window=20.0)#
Generate conformers for the molecule.
- property ligname: str#
The ligand name of the molecule.
Returns the molecule’s name property, defaulting to
"LIG"when not set.- Returns:
ligname – The ligand name
- Return type:
- property name: ndarray#
The name of each atom.
Returns the MOL2 atom name of each atom, defaulting to an empty string when not set.
- Returns:
name – An object array with the name of each atom
- Return type:
- property numAtoms: int#
The number of atoms in the molecule.
- Returns:
numatoms – The number of atoms
- Return type:
- property numFrames: int#
The number of conformers (frames) of the molecule.
- Returns:
numframes – The number of conformers
- Return type:
- toMolecule()#
Return a moleculekit.molecule.Molecule
- Returns:
mol – The moleculekit Molecule object
- Return type:
- view(*args, **kwargs)#
Visualizes the molecule.
The molecule is converted to a moleculekit.molecule.Molecule and all arguments are forwarded to its
viewmethod.