import org.openscience.cdk.*; import org.openscience.cdk.qsar.*; import org.openscience.cdk.io.iterator. IteratingMDLReader; import org.openscience.cdk.exception. CDKException; import org.openscience.cdk.qsar.result.*; import java.io.*; class calculateBCUT { public static void main(String[] args) throws CDKException { FileReader sdfile=null; try { sdfile=new FileReader(new File(args[0])); } catch (FileNotFoundException e) { System.err.println("File not found: " + args[0]); System.exit(1); } catch (ArrayIndexOutOfBoundsException e) { System.err.println("You need to give" + "the name of an .sd file"); System.exit(1); } Descriptor bcut=new BCUTDescriptor(); bcut.setParameters(new Object[] {1,1}); IteratingMDLReader myiter=new IteratingMDLReader(sdfile); Molecule mol=null; while (myiter.hasNext()) { mol=(Molecule)myiter.next(); DoubleArrayResult BCUTvalue= (DoubleArrayResult) bcut.calculate(mol) .getValue(); System.out.print(BCUTvalue.get(0)); for (int i=1; i<6; i++) { System.out.print("\t"+BCUTvalue.get(i)); } System.out.print("\n"); } } }