Dear RDKit community,

I am trying to explain the Explaining bits from Morgan Fingerprints as
described in the RDKit getting started guide here (
http://www.rdkit.org/docs/GettingStartedInPython.html#explaining-bits-from-morgan-fingerprints
).

I want to get the SMILES for each bit from morgan FP of this molecule.

[image: image.png]
I run this python snippet

*m = Chem.MolFromSmiles('OC(=O)C1=CC(O)=C(O)C(O)=C1')*
*info = {}*
*atoms=set()*
*for key in Chem.GetMorganFingerprint(m,radius,
bitInfo=info).GetNonzeroElements():*
*    print (key)*
*    print('fp bit: ', info[key], ' and length is: ', len(info[key]))*
*    env =
Chem.FindAtomEnvironmentOfRadiusN(m,info[key][0][1],info[key][0][0])*
*    print('Will use the atom: ', info[key][0][0], ' and radius; ',
info[key][0][1])*
*    display(Draw.DrawMorganBit(m, key, info, useSVG=True))*
*    for bidx in env:*
*        atoms.add(m.GetBondWithIdx(bidx).GetBeginAtomIdx())*
*        atoms.add(m.GetBondWithIdx(bidx).GetEndAtomIdx())*
*    print('atom To Use: ', list(atoms), 'and rooted at atom: ',
info[key][0][0])*
    *smiles =
Chem.MolFragmentToSmiles(m,atomsToUse=list(atoms),bondsToUse=env)*
*    print('Smiles is: ',smiles)*

for certain morgan bits such as 994485099 I get the smiles as
*c.c.c.O.O.O.ccc*. Which looks a bit weird as it has many non connected
fragments. Please see a screen capture below. Although the DrawMorganBits
produces the correct image.

[image: image.png]

Any suggestions where I might be making mistakes?

Thanks in Advance.

Bilal
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to