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

Support for metal atoms #252

Open
frgoe003 opened this issue Nov 19, 2024 · 6 comments · May be fixed by #259
Open

Support for metal atoms #252

frgoe003 opened this issue Nov 19, 2024 · 6 comments · May be fixed by #259
Assignees

Comments

@frgoe003
Copy link

frgoe003 commented Nov 19, 2024

I'm using the cli to prepare metalloproteins for docking, however, it seems to have issues with some metals:

RuntimeError: Element Na doesn't have an implemented covalent radius, which was required for the perception of intermolecular bonds I encounter this error for a couple elements like Na, Co, Ni, Pt, Yb and K.

It seems meeko uses the rdkit periodic table module to get the radii. Is there a way to bypass it or use a dummy value? Or maybe it could be added to be considered under the --allow_bad_res flag.

@rwxayheee
Copy link
Contributor

Hi @frgoe003
At present, the supported types of elements are very limited. They only have a defined covalent radius if they have an AutoDock atom type for receptor preparation.
The covalent radii were put in as a dictionary (not from the periodic table module) so it’s always possible to allow more elements, but the same time we will need to register the atom type. Overall it’s technically possible to bypass it.

Currently unsupported elements can’t be automatically ignored by -a. But you could delete them by argument delete_residues.

@frgoe003
Copy link
Author

Understood, thanks! What would be required to register an atom type? Since quite common metals are missing, it would be nice to add them. Happy to help!

@rwxayheee
Copy link
Contributor

Hi @frgoe003
To bypass the element check, you could start from

covalent_radius = { # from wikipedia

Then if you want to do receptor preparation, I think the additional elements need to be registered in here also
https://github.com/forlilab/Meeko/blob/07a38f8bac4aa9eef4ef30aa8e67475b15d517aa/meeko/data/params/ad4_types.json

There might be other things to edit if you want to do this by changing the default parameter file (or alternatively in Python, there's an entry to input additional parameters). But unlike ligand preparation, it's not very straightforward to have metals and custom types in receptor preparation.

Could you provide some PDB IDs that you would be interested in (for receptor preparation)? There might be other complications if the metals are part of a residue and need monomer mapping. But please keep this discussion open and we can consider it as an enhancement / feature in future

Last but not least, if you only want a PDBQT file with the metal ions, the quickest way would be to insert the metal atom line directly and assign an integer charge. Then depending on the docking engines or next tasks you want to perform on the structure, you can pass the additional parameters in different ways (it might not be necessary to register the parameters and types in Meeko, although with the parameters

@frgoe003
Copy link
Author

Thanks @rwxayheee! An example system I'm looking at is 8J3C.

I added the covalent radii in Meeko/meeko/utils/rdkitutils.py and registered them in Meeko/meeko/data/params/ad4_types.json, but now it fails to build the template (see below).

I would add the metal ion directly to the PDBQT File, but receptor preparation raises an error with these metals present. Of course I could remove them before the preparation, but it would be nice to have native support with Meeko.

Input residues {'-:1': 'CO'} not in residue_templates
  Input residues {'-:1': 'CO'} not in residue_templates
  
  Trying to resolve unknown residues by building chemical templates... 
  Failed building template from CCD for resname='CO'
  
  Error: Creation of data structure for receptor failed.
  
  Column name not found: _chem_comp_bond.atom_id_1
  Traceback (most recent call last):
  
    File "/home/user/miniconda3/envs/docking/lib/python3.11/site-packages/meeko/polymer.py", line 853, in __init__
      cc = build_noncovalent_CC(resname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/user/miniconda3/envs/docking/lib/python3.11/site-packages/meeko/chemtempgen.py", line 619, in build_noncovalent_CC
      cc_from_cif = ChemicalComponent.from_cif(fetch_from_pdb(basename), basename)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/user/miniconda3/envs/docking/lib/python3.11/site-packages/meeko/chemtempgen.py", line 398, in from_cif
      bond_cols = {attr: bond_table.find_column(f"{bond_category}{attr}") for attr in bond_attributes}
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/user/miniconda3/envs/docking/lib/python3.11/site-packages/meeko/chemtempgen.py", line 398, in <dictcomp>
      bond_cols = {attr: bond_table.find_column(f"{bond_category}{attr}") for attr in bond_attributes}
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  RuntimeError: Column name not found: _chem_comp_bond.atom_id_1

@rwxayheee
Copy link
Contributor

Hi @frgoe003
Thanks for reporting this. It seems like the template generation function was trying to get the chemical template for Co2+ ion from the Protein Data Bank. We should skip the template making part for single-atom molecule.
Sorry for the late response, and thanks for the example. I will work on it this week.

@rwxayheee
Copy link
Contributor

Hello @frgoe003
There're only very small changes I did in the code to allow Co2+ (and other metal ions in receptor with a provided covalent radius & ad4 atom type). These ions will still be fetched from PDB, but the missing bond section is forgiven.

If you're interested, see how that compares to the release:
release...rwxayheee:Meeko:metal_support

With this, I was able to generate receptor PDBQT files for 8J3C. Co2+ has an integer charge of +2.

To use the modified code, you can check out that specific commit 32a7b3d from my fork and install with pip install .. In the near future I will create a PR with it. Thanks again for bringing this to our attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants