0

I want to get fingerprints using smiles of compounds. I did but the problem is I want to get in a higher bit and a list format so I can calculate the length of lists. In this case I just get classes. Any solution in python using pybel? I did this but when I write len(fps[0]) I get an error

import pybel
smiles = ['CCCC', 'CCCN']
mols = [pybel.readstring("smi", x) for x in smiles]
fps = [x.calcfp() for x in mols]
print fps[0]
4

1 回答 1

0

您可以将函数fp用于指纹对象。默认计算FP2指纹,长度为32。有code,输出长度和bit-0

import pybel
smiles = ['CCCC', 'CCCN']
mols = [pybel.readstring("smi", x) for x in smiles]
fps = [x.calcfp() for x in mols]
print len(fps[0].fp)
print fps[0].fp[0]

结果:

32 
0
于 2015-09-08T14:12:01.060 回答