from org.openscience.cdk import * from org.openscience.cdk.qsar.descriptors.molecular import BCUTDescriptor from org.openscience.cdk.io.iterator import IteratingMDLReader from java.io import InputStreamReader import sys try: sdfile=open(sys.argv[1],"r") except (IOError,IndexError): print "You need to give the name of an existing .sd file" sys.exit(1) bcut=BCUTDescriptor() bcut.setParameters([1,1]) for mol in IteratingMDLReader( InputStreamReader(sdfile)): BCUTvalue=bcut.calculate(mol).getValue() # Create list of values in BCUTvalue BCUTlist=[str(BCUTvalue.get(i)) for i in range(6)] # Concatenate BCUTlist around tabs print "\t".join(BCUTlist)