forlilab / Meeko

Interfacing RDKit and AutoDock
GNU Lesser General Public License v2.1
171 stars 41 forks source link

Molecule not OK, refusing to write PDBQT #40

Closed lmdu closed 1 year ago

lmdu commented 1 year ago

I used meeko 0.4.0 with Python 3.8 on Windows to prepare ligand. I encountered an error:

 File "C:\Python38\lib\site-packages\meeko\preparation.py", line 215, in write_pdbqt_file
    w.write(self.write_pdbqt_string(add_index_map, remove_smiles))
  File "C:\Python38\lib\site-packages\meeko\preparation.py", line 205, in write_pdbqt_string
    raise RuntimeError("Molecule not OK, refusing to write PDBQT\n\nLOG:\n%s" % self.log)
RuntimeError: Molecule not OK, refusing to write PDBQT

LOG:
molecule has implicit hydrogens

However, the meeko 0.3.0 works well. I have attached the test data ligand1.pdb.txt

diogomart commented 1 year ago

You need to add hydrogens and 3D coordinates.

Meeko 0.3.0 does not raise an error but the docking will be wrong.

lmdu commented 1 year ago

Thank you for your reply! I used RDKit to add hydrogens and 3D coordinates to fix this problem.

mol = Chem.AddHs(mol, addCoords=True)
diogomart commented 1 year ago

That adds coordinates to the hydrogens only, and keeps the molecule 2D.

Here's a suggestion for adding 3D coordinates with RDKit:

from rdkit.Chem import rdDistGeom
from rdkit.Chem import rdForceFieldHelpers
mol = Chem.AddHs(mol)
etkdgv3 = rdDistGeom.ETKDGv3()
rdDistGeom.EmbedMolecule(mol, etkdgv3)
rdForceFieldHelpers.UFFOptimizeMolecule(mol)
lmdu commented 1 year ago

Thank you so much for your help.