Complicated metal complexes as ligand#273
Complicated metal complexes as ligand#273rwxayheee wants to merge 6 commits intoforlilab:developfrom
Conversation
double, and more bond types; M-L-M structure
| for idx in neigh_idx_to_nr_h: | ||
| n = neigh_idx_to_nr_h[idx] | ||
| newidx = idx - sum([i < idx for i in idx_to_rm]) | ||
| mol.GetAtomWithIdx(newidx).SetNumExplicitHs(n + 1) |
There was a problem hiding this comment.
SetNumExplicitHs without Resetting it (since the added hydrogens are non-real) might be causing some problems when functions like RemoveHs are called later on the ligand mol
There was a problem hiding this comment.
Instead of resetting it, not modifying atoms in input mol is better
|
This PR allows preparation of metal complexes with dative bonds as ligands. An example is heme (with Fe(II): Input SDF: Output PDBQT: |
|
Merged develop into this branch. Added a test (example showed in this PR):
|
meeko/molsetup.py
Outdated
| rm_to_neigh[atom.GetIdx()].add(neigh.GetIdx()) | ||
| if not idx_to_rm: | ||
| return Chem.Mol(mol), idx_to_rm, rm_to_neigh | ||
| return input_mol, idx_to_rm, rm_to_neigh |
There was a problem hiding this comment.
Need to either return a copy of input_mol, or make a copy before changing Se to S for computing Gasteiger charges in the function that calls remove_elements()
There was a problem hiding this comment.
Can you explain why and what's the difference?
There was a problem hiding this comment.
It's to prevent a side effect (a modification) on a molecule that a user passes to an instance of MoleculePreparation. This could be a padded_mol in a Polymer. The modification is changing Selenium to Sulfur here: https://github.com/rwxayheee/Meeko/blob/cb7b4e7db4334f161b35124135214ca69099c3f1/meeko/molsetup.py#L1768-L1771
That's why the original code returns a copy of the input molecule, instead of returning the input molecule itself. Then the copy is modified, and the original input mol is safe from side effects.
There was a problem hiding this comment.
Got it, thanks, I understand now
changes outside of the function in the subsequent steps

This small edit on the charge method allows potentially complicated metal complexes (with datives, double, triple or quadruple bonds) to become ligand, where metal gets a partial charge as the sum of the metal's formal charge (from input) and the Gasteiger charges of non-real Hs that were added to compensate breaking M-L bonds.
It should also support charge assignment in bridged structures like M-L-M. Here, the coordinate atom L will have multiple added Hs, and the charge will be distribute to both metal atoms based on the bond order.
Dative bonds, are a special case. Breaking a dative bonds do not result in addition of non-real Hs.
This process looks complicated. I put some more in-line comments, but in future we could rewrite it.