Well, that was easy enough to find.

By default, AllChem.GetBestRMS does a substructure mapping between the
reference and probe molecules so that it can try all symmetry-equivalent
mappings to get the best RMS value. In order to avoid the combinatorial
explosion that can happen in molecules with multiple CH2 and CH3 groups, it
copies the probe molecule and then removes Hs from it. The code that does
this is dumb and it screws up the alignment when the Hs are not the highest
numbered atoms in the molecule.

Upon further thought, the code really shouldn't be doing that RemoveHs in
the first place, so I'm going to remove it.

Here's the bug report: https://github.com/rdkit/rdkit/issues/112
It will be fixed in the upcoming release.

In the meantime, you can work around it like this:
In [32]: matches = m0.GetSubstructMatches(m1,uniquify=False)

In [34]: maps = [list(enumerate(match)) for match in matches]

In [35]: AllChem.GetBestRMS(m0,m1,maps=maps)
Out[35]: 0.45567294702631311


Thanks for reporting the problem in such detail!
-greg



On Mon, Sep 30, 2013 at 6:01 AM, S.L. Chan <[email protected]> wrote:

> Good evening,
>
> I am trying to superimpose a pair of conformers of the same molecule
> (files attached) using GetBestRMS. It does not seem to work if I keep
> the hydrogens.
>
> m0 = Chem.MolFromMolFile('tgt.mol',removeHs=False)
> m1 = Chem.MolFromMolFile('qry.mol',removeHs=False)
> print AllChem.GetBestRMS(m0,m1)
> f = open('WithH.mol','w')
> f.write(Chem.MolToMolBlock(m1))
> f.close()
>
> However, if I don't use the "removeHs=False" option, it works fine.
> Any idea?
>
> Ling
>
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
> from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
> _______________________________________________
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to