how to convert fingerprint into a 01 string

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to convert fingerprint into a 01 string

Bing Xiong
Dear all:
 I want to calculate the fingerprint of a mol using the default FP2 algorithm and output it as a string contains only 0 (means not set) or 1 (means set on). through cehck the c++ source code, I get lost in those functions. And could not find a function to convert folded fingerprint to such  01 string. could you tell me how to do it in python script?  Thanks in advance!
 
 
Bing
 
 
2010-06-01

bxiong

------------------------------------------------------------------------------


_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: how to convert fingerprint into a 01 string

Noel O'Boyle
Administrator
Hi Bing,

import pybel
mol = pybel.readstring("smi", "CC(=O)Cl")
print mol.calcfp("FP2").bits
# [18, 220, 329, 330, 624, 671]

So 6 bits are set. Bit number 18, 220, etc. Hopefully you can figure
out the rest. Look at the Pybel code if you're interested on how this
was done.

- Noel

On 1 June 2010 13:25, bxiong <[hidden email]> wrote:

> Dear all:
>  I want to calculate the fingerprint of a mol using the default FP2
> algorithm and output it as a string contains only 0 (means not set) or 1
> (means set on). through cehck the c++ source code, I get lost in those
> functions. And could not find a function to convert folded fingerprint to
> such  01 string. could you tell me how to do it in python script?  Thanks in
> advance!
>
>
> Bing
>
>
> 2010-06-01
> ________________________________
> bxiong
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> OpenBabel-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>

------------------------------------------------------------------------------

_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: how to convert fingerprint into a 01 string

Chris Morley-3
In reply to this post by Bing Xiong
On 01/06/2010 13:25, bxiong wrote:
> Dear all:
> I want to calculate the fingerprint of a mol using the default FP2
> algorithm and output it as a string contains only 0 (means not set) or 1
> (means set on). through cehck the c++ source code, I get lost in those
> functions. And could not find a function to convert folded fingerprint
> to such 01 string. could you tell me how to do it in python script?

The fpt output format can output in this form (plus some other data).
In the development code (but not in v2.2.3) there is an option you can
set to suppress this extra data.

Chris

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss