e3fp.conformer.generate module

Generate conformers from SMILES or MOL2 files.

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

generate_conformers(input_mol, name=None, standardise=False, num_conf=-1, first=-1, pool_multiplier=1, rmsd_cutoff=0.5, max_energy_diff=None, forcefield='uff', seed=-1, out_file=None, out_dir='conformers', save=False, compress='2', overwrite=False)[source]

Generate and save conformers for molecules.

Parameters
  • input_mol (RDKit Mol) – Mol with a single conformer from which to generate conformers.

  • name (str, optional) – Name of molecule.

  • standardise (bool, optional) – Standardise mol before generating conformers.

  • num_conf (int, optional) – If int, this is the target number of conformations. If -1, number of conformations is automatically chosen based on number of rotatable bonds.

  • first (int, optional) – Number of first conformers to return. Does not impact conformer generator process, except may terminate conformer generation early when this many of conformers have been accepted.

  • pool_multiplier (int, optional) – Factor to multiply by num_conf. The resulting number of conformations will be generated, then pruned to num_conf.

  • rmsd_cutoff (float, optional) – RMSD threshold above which to accept two conformations as different

  • max_energy_diff (float, optional) – Maximum energy difference between lowest energy conformer and any accepted conformer.

  • forcefield ({‘uff’, ‘mmff94’, ‘mmff94s’}, optional) – Forcefield to use for minimization of conformers.

  • seed (int, optional) – Random seed for conformer generation. If -1, the random number generator is unseeded.

  • out_file (str, optional) – Filename to save output, if save is True. If None, filename will be name.sdf, optionally with a compressed extension.

  • out_dir (str, optional) – Directory where output files will be saved if save is True.

  • save (bool, optional) – Save conformers to out_file in out_dir.

  • compress (int, optional) – Compression of SDF files. None: auto. Mode is chosen based on extension, defaulting to SDF. 0: File is not compressed. 1: File is gzipped (.gz) 2: File is bzipped (.bz2)

  • overwrite (bool, optional) – Overwrite output files if they already exist.

Returns

  • bool – If something went wrong, only return False. Otherwise return below.

  • tuple – Tuple with molecule name, number of rotatable bonds, numpy array of indices of final conformations, numpy array of energies of all conformations generated, and 2D numpy array of pairwise RMSDs between final conformations.

run(mol2=None, smiles=None, standardise=False, num_conf=-1, first=-1, pool_multiplier=1, rmsd_cutoff=0.5, max_energy_diff=None, forcefield='uff', seed=-1, params=None, prioritize=False, out_dir='conformers', compress='2', overwrite=False, values_file=None, log=None, num_proc=None, parallel_mode=None, verbose=False)[source]

Run conformer generation.

values_to_hdf5(hdf5_buffer, values)[source]

Write specific values to hdf5_buffer.

Parameters
  • hdf5_buffer (HDF5Buffer) – HDF5 buffer to write to.

  • values (tuple) – Tuple of values to be written to buffer. Values and types should be name (str), num_rotatable_bonds (int), target_conformers (int), indices (numpy long array), energies (numpy float array), and rmsd (numpy float array). rmsd should be a square array with size along each dimension equal to length of indices.

Returns

True if success, False if not.

Return type

bool