update_atom_bond_props#

update_atom_bond_props(mol_to_change, mol_reference, sanitize=True)[source]#

Update atom and bond properties of one molecule to match another.

Molecules must either be identical in their atomic composition and connectivity, or the reference may be the same as the other but with implicit hydrogens, in which case it’s assumed that the indices are simply shifted. Atom properties include the formal charge, whether the atom is aromatic, and setting NoImplicit = True. Bond properties include the bond order.

Parameters:
  • mol_to_change (rdkit.Chem.Mol) – RDKit molecule that needs to be updated

  • mol_reference (rdkit.Chem.Mol) – RDKit molecule for reference to update the target molecule

  • sanitize (bool, optional, default=True) – Sanitize the resulting molecule

Raises:

ValueError – If the chemical formulas of the provided molecules indicate that they cannot be mapped.