Jan,

On Fri, May 9, 2014 at 9:17 PM, Jan Domanski <jan...@gmail.com> 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
------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to