protocaller / ProtoCaller

Full automation of relative protein-ligand binding free energy calculations in GROMACS
http://protocaller.readthedocs.io
GNU General Public License v3.0
43 stars 15 forks source link

Error while calling command 'antechamber' #36

Closed kexul closed 3 years ago

kexul commented 3 years ago

I got a mol2 file with net charge +1, it could be properly parameterized by ProtoCaller, when I converted it to sdf, an error occurred.

OSError: Error while calling command 'antechamber'

Here is the original mol2 file and converted sdf file. ligand.zip

Here is the code to reproduce:

lig = Ligand('ligand.sdf', protonated=True, minimise=True)
lig.parametrise()

Here is the code I've used to convert mol2 to sdf:

from rdkit import Chem 
mol = Chem.MolFromMol2File('ligand.mol2')
Chem.MolToMolFile(mol, 'ligand.sdf')
msuruzhon commented 3 years ago

If you visualise the sdf file, you can see that it's not actually protonated. This is because RDKit makes the hydrogens implicit by default when you load the mol2 file. If you pass protonated=True, it will then obviously result in an error, because it's not actually protonated and you are trying to parametrise an unprotonated ligand. However, it is going to crash even if you input protonated=False, because RDKit has problems with unprotonated benzamidines and you have to always pass them manually protonated in practice.

The above script will work if you generate the sdf file as follows:

from rdkit import Chem 
mol = Chem.MolFromMol2File('ligand.mol2', removeHs=False)
Chem.MolToMolFile(mol, 'ligand.sdf')