Noel O'Boyle wrote
>
>>From Python, it goes something like this...
>
>>>> import openbabel as ob
>>>> conv = ob.OBConversion()
>>>> mol = ob.OBMol()
>>>> conv.SetInFormat("smi")
> True
>>>> conv.ReadString(mol, "CC(=O)Cl")
> True
>>>> fingerprinter = ob.OBFingerprint.FindFingerprint("FP2")
>>>> print fingerprinter
> <openbabel.OBFingerprint; proxy of <Swig Object of type
> 'OpenBabel::OBFingerprin
> t *' at 0x0039F368> >
>>>> fp = ob.vectorUnsignedInt()
>>>> fingerprinter.GetFingerprint(mol, fp)
> True
>>>> print [x for x in fp]
> [131072, 0, 0, 0, 0, 0, 134217728, 0, 0, 0, 768, 0, 0, 0, 0, 0, 0, 0, 0,
> 32768,
> 1073741824, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
>>>> print ob.OBFingerprint.Tanimoto(fp, fp)
> 1.0
>>>>
>
> Hope this helps,
> Noel
>
Thank you very much Noel!
It solved my problem perfectly!
Alvin
--
View this message in context:
http://forums.openbabel.org/Java-implementation-of-pybel-s-calcfp-to-convert-smiles-into-fingerprint-tp4285497p4286096.html
Sent from the General discussion mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
OpenBabel-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss