From: Om <omp...@gm...> - 2006-07-13 13:00:57
|
Hi, How do I read sdf file in a indexed way using CDK IteratingMDLReader? Meaning: Suppose I have SDF file of 5 Molecules. I want to compare 2nd Molecule with say 1st, 3rd and 5th Molecule. Some thing like 'ListIterator' of the java.util Is there any way pass to numerical index to next() object of IteratingMDLReader [say like mol_query = (Molecule) myiter.next(int 5)]; Code Snippet of unsuccessful attempt :( ------------------------ sdfile= new BufferedReader (new FileReader(new File("test.sdf"))); IteratingMDLReader myiter = new IteratingMDLReader(sdfile, DefaultChemObjectBuilder.getInstance()); Molecule mol_target = null; Molecule mol_query = null; HydrogenAdder ha = new HydrogenAdder(); Fingerprinter fprinter = new Fingerprinter(length, depth); while (myiter.hasNext()) { mol_target = (Molecule) myiter.next(); ha.addExplicitHydrogensToSatisfyValency(mol_target); fp_target = fprinter.getFingerprint(mol_target); for (index_query=1; myiter.hasNext(); ++index_query) { mol_query = (Molecule) myiter.next(); ha.addExplicitHydrogensToSatisfyValency(mol_query); fp_query = fprinter.getFingerprint(mol_query); // } } ----------------------- Any help would be highly appreciated Thanks Om Prakash Research Student, Bioinformatics Center University of Pune Pune-411007 India |