Molecule Config Generators

Functions for generating MolConfig objects given an input molecule.

conformer_rl.molecule_generation.generate_molecule_config.config_from_molFile(file: str, num_conformers: int, calc_normalizers: bool = False, pruning_thresh: float = 0.05, save_file: str = '') conformer_rl.config.mol_config.MolConfig

Generates a MolConfig object for a molecule specified by the location of a MOL file containing the molecule.

Parameters
  • file (str) – Name of the MOL file containing the molecule to be converted into a MolConfig object.

  • num_conformers (int) – Number of conformers to be generated. This parameter is also used for calculating normalizers.

  • calc_normalizers (bool) – Whether to calculate normalizing constants used in the Gibbs score reward. See MolConfig for more details.

  • pruning_thresh (float) – Torsional fingerprint distance (TFD) threshold for pruning similar conformers when calculating normalizers. This parameter is only used for calculating normalizers and is ignored if calc_normalizers is set to False.

  • save_file (str) – If not set to an empty string, the generated config object will be saved as a pickle (.pkl) file with the filename set to this parameter.

Returns

A MolConfig object configured with the input molecule, as well as normalizing constants if calc_normalizers is set to True.

Return type

MolConfig

conformer_rl.molecule_generation.generate_molecule_config.config_from_smiles(smiles: str, num_conformers: int, calc_normalizers: bool = False, pruning_thresh: float = 0.05, save_file: str = '') conformer_rl.config.mol_config.MolConfig

Generates a MolConfig object for a molecule specified by a SMILES string.

Parameters
  • smiles (str) – A SMILES string representing the molecule.

  • num_conformers (int) – Number of conformers to be generated. This parameter is also used for calculating normalizers.

  • calc_normalizers (bool) – Whether to calculate normalizing constants used in the Gibbs score reward. See MolConfig for more details.

  • pruning_thresh (float) – Torsional fingerprint distance (TFD) threshold for pruning similar conformers when calculating normalizers. This parameter is only used for calculating normalizers and is ignored if calc_normalizers is set to False.

  • save_file (str) – If not set to an empty string, the generated config object will be saved as a pickle (.pkl) file with the filename set to this parameter.

Returns

A MolConfig object configured with the input molecule, as well as normalizing constants if calc_normalizers is set to True.

Return type

MolConfig

conformer_rl.molecule_generation.generate_molecule_config.config_from_rdkit(mol: rdkit.Chem.rdchem.Mol, num_conformers: int, calc_normalizers: bool = False, pruning_thresh: float = 0.05, save_file: str = '') conformer_rl.config.mol_config.MolConfig

Generates a MolConfig object for a molecule specified by an rdkit molecule object.

Parameters
  • mol (rdkit.Chem.rdchem.Mol) – A rdkit molecule object.

  • num_conformers (int) – Number of conformers to be generated. This parameter is also used for calculating normalizers.

  • calc_normalizers (bool) – Whether to calculate normalizing constants used in the Gibbs score reward. See MolConfig for more details.

  • pruning_thresh (float) – Torsional fingerprint distance (TFD) threshold for pruning similar conformers when calculating normalizers. This parameter is only used for calculating normalizers and is ignored if calc_normalizers is set to False.

  • save_file (str) – If not set to an empty string, the generated config object will be saved as a pickle (.pkl) file with the filename set to this parameter.

Returns

A MolConfig object configured with the input molecule, as well as normalizing constants if calc_normalizers is set to True.

Return type

MolConfig