rdtools.conversion.rmg#
Convert RMG Molecule to RDKit Mol and vice versa.
- rdtools.conversion.rmg.mol_from_rmg_mol(rmgmol: rmgpy.molecule.molecule.Molecule, remove_hs: bool = False, sanitize: bool = True) RWMol #
Convert a RMG Mol to an RDKit Mol object.
Uses RDKit to perform the conversion. Adopted from rmgpy/molecule/converter.py
- Parameters:
rmgmol (mm.Molecule) – An RMG Molecule object for the conversion.
remove_hs (bool, optional) – Whether to remove hydrogen atoms from the molecule,
True
to remove.sanitize (bool, optional) – Whether to sanitize the RDKit molecule,
True
to sanitize.
- Returns:
Chem.RWMol – An RWMol molecule object corresponding to the input RMG Molecule object.
- rdtools.conversion.rmg.mol_to_rmg_mol(rdkitmol: Mol, sort: bool = False, raise_atomtype_exception: bool = True) rmgpy.molecule.molecule.Molecule #
Convert a RDKit Mol object to an RMG molecular structure.
Uses RDKit to perform the conversion. This Kekulizes everything, removing all aromatic atom types.
- Parameters:
rdkitmol (Chem.Mol) – An RDKit Mol object for the conversion.
sort (bool, optional) – Whether to sort the atoms in the molecule. Defaults to
False
.raise_atomtype_exception (bool, optional) – Whether to raise an exception if atom types cannot be assigned. Defaults to
True
.
- Returns:
mm.Molecule – An RMG Molecule object corresponding to the input RDKit Mol object.