On 05/03/2016 12:07 AM, Leonardo Lazzaro wrote: > On 2016-05-02 11:46, Francois Berenger wrote: >> Hello, >> >> Using open babel, would it be possible to extract >> a MACCS fingerprints as a string of 0s and 1s ? >> >> Thanks, >> F. >> >> ------------------------------------------------------------------------------ >> >> Find and fix application performance issues faster with Applications >> Manager >> Applications Manager provides deep performance insights into multiple >> tiers of >> your business applications. It resolves application problems quickly and >> reduces your MTTR. Get your free trial! >> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z >> _______________________________________________ >> OpenBabel-discuss mailing list >> OpenBabel-discuss@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss > > Hello, > > how are you using open babel?
From the command line usually. > with python is pretty easy to do it, here is an example: Thanks a lot for the example! I will test it and probably adapt it to my needs. > def fpt_to_binary(mol): > # mol is an open babel molecule object > fps=mol.calcfp(fptype='MACCS').bits > temp=list('0' * 166) > for item in fps: > temp[item - 1]='1' > > bitstring=''.join(reversed(temp)) > > return int(bitstring, 2) > -- Regards, Francois. "When in doubt, use more types" ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss