import pybel

f = file( 'structures.200.txt', 'r')
mol1 = pybel.readstring( "smi", f.readline().strip().split("\t")[2])
fp1 = mol1.calcfp()
f.seek( 0)
for i, line in enumerate( f):
  sm = line.split("\t")[2]
  mol = pybel.readstring( "smi", sm)
  fp = mol.calcfp()
  tanimoto = fp | fp1 # the | operator is overloaded to compute Tanimoto coefficient
  print "%.2f  %03d  %s" % (tanimoto, i, sm)
  if i > 20:
    break
f.close()
