Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Renamed the IteratingMDLReader to a IteratingSDFReader, matching the …

…format name
  • Loading branch information...
commit 08a06c0af159ad3322d6a002b2c2c42539059c6f 1 parent 5e81816
@egonw egonw authored
View
8 src/main/org/openscience/cdk/io/iterator/IteratingMDLConformerReader.java
@@ -15,7 +15,7 @@
/**
* Iterate over conformers of a collection of molecules stored in SDF format.
* <p/>
- * This class is analogous to the {@link org.openscience.cdk.io.iterator.IteratingMDLReader} except that
+ * This class is analogous to the {@link org.openscience.cdk.io.iterator.IteratingSDFReader} except that
* rather than return a single {@link org.openscience.cdk.interfaces.IMolecule} at each iteration this
* class will return all the conformers for a given molecule at each iteration.
* <p/>
@@ -50,7 +50,7 @@
*/
@TestClass("org.openscience.cdk.io.iterator.IteratingMDLConformerReaderTest")
public class IteratingMDLConformerReader implements Iterator {
- private IteratingMDLReader imdlr;
+ private IteratingSDFReader imdlr;
private ConformerContainer container;
private IAtomContainer lastMol = null;
@@ -59,13 +59,13 @@
@TestMethod("testSDF")
public IteratingMDLConformerReader(Reader in, IChemObjectBuilder builder) {
- imdlr = new IteratingMDLReader(in, builder);
+ imdlr = new IteratingSDFReader(in, builder);
container = new ConformerContainer();
}
@TestMethod("testSDF")
public IteratingMDLConformerReader(InputStream in, IChemObjectBuilder builder) {
- imdlr = new IteratingMDLReader(in, builder);
+ imdlr = new IteratingSDFReader(in, builder);
container = new ConformerContainer();
}
View
8 ...enscience/cdk/io/iterator/IteratingMDLReader.java → ...enscience/cdk/io/iterator/IteratingSDFReader.java
@@ -81,12 +81,12 @@
* @cdk.keyword file format, MDL molfile
* @cdk.keyword file format, SDF
*/
-public class IteratingMDLReader extends DefaultIteratingChemObjectReader<IAtomContainer>
+public class IteratingSDFReader extends DefaultIteratingChemObjectReader<IAtomContainer>
implements IChemObjectIOListener {
private BufferedReader input;
private static ILoggingTool logger =
- LoggingToolFactory.createLoggingTool(IteratingMDLReader.class);
+ LoggingToolFactory.createLoggingTool(IteratingSDFReader.class);
private String currentLine;
private IChemFormat currentFormat;
private final ReaderFactory factory = new ReaderFactory();
@@ -104,7 +104,7 @@
* @param in The Reader to read from
* @param builder The builder
*/
- public IteratingMDLReader(Reader in, IChemObjectBuilder builder) {
+ public IteratingSDFReader(Reader in, IChemObjectBuilder builder) {
this.builder = builder;
setReader(in);
initIOSettings();
@@ -116,7 +116,7 @@ public IteratingMDLReader(Reader in, IChemObjectBuilder builder) {
* @param in The InputStream to read from
* @param builder The builder
*/
- public IteratingMDLReader(InputStream in, IChemObjectBuilder builder) {
+ public IteratingSDFReader(InputStream in, IChemObjectBuilder builder) {
this(new InputStreamReader(in), builder);
}
View
26 src/main/org/openscience/cdk/modeling/builder3d/TemplateExtractor.java
@@ -42,7 +42,7 @@
import org.openscience.cdk.interfaces.IChemObjectBuilder;
import org.openscience.cdk.interfaces.IRingSet;
import org.openscience.cdk.io.MDLV2000Writer;
-import org.openscience.cdk.io.iterator.IteratingMDLReader;
+import org.openscience.cdk.io.iterator.IteratingSDFReader;
import org.openscience.cdk.isomorphism.matchers.QueryAtomContainerCreator;
import org.openscience.cdk.ringsearch.AllRingsFinder;
import org.openscience.cdk.ringsearch.RingPartitioner;
@@ -69,12 +69,12 @@ public TemplateExtractor() {
}
public void cleanDataSet(String dataFile) {
- IteratingMDLReader imdl = null;
+ IteratingSDFReader imdl = null;
IAtomContainerSet som = builder.newInstance(IAtomContainerSet.class);
try {
System.out.println("Start clean dataset...");
BufferedReader fin = new BufferedReader(new FileReader(dataFile));
- imdl = new IteratingMDLReader(fin, builder);
+ imdl = new IteratingSDFReader(fin, builder);
System.out.print("Read File in..");
} catch (Exception exc) {
System.out.println("Could not read Molecules from file " + dataFile
@@ -106,12 +106,12 @@ public void cleanDataSet(String dataFile) {
}
public void ReadNCISdfFileAsTemplate(String dataFile) {
- IteratingMDLReader imdl = null;
+ IteratingSDFReader imdl = null;
IAtomContainerSet som = builder.newInstance(IAtomContainerSet.class);
try {
System.out.println("Start...");
BufferedReader fin = new BufferedReader(new FileReader(dataFile));
- imdl = new IteratingMDLReader(fin, builder);
+ imdl = new IteratingSDFReader(fin, builder);
System.out.print("Read File in..");
} catch (Exception exc) {
System.out.println("Could not read Molecules from file " + dataFile
@@ -131,13 +131,13 @@ public void ReadNCISdfFileAsTemplate(String dataFile) {
}
public void PartitionRingsFromComplexRing(String dataFile) {
- IteratingMDLReader imdl = null;
+ IteratingSDFReader imdl = null;
IAtomContainerSet som = builder.newInstance(IAtomContainerSet.class);
IAtomContainer m = null;
try {
System.out.println("Start...");
BufferedReader fin = new BufferedReader(new FileReader(dataFile));
- imdl = new IteratingMDLReader(fin, builder);
+ imdl = new IteratingSDFReader(fin, builder);
System.out.print("Read File in..");
} catch (Exception exc) {
System.out.println("Could not read Molecules from file " + dataFile
@@ -169,7 +169,7 @@ public void extractUniqueRingSystemsFromFile(String dataFile) {
IAtomContainer m = null;
// RingPartitioner ringPartitioner=new RingPartitioner();
List<IRingSet> ringSystems = null;
- IteratingMDLReader imdl = null;
+ IteratingSDFReader imdl = null;
HashMap<String,String> hashRingSystems = new HashMap<String,String>();
SmilesGenerator smilesGenerator = new SmilesGenerator();
@@ -196,7 +196,7 @@ public void extractUniqueRingSystemsFromFile(String dataFile) {
try {
System.out.println("Start...");
BufferedReader fin = new BufferedReader(new FileReader(dataFile));
- imdl = new IteratingMDLReader(fin, builder);
+ imdl = new IteratingSDFReader(fin, builder);
System.out.println("Read File in..");
} catch (Exception exc) {
System.out.println("Could not read Molecules from file " + dataFile
@@ -307,14 +307,14 @@ public void makeCanonicalSmileFromRingSystems(String dataFileIn,
String dataFileOut) {
System.out.println("Start make SMILES...");
IAtomContainer m = null;
- IteratingMDLReader imdl = null;
+ IteratingSDFReader imdl = null;
// QueryAtomContainer query=null;
List<String> data = new ArrayList<String>();
SmilesGenerator smiles = new SmilesGenerator();
try {
System.out.println("Start...");
BufferedReader fin = new BufferedReader(new FileReader(dataFileIn));
- imdl = new IteratingMDLReader(fin, builder);
+ imdl = new IteratingSDFReader(fin, builder);
// fin.close();
System.out.println("Read File in..");
} catch (Exception exc) {
@@ -378,13 +378,13 @@ public void makeCanonicalSmileFromRingSystems(String dataFileIn,
HybridizationFingerprinter.DEFAULT_SIZE, HybridizationFingerprinter.DEFAULT_SEARCH_DEPTH
);
IAtomContainer m = null;
- IteratingMDLReader imdl=null;
+ IteratingSDFReader imdl=null;
//QueryAtomContainer query=null;
IAtomContainer query = null;
List<BitSet> data = new ArrayList<BitSet>();
try {
System.out.print("Read data file in ...");
- imdl = new IteratingMDLReader(fin, builder);
+ imdl = new IteratingSDFReader(fin, builder);
// fin.close();
System.out.println("ready");
} catch (Exception exc) {
View
6 src/main/org/openscience/cdk/modeling/builder3d/TemplateHandler3D.java
@@ -45,7 +45,7 @@
import org.openscience.cdk.interfaces.IAtomContainerSet;
import org.openscience.cdk.interfaces.IChemObjectBuilder;
import org.openscience.cdk.interfaces.IRingSet;
-import org.openscience.cdk.io.iterator.IteratingMDLReader;
+import org.openscience.cdk.io.iterator.IteratingSDFReader;
import org.openscience.cdk.isomorphism.UniversalIsomorphismTester;
import org.openscience.cdk.isomorphism.mcss.RMap;
import org.openscience.cdk.silent.SilentChemObjectBuilder;
@@ -98,14 +98,14 @@ public static TemplateHandler3D getInstance() throws CDKException {
*/
private void loadTemplates() throws CDKException{
logger.debug("Loading templates...");
- IteratingMDLReader imdl;
+ IteratingSDFReader imdl;
InputStream ins;
BufferedReader fin;
try {
ins = this.getClass().getClassLoader().getResourceAsStream("org/openscience/cdk/modeling/builder3d/data/ringTemplateStructures.sdf.gz");
fin = new BufferedReader(new InputStreamReader(new GZIPInputStream(ins)));
- imdl = new IteratingMDLReader(fin, builder);
+ imdl = new IteratingSDFReader(fin, builder);
} catch (IOException exc1) {
throw new CDKException("Problems loading file ringTemplateStructures.sdf.gz", exc1);
}
View
26 ...ience/cdk/io/iterator/IteratingMDLReaderTest.java → ...ience/cdk/io/iterator/IteratingSDFReaderTest.java
@@ -53,16 +53,16 @@
* @cdk.module test-io
* @see org.openscience.cdk.io.MDLReader
*/
-public class IteratingMDLReaderTest extends CDKTestCase {
+public class IteratingSDFReaderTest extends CDKTestCase {
private ILoggingTool logger =
- LoggingToolFactory.createLoggingTool(IteratingMDLReaderTest.class);
+ LoggingToolFactory.createLoggingTool(IteratingSDFReaderTest.class);
@Test public void testSDF() throws Exception {
String filename = "data/mdl/test2.sdf";
logger.info("Testing: " + filename);
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
- IteratingMDLReader reader = new IteratingMDLReader(
+ IteratingSDFReader reader = new IteratingSDFReader(
ins, DefaultChemObjectBuilder.getInstance()
);
@@ -90,7 +90,7 @@ public boolean ready() throws IOException {
}
};
- IteratingMDLReader reader = new IteratingMDLReader(
+ IteratingSDFReader reader = new IteratingSDFReader(
streamReader, DefaultChemObjectBuilder.getInstance()
);
@@ -111,7 +111,7 @@ public boolean ready() throws IOException {
String filename = "data/mdl/test.sdf";
logger.info("Testing: " + filename);
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
- IteratingMDLReader reader = new IteratingMDLReader(
+ IteratingSDFReader reader = new IteratingSDFReader(
ins, DefaultChemObjectBuilder.getInstance()
);
@@ -128,7 +128,7 @@ public boolean ready() throws IOException {
String filename = "data/mdl/test.sdf";
logger.info("Testing: " + filename);
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
- IteratingMDLReader reader = new IteratingMDLReader(
+ IteratingSDFReader reader = new IteratingSDFReader(
ins, DefaultChemObjectBuilder.getInstance()
);
@@ -145,7 +145,7 @@ public boolean ready() throws IOException {
@Test public void testMultipleEntryFields() throws Exception {
String filename = "data/mdl/test.sdf";
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
- IteratingMDLReader reader = new IteratingMDLReader(
+ IteratingSDFReader reader = new IteratingSDFReader(
ins, DefaultChemObjectBuilder.getInstance()
);
@@ -159,7 +159,7 @@ public boolean ready() throws IOException {
String filename = "data/mdl/bug682233.mol";
logger.info("Testing: " + filename);
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
- IteratingMDLReader reader = new IteratingMDLReader(
+ IteratingSDFReader reader = new IteratingSDFReader(
ins, DefaultChemObjectBuilder.getInstance()
);
@@ -178,7 +178,7 @@ public boolean ready() throws IOException {
String filename = "data/mdl/singleMol.sdf";
logger.info("Testing: " + filename);
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
- IteratingMDLReader reader = new IteratingMDLReader(
+ IteratingSDFReader reader = new IteratingSDFReader(
ins, DefaultChemObjectBuilder.getInstance()
);
@@ -197,7 +197,7 @@ public boolean ready() throws IOException {
String filename = "data/mdl/emptyStructures.sdf";
logger.info("Testing: " + filename);
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
- IteratingMDLReader reader = new IteratingMDLReader(
+ IteratingSDFReader reader = new IteratingSDFReader(
ins, DefaultChemObjectBuilder.getInstance()
);
int molCount = 0;
@@ -228,7 +228,7 @@ public boolean ready() throws IOException {
Properties prop = new Properties();
prop.setProperty("ForceReadAs3DCoordinates","true");
PropertiesListener listener = new PropertiesListener(prop);
- IteratingMDLReader reader = new IteratingMDLReader(
+ IteratingSDFReader reader = new IteratingSDFReader(
ins, DefaultChemObjectBuilder.getInstance()
);
reader.addChemObjectIOListener(listener);
@@ -249,7 +249,7 @@ public boolean ready() throws IOException {
String filename = "data/mdl/no3dStructures.sdf";
logger.info("Testing: " + filename);
InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
- IteratingMDLReader reader = new IteratingMDLReader(
+ IteratingSDFReader reader = new IteratingSDFReader(
ins, DefaultChemObjectBuilder.getInstance()
);
int molCount = 0;
@@ -269,7 +269,7 @@ public boolean ready() throws IOException {
// Now test forced 3D coordinates
logger.info("Testing: " + filename);
ins = this.getClass().getClassLoader().getResourceAsStream(filename);
- reader = new IteratingMDLReader(
+ reader = new IteratingSDFReader(
ins, DefaultChemObjectBuilder.getInstance()
);
reader.addChemObjectIOListener(new MyListener());
View
4 src/test/org/openscience/cdk/modulesuites/MioTests.java
@@ -62,7 +62,7 @@
import org.openscience.cdk.io.XYZWriterTest;
import org.openscience.cdk.io.cml.CMLIOTests;
import org.openscience.cdk.io.iterator.IteratingMDLConformerReaderTest;
-import org.openscience.cdk.io.iterator.IteratingMDLReaderTest;
+import org.openscience.cdk.io.iterator.IteratingSDFReaderTest;
import org.openscience.cdk.io.iterator.IteratingPCCompoundASNReaderTest;
import org.openscience.cdk.io.iterator.IteratingPCCompoundXMLReaderTest;
import org.openscience.cdk.io.iterator.IteratingPCSubstancesXMLReaderTest;
@@ -114,7 +114,7 @@
ChemObjectIOInstantionTests.class,
// cdk.io.iterator package
- IteratingMDLReaderTest.class,
+ IteratingSDFReaderTest.class,
IteratingMDLConformerReaderTest.class,
IteratingPCCompoundASNReaderTest.class,
IteratingPCCompoundXMLReaderTest.class,
View
12 src/test/org/openscience/cdk/pharmacophore/PharmacophoreMatcherTest.java
@@ -41,7 +41,7 @@
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.io.iterator.IteratingMDLConformerReader;
-import org.openscience.cdk.io.iterator.IteratingMDLReader;
+import org.openscience.cdk.io.iterator.IteratingSDFReader;
/**
* @cdk.module test-pcore
@@ -227,7 +227,7 @@ public void testInvalidQuery() throws CDKException {
public void testCNSPcore() throws FileNotFoundException, CDKException {
String filename = "data/mdl/cnssmarts.sdf";
InputStream ins = PharmacophoreMatcherTest.class.getClassLoader().getResourceAsStream(filename);
- IteratingMDLReader reader = new IteratingMDLReader(ins,
+ IteratingSDFReader reader = new IteratingSDFReader(ins,
DefaultChemObjectBuilder.getInstance()
);
@@ -258,7 +258,7 @@ public void testCNSPcore() throws FileNotFoundException, CDKException {
public void testMatchingBonds() throws FileNotFoundException, CDKException {
String filename = "data/mdl/cnssmarts.sdf";
InputStream ins = PharmacophoreMatcherTest.class.getClassLoader().getResourceAsStream(filename);
- IteratingMDLReader reader = new IteratingMDLReader(ins,
+ IteratingSDFReader reader = new IteratingSDFReader(ins,
DefaultChemObjectBuilder.getInstance());
PharmacophoreQuery query = new PharmacophoreQuery();
@@ -295,7 +295,7 @@ public void testMatchingBonds() throws FileNotFoundException, CDKException {
public void testAngleMatch1() throws Exception {
String filename = "data/mdl/cnssmarts.sdf";
InputStream ins = PharmacophoreMatcherTest.class.getClassLoader().getResourceAsStream(filename);
- IteratingMDLReader reader = new IteratingMDLReader(ins,
+ IteratingSDFReader reader = new IteratingSDFReader(ins,
DefaultChemObjectBuilder.getInstance());
PharmacophoreQuery query = new PharmacophoreQuery();
@@ -321,7 +321,7 @@ public void testAngleMatch1() throws Exception {
public void testAngleMatch2() throws Exception {
String filename = "data/mdl/cnssmarts.sdf";
InputStream ins = PharmacophoreMatcherTest.class.getClassLoader().getResourceAsStream(filename);
- IteratingMDLReader reader = new IteratingMDLReader(ins,
+ IteratingSDFReader reader = new IteratingSDFReader(ins,
DefaultChemObjectBuilder.getInstance());
PharmacophoreQuery query = new PharmacophoreQuery();
@@ -419,7 +419,7 @@ public void multiSmartsQuery() throws IOException, CDKException {
String filename = "data/pcore/multismartpcore.sdf";
InputStream ins = PharmacophoreMatcherTest.class.getClassLoader().getResourceAsStream(filename);
- IteratingMDLReader reader = new IteratingMDLReader(ins,
+ IteratingSDFReader reader = new IteratingSDFReader(ins,
DefaultChemObjectBuilder.getInstance());
IAtomContainer mol = (IAtomContainer) reader.next();
Please sign in to comment.
Something went wrong with that request. Please try again.