e3fp.conformer.generator module

Conformer generation.

Author: Seth Axen E-mail: seth.axen@gmail.com

class ConformerGenerator(num_conf=-1, first=-1, rmsd_cutoff=0.5, max_energy_diff=-1.0, forcefield='uff', pool_multiplier=1, seed=-1, get_values=False, sparse_rmsd=True, store_energies=True)[source]

Bases: object

Generate conformers using RDKit.

Procedure

  1. Generate a pool of conformers.

  2. Minimize conformers.

  3. Filter conformers using an RMSD threshold and optional minimum energy difference.

Note that pruning is done _after_ minimization, which differs from the protocol described in the references.

References

embed_molecule(mol)[source]

Generate conformers, possibly with pruning.

Parameters

mol (RDKit Mol) – Molecule.

filter_conformers(mol)[source]

Filter conformers which do not meet an RMSD threshold.

Parameters

mol (RDKit Mol) – Molecule.

Returns

  • A new RDKit Mol containing the chosen conformers, sorted by

  • increasing energy.

generate_conformers(mol)[source]

Generate conformers for a molecule.

Parameters

mol (RDKit Mol) – Molecule.

Returns

RDKit Mol

Return type

copy of the input molecule with embedded conformers

get_conformer_energies(mol)[source]

Calculate conformer energies.

Parameters

mol (RDKit Mol) – Molecule.

Returns

energies – Minimized conformer energies.

Return type

array_like

get_molecule_force_field(mol, conf_id=None, **kwargs)[source]

Get a force field for a molecule.

Parameters
  • mol (RDKit Mol) – Molecule.

  • conf_id (int, optional) – ID of the conformer to associate with the force field.

  • **kwargs (dict, optional) – Keyword arguments for force field constructor.

static get_num_conformers(mol)[source]

Return ideal number of conformers from rotatable bond number in model.

Parameters

mol (Mol) – RDKit Mol object for molecule

Yields

num_conf (int) – Target number of conformers to accept

minimize_conformers(mol)[source]

Minimize molecule conformers.

Parameters

mol (RDKit Mol) – Molecule.

static reverse_enumerate(iterable)[source]

Enumerate, but with the last result first but still numbered last.

Parameters

iterable (some 1-D iterable)

Returns

Reverse of enumerate function

Return type

iterable