Molecular Geometry

get_center(mol)[source]

Get the geometric center of an RDKit molecule

Parameters:

mol – RDKit molecule

Return type:

ndarray

Returns:

center as a numpy array

get_shape_moments(mol)[source]

Calculate principal moments of inertia as defined in https://pubs.acs.org/doi/10.1021/ci025599w

Parameters:

mol – RDKit molecule

Return type:

tuple

Returns:

first 2 moments as a tuple

gen_3d(mol)[source]

Generate a 3D structure for a RDKit molecule

Parameters:

mol (Mol) – input molecule

Return type:

Optional[Mol]

Returns:

molecule with 3D coordinates

gen_conformers(mol, num_confs=10)[source]

Generate conformers for a molecule

Parameters:

mol – RDKit molecule

Returns:

molecule with conformers

MolTo3DView(mol, size=(300, 300), style='stick', surface=False, opacity=0.5)[source]

Draw molecule in 3D

Mol:

rdMol, molecule to show

Size:

tuple(int, int), canvas size

Style:

str, type of drawing molecule, style can be ‘line’, ‘stick’, ‘sphere’, ‘carton’

Surface:

bool, display SAS

Opacity:

float, opacity of surface, range 0.0-1.0

Return type:

view

Returns:

viewer: py3Dmol.view, a class for constructing embedded 3Dmol.js views in ipython notebooks.