moleculekit.smallmol.smallmolcdp module#

class moleculekit.smallmol.smallmolcdp.SmallMolCDP(filename)#

Bases: object

Class to manipulate small molecule structures backed by the Chemical Data Processing Library (CDPKit).

The molecule is stored internally as a CDPL.Chem.BasicMolecule and atom/bond properties are exposed as numpy arrays. This class is primarily useful for CDPKit-based conformer generation.

Parameters:

filename (str or moleculekit.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:

numpy.ndarray

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:

numpy.ndarray

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:

numpy.ndarray

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:

numpy.ndarray

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:

numpy.ndarray

property element: ndarray#

The element symbol of each atom.

Returns:

element – An object array with the element symbol of each atom

Return type:

numpy.ndarray

property formalcharge: ndarray#

The formal charge of each atom.

Returns:

formalcharge – An object array with the formal charge of each atom

Return type:

numpy.ndarray

generateConformers(num_confs=1, timeout=3600, min_rmsd=0.5, e_window=20.0)#

Generate conformers for the molecule.

Parameters:
  • num_confs (int) – Number of conformers to generate. If set to 1 it will generate the lowest energy conformer.

  • timeout (int) – Maximum allowed molecule processing time in seconds.

  • min_rmsd (float) – Output conformer RMSD threshold.

  • e_window (float) – Output conformer energy window.

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:

str

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:

numpy.ndarray

property numAtoms: int#

The number of atoms in the molecule.

Returns:

numatoms – The number of atoms

Return type:

int

property numFrames: int#

The number of conformers (frames) of the molecule.

Returns:

numframes – The number of conformers

Return type:

int

toMolecule()#

Return a moleculekit.molecule.Molecule

Returns:

mol – The moleculekit Molecule object

Return type:

Molecule

view(*args, **kwargs)#

Visualizes the molecule.

The molecule is converted to a moleculekit.molecule.Molecule and all arguments are forwarded to its view method.