On Thu, Apr 17, 2014 at 10:32 AM, JP <[email protected]> wrote:
>
> On 16 April 2014 19:13, Christos Kannas <[email protected]> wrote:
>
>> Chem.PathToSubmol(mol, path)
>
>
> Hi there Christos,
>
> Many thanks for your reply (and idea of using nbviewer)
>
> There is still something strange happening which I cannot figure out - my
> atom index is a tuple with six elements - and in the resulting "submol" I
> get seven atoms. Also the ring is opened in a chain (so some of the
> properties are changing).
>
> A simple example here:
> http://nbviewer.ipython.org/gist/anonymous/10964449
>
> Any ideas?
>
PathToSubmol is underdocumented. It's expecting a list/tuple of bond
indices; not atom indices.
What you need to do is loop over the atoms in your match and find all the
bonds that they are involved in that go to other atoms in the match. Pass
that tuple/list to PathToSubmol and you should get what you want.
If you're ok having dummies marking attachment points (which I suspect you
aren't), you could use Chem.ReplaceSidechains(), but otherwise I don't
think there's an easier way to do this.
-greg
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss