reform_metal_complex#
- reform_metal_complex(tm_mol, lig_info, coordinating_atoms, tm_charge=0, sanitize=True)[source]#
Reconnects ligands to a transition metal center to reform a metal complex.
This function takes a transition metal molecule and a list of ligand molecules, then combines them into a single complex. It reconnects the ligands to the metal center at specified coordinating atom indices, adjusting bond orders as needed.
- Parameters:
tm_mol (tuple[rdkit.Chem.rdchem.Mol, int]) – A tuple containing the RDKit molecule of the transition metal center and its formal charge.
lig_info (list[tuple[rdkit.Chem.rdchem.Mol, int, int, Any]]) – A list of dictionaries defined in
get_ligand_assessment()coordinating_atoms (list[int]) – List of atom indices (from the original complex) that should be reconnected to the metal center.
tm_charge (int, optional, default=0) – Formal charge of the transition metal center.
sanitize (bool, optional, default=True) – If True, will sanitize the final complex with
sanitize_molecule()
- Returns:
The reformed metal complex as an RDKit RWMol object with ligands reconnected.
- Return type:
rdkit.Chem.rdchem.RWMol
- Raises:
UserWarning: – If the bond order between the metal and a coordinating atom is changed during reconnection.
Notes
The function assumes that the transition metal atom is the first atom in tm_mol.
Atom indices in coordinating_atoms refer to the original ligand atoms before combination.
The function does not sanitize the resulting molecule, as this may break certain structures.