Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complicated metal complexes as ligand #273

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

rwxayheee
Copy link
Contributor

@rwxayheee rwxayheee commented Dec 9, 2024

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.

double, and more bond types; M-L-M structure
@rwxayheee rwxayheee changed the title implement support for metal complexes as ligand Metal complexes as ligand Dec 9, 2024
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)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of resetting it, not modifying atoms in input mol is better

@rwxayheee rwxayheee requested a review from diogomart December 10, 2024 05:39
@rwxayheee rwxayheee marked this pull request as ready for review December 10, 2024 05:39
@rwxayheee
Copy link
Contributor Author

rwxayheee commented Dec 10, 2024

This PR allows preparation of metal complexes with dative bonds as ligands. An example is heme (with Fe(II):
Chemical structure:
heme_mine_structure

Input SDF:
heme_mine.sdf.txt

Output PDBQT:
heme_mine.pdbqt.txt

@rwxayheee
Copy link
Contributor Author

Merged develop into this branch.

Added a test (example showed in this PR):

  • added a script file metal_test.py
  • added a folder metal_complex_data for test files

@rwxayheee rwxayheee changed the base branch from develop to release January 16, 2025 21:55
@rwxayheee rwxayheee changed the base branch from release to develop January 16, 2025 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RuntimeError: expected only 1 added H per heavy atom, maybe deleted element had double bond to this heavy atom
1 participant