Hi Richard,

On Fri, Jul 22, 2016 at 10:12 AM, Richard Hall <[email protected]>
wrote:

>
>
> I have a question regarding rdmolops.FindAllPathsOfLengthN – if I use a
> pyrazole as input,
>
>
>
> m1 = Chem.MolFromSmiles('[nH]1cccn1')
>
>
>
> and then try to get all paths of length 5
>
>
>
> for p in rdmolops.FindAllPathsOfLengthN(m1, 5):
>
>                 print [i for i in p]
>
>
>
> I only get back one path
>
>
>
> [0, 1, 2, 3, 4]
>
>
>
> I would have expected that you would also get
>
>
>
> [1,2,3,4,0]
>
> [2,3,4,0,1]
>
> [3,4,0,1,2]
>
> [4,0,1,2,3]
>
>
>
> have I misunderstood what this method does – or is this an ‘unwanted
> feature’?
>
>
The algorithm uniquifies the paths that it returns. Since those all contain
the same bonds (those are bond indices), it doesn't return them.

If you want to see all the atom paths, you can pass the "useBonds=False"
argument:

m1 = Chem.MolFromSmiles('[nH]1cccn1')
for p in Chem.FindAllPathsOfLengthN(m1, 5,useBonds=False):
    print(list(p))


outputs:

[0, 1, 2, 3, 4]

[0, 4, 3, 2, 1]

[1, 0, 4, 3, 2]

[2, 1, 0, 4, 3]

[3, 2, 1, 0, 4]


This inconsistency seems odd to me, but I'm going to have to think about it
a bit to be sure that it's a bug (that code is pretty old and I haven't
looked at it in a while).


>
> ps Greg – this is a compound from the Gobbi Atom-Atom-Path similarity
> paper ;)
>

Excellent! :-)

-greg
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to