org.openscience.cdk.io.iterator
Class IteratingMDLConformerReader

java.lang.Object
  extended by org.openscience.cdk.io.iterator.IteratingMDLConformerReader
All Implemented Interfaces:
Iterator

@TestClass(value="org.openscience.cdk.io.iterator.IteratingMDLConformerReaderTest")
public class IteratingMDLConformerReader
extends Object
implements Iterator

Iterate over conformers of a collection of molecules stored in SDF format.

This class is analogous to the IteratingMDLReader except that rather than return a single IMolecule at each iteration this class will return all the conformers for a given molecule at each iteration.

The class assumes that the molecules are stored in SDF format and that all conformers for a given molecule are in sequential order.

Currently, the code uses the title of each molecule in the SD file to perform te conformer check and so it is important that all conformers for a given molecule have the same title field, but different from the title fields of conformers of other molecules. In the future the class will allow the user to perform the check using either the title or a more rigorous (but more time-consuming) graph isomorphism check.

Example usage is

 String filename = "/Users/rguha/conf2.sdf";
 IteratingMDLConformerReader2 reader = new IteratingMDLConformerReader2(
         new FileReader(new File(filename)), NewDefaultChemObjectBuilder.getInstance());
 while (reader.hasNext()) {
      ConformerContainer2 cc = (ConformerContainer2) reader.next();
 }
 

// do something with this set of conformers

Author:
Rajarshi Guha
See Also:
ConformerContainer
Keywords:
file format SDF, conformer conformation
Belongs to CDK module:
extra
Source code:
HEAD

Constructor Summary
IteratingMDLConformerReader(InputStream in, IChemObjectBuilder builder)
           
IteratingMDLConformerReader(Reader in, IChemObjectBuilder builder)
           
 
Method Summary
 boolean hasNext()
           
 Object next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IteratingMDLConformerReader

@TestMethod(value="testSDF")
public IteratingMDLConformerReader(Reader in,
                                                   IChemObjectBuilder builder)

IteratingMDLConformerReader

@TestMethod(value="testSDF")
public IteratingMDLConformerReader(InputStream in,
                                                   IChemObjectBuilder builder)
Method Detail

hasNext

@TestMethod(value="testSDF")
public boolean hasNext()
Specified by:
hasNext in interface Iterator

next

@TestMethod(value="testSDF")
public Object next()
Specified by:
next in interface Iterator

remove

@TestMethod(value="testRemove")
public void remove()
Specified by:
remove in interface Iterator