Re: [Rdkit-discuss] autodock vina pdbqt file to mol2
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Greg L. <gre...@gm...> - 2014-05-10 04:05:20
|
Jan,
On Fri, May 9, 2014 at 9:17 PM, Jan Domanski <ja...@gm...> wrote:
>
> Finally, I save a mol2 file out (attached) ordered as the original
> crystal_ligand and with polar hydrogens (for each pose of a conformer).
>
> Let's go to rdkit and try to add hydrogens:
>
> mol = Chem.MolFromMol2File(output, removeHs=False)
> mol2 = AllChem.AddHs(mol, addCoords=True)
> print mol.GetNumAtoms(), mol2.GetNumAtoms()
> 44 44
>
> So, only the implicit hydorgens are present. Calling AddHs doesn't raise
> an error and it doesn't really change the number of hydrogens...
>
The mol2 parser assumes that all Hs are present, so it sets a flag on every
atom saying that it has no implicit Hs.
You can manually undo this:
In [23]: m =
Chem.MolFromMol2File('Downloads/conformer_132_out_1.mol2',sanitize=False)
In [24]: for atom in m.GetAtoms(): atom.SetNoImplicit(False)
In [25]: m.UpdatePropertyCache()
In [26]: mh = Chem.AddHs(m,addCoords=True)
In [27]: print mh.GetNumAtoms()
69
I skipped sanitization entirely when I read the molecule in. This is to
prevent the assignment of radicals.
Note that the mol2 parser is really only even remotely tested with output
from Corina; if you end up with alternate atom types, you should anticipate
further problems.
-greg
|