Hi all,

I think you could use something like that for sfp's:

In [24]: m = Chem.MolFromSmiles('c1ccccc1')

In [25]: fp = AllChem.GetMorganFingerprint(m,2)

In [26]: cur.execute("select morgan_fp('c1ccccc1')")

In [27]: row = cur.fetchone()

In [28]: row[0]
Out[28]: 
'\\x0100000004000000ffffffff030000004034df05060000008511bda406000000515fd9bf06000000'

In [29]: import binascii

In [30]: bin_fp = binascii.unhexlify(row[0][2:]) # remove leading \\x from 
string

In [31]: from rdkit import DataStructs

In [32]: nfp = DataStructs.UIntSparseIntVect(bin_fp)

In [33]: nfp == fp
Out[33]: True


The problem is that you have to know which kind of fingerprint you're 
retrieving from the database in order to use the correct DataStructs type (In 
[32]).
For example, morgan fp uses UIntSparseIntVect while the atom pair fp uses 
IntSparseIntVect.

/ Daniel
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to