Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Renamed the IteratingMDLReader to a IteratingSDFReader, matching the …

…format name
  • Loading branch information...
commit 08a06c0af159ad3322d6a002b2c2c42539059c6f 1 parent 5e81816
Egon Willighagen authored February 03, 2012
8  src/main/org/openscience/cdk/io/iterator/IteratingMDLConformerReader.java
@@ -15,7 +15,7 @@
15 15
 /**
16 16
  * Iterate over conformers of a collection of molecules stored in SDF format.
17 17
  * <p/>
18  
- * This class is analogous to the {@link org.openscience.cdk.io.iterator.IteratingMDLReader} except that
  18
+ * This class is analogous to the {@link org.openscience.cdk.io.iterator.IteratingSDFReader} except that
19 19
  * rather than return a single {@link org.openscience.cdk.interfaces.IMolecule} at each iteration this
20 20
  * class will return all the conformers for a given molecule at each iteration.
21 21
  * <p/>
@@ -50,7 +50,7 @@
50 50
  */
51 51
 @TestClass("org.openscience.cdk.io.iterator.IteratingMDLConformerReaderTest")
52 52
 public class IteratingMDLConformerReader implements Iterator {
53  
-    private IteratingMDLReader imdlr;
  53
+    private IteratingSDFReader imdlr;
54 54
     private ConformerContainer container;
55 55
     private IAtomContainer lastMol = null;
56 56
 
@@ -59,13 +59,13 @@
59 59
 
60 60
     @TestMethod("testSDF")
61 61
     public IteratingMDLConformerReader(Reader in, IChemObjectBuilder builder) {
62  
-        imdlr = new IteratingMDLReader(in, builder);
  62
+        imdlr = new IteratingSDFReader(in, builder);
63 63
         container = new ConformerContainer();
64 64
     }
65 65
 
66 66
     @TestMethod("testSDF")
67 67
     public IteratingMDLConformerReader(InputStream in, IChemObjectBuilder builder) {
68  
-        imdlr = new IteratingMDLReader(in, builder);
  68
+        imdlr = new IteratingSDFReader(in, builder);
69 69
         container = new ConformerContainer();
70 70
     }
71 71
 
8  ...enscience/cdk/io/iterator/IteratingMDLReader.java → ...enscience/cdk/io/iterator/IteratingSDFReader.java
@@ -81,12 +81,12 @@
81 81
  * @cdk.keyword    file format, MDL molfile
82 82
  * @cdk.keyword    file format, SDF
83 83
  */
84  
-public class IteratingMDLReader extends DefaultIteratingChemObjectReader<IAtomContainer>
  84
+public class IteratingSDFReader extends DefaultIteratingChemObjectReader<IAtomContainer>
85 85
 implements IChemObjectIOListener {
86 86
 
87 87
     private BufferedReader input;
88 88
     private static ILoggingTool logger =
89  
-        LoggingToolFactory.createLoggingTool(IteratingMDLReader.class);
  89
+        LoggingToolFactory.createLoggingTool(IteratingSDFReader.class);
90 90
     private String currentLine;
91 91
     private IChemFormat currentFormat;
92 92
     private final ReaderFactory factory = new ReaderFactory();
@@ -104,7 +104,7 @@
104 104
      * @param  in  The Reader to read from
105 105
      * @param builder The builder
106 106
      */
107  
-    public IteratingMDLReader(Reader in, IChemObjectBuilder builder) {
  107
+    public IteratingSDFReader(Reader in, IChemObjectBuilder builder) {
108 108
         this.builder = builder;
109 109
     	setReader(in);
110 110
     	initIOSettings();
@@ -116,7 +116,7 @@ public IteratingMDLReader(Reader in, IChemObjectBuilder builder) {
116 116
      * @param  in  The InputStream to read from
117 117
      * @param builder The builder
118 118
      */
119  
-    public IteratingMDLReader(InputStream in, IChemObjectBuilder builder) {
  119
+    public IteratingSDFReader(InputStream in, IChemObjectBuilder builder) {
120 120
         this(new InputStreamReader(in), builder);
121 121
     }
122 122
 
26  src/main/org/openscience/cdk/modeling/builder3d/TemplateExtractor.java
@@ -42,7 +42,7 @@
42 42
 import org.openscience.cdk.interfaces.IChemObjectBuilder;
43 43
 import org.openscience.cdk.interfaces.IRingSet;
44 44
 import org.openscience.cdk.io.MDLV2000Writer;
45  
-import org.openscience.cdk.io.iterator.IteratingMDLReader;
  45
+import org.openscience.cdk.io.iterator.IteratingSDFReader;
46 46
 import org.openscience.cdk.isomorphism.matchers.QueryAtomContainerCreator;
47 47
 import org.openscience.cdk.ringsearch.AllRingsFinder;
48 48
 import org.openscience.cdk.ringsearch.RingPartitioner;
@@ -69,12 +69,12 @@ public TemplateExtractor() {
69 69
 	}
70 70
 
71 71
 	public void cleanDataSet(String dataFile) {
72  
-		IteratingMDLReader imdl = null;
  72
+		IteratingSDFReader imdl = null;
73 73
 		IAtomContainerSet som = builder.newInstance(IAtomContainerSet.class);
74 74
 		try {
75 75
 			System.out.println("Start clean dataset...");
76 76
 			BufferedReader fin = new BufferedReader(new FileReader(dataFile));
77  
-			imdl = new IteratingMDLReader(fin, builder);
  77
+			imdl = new IteratingSDFReader(fin, builder);
78 78
 			System.out.print("Read File in..");
79 79
 		} catch (Exception exc) {
80 80
 			System.out.println("Could not read Molecules from file " + dataFile
@@ -106,12 +106,12 @@ public void cleanDataSet(String dataFile) {
106 106
 	}
107 107
 
108 108
 	public void ReadNCISdfFileAsTemplate(String dataFile) {
109  
-		IteratingMDLReader imdl = null;
  109
+		IteratingSDFReader imdl = null;
110 110
 		IAtomContainerSet som = builder.newInstance(IAtomContainerSet.class);
111 111
 		try {
112 112
 			System.out.println("Start...");
113 113
 			BufferedReader fin = new BufferedReader(new FileReader(dataFile));
114  
-			imdl = new IteratingMDLReader(fin, builder);
  114
+			imdl = new IteratingSDFReader(fin, builder);
115 115
 			System.out.print("Read File in..");
116 116
 		} catch (Exception exc) {
117 117
 			System.out.println("Could not read Molecules from file " + dataFile
@@ -131,13 +131,13 @@ public void ReadNCISdfFileAsTemplate(String dataFile) {
131 131
 	}
132 132
 
133 133
 	public void PartitionRingsFromComplexRing(String dataFile) {
134  
-		IteratingMDLReader imdl = null;
  134
+		IteratingSDFReader imdl = null;
135 135
 		IAtomContainerSet som = builder.newInstance(IAtomContainerSet.class);
136 136
 		IAtomContainer m = null;
137 137
 		try {
138 138
 			System.out.println("Start...");
139 139
 			BufferedReader fin = new BufferedReader(new FileReader(dataFile));
140  
-			imdl = new IteratingMDLReader(fin, builder);
  140
+			imdl = new IteratingSDFReader(fin, builder);
141 141
 			System.out.print("Read File in..");
142 142
 		} catch (Exception exc) {
143 143
 			System.out.println("Could not read Molecules from file " + dataFile
@@ -169,7 +169,7 @@ public void extractUniqueRingSystemsFromFile(String dataFile) {
169 169
 		IAtomContainer m = null;
170 170
 		// RingPartitioner ringPartitioner=new RingPartitioner();
171 171
 		List<IRingSet> ringSystems = null;
172  
-		IteratingMDLReader imdl = null;
  172
+		IteratingSDFReader imdl = null;
173 173
 
174 174
 		HashMap<String,String> hashRingSystems = new HashMap<String,String>();
175 175
 		SmilesGenerator smilesGenerator = new SmilesGenerator();
@@ -196,7 +196,7 @@ public void extractUniqueRingSystemsFromFile(String dataFile) {
196 196
 		try {
197 197
 			System.out.println("Start...");
198 198
 			BufferedReader fin = new BufferedReader(new FileReader(dataFile));
199  
-			imdl = new IteratingMDLReader(fin, builder);
  199
+			imdl = new IteratingSDFReader(fin, builder);
200 200
 			System.out.println("Read File in..");
201 201
 		} catch (Exception exc) {
202 202
 			System.out.println("Could not read Molecules from file " + dataFile
@@ -307,14 +307,14 @@ public void makeCanonicalSmileFromRingSystems(String dataFileIn,
307 307
 			String dataFileOut) {
308 308
 		System.out.println("Start make SMILES...");
309 309
 		IAtomContainer m = null;
310  
-		IteratingMDLReader imdl = null;
  310
+		IteratingSDFReader imdl = null;
311 311
 		// QueryAtomContainer query=null;
312 312
 		List<String> data = new ArrayList<String>();
313 313
 		SmilesGenerator smiles = new SmilesGenerator();
314 314
 		try {
315 315
 			System.out.println("Start...");
316 316
 			BufferedReader fin = new BufferedReader(new FileReader(dataFileIn));
317  
-			imdl = new IteratingMDLReader(fin, builder);
  317
+			imdl = new IteratingSDFReader(fin, builder);
318 318
 			// fin.close();
319 319
 			System.out.println("Read File in..");
320 320
 		} catch (Exception exc) {
@@ -378,13 +378,13 @@ public void makeCanonicalSmileFromRingSystems(String dataFileIn,
378 378
 		    HybridizationFingerprinter.DEFAULT_SIZE, HybridizationFingerprinter.DEFAULT_SEARCH_DEPTH
379 379
 		);
380 380
 		IAtomContainer m = null;
381  
-		IteratingMDLReader imdl=null;
  381
+		IteratingSDFReader imdl=null;
382 382
 		//QueryAtomContainer query=null;
383 383
 		IAtomContainer query = null;
384 384
 		List<BitSet> data = new ArrayList<BitSet>();
385 385
 		try {
386 386
 			System.out.print("Read data file in ...");
387  
-			imdl = new IteratingMDLReader(fin, builder);
  387
+			imdl = new IteratingSDFReader(fin, builder);
388 388
 			// fin.close();
389 389
 			System.out.println("ready");
390 390
 		} catch (Exception exc) {
6  src/main/org/openscience/cdk/modeling/builder3d/TemplateHandler3D.java
@@ -45,7 +45,7 @@
45 45
 import org.openscience.cdk.interfaces.IAtomContainerSet;
46 46
 import org.openscience.cdk.interfaces.IChemObjectBuilder;
47 47
 import org.openscience.cdk.interfaces.IRingSet;
48  
-import org.openscience.cdk.io.iterator.IteratingMDLReader;
  48
+import org.openscience.cdk.io.iterator.IteratingSDFReader;
49 49
 import org.openscience.cdk.isomorphism.UniversalIsomorphismTester;
50 50
 import org.openscience.cdk.isomorphism.mcss.RMap;
51 51
 import org.openscience.cdk.silent.SilentChemObjectBuilder;
@@ -98,14 +98,14 @@ public static TemplateHandler3D getInstance() throws CDKException {
98 98
      */
99 99
     private void loadTemplates() throws CDKException{
100 100
         logger.debug("Loading templates...");
101  
-        IteratingMDLReader imdl;
  101
+        IteratingSDFReader imdl;
102 102
         InputStream ins;
103 103
         BufferedReader fin;
104 104
 
105 105
         try {
106 106
             ins = this.getClass().getClassLoader().getResourceAsStream("org/openscience/cdk/modeling/builder3d/data/ringTemplateStructures.sdf.gz");
107 107
             fin = new BufferedReader(new InputStreamReader(new GZIPInputStream(ins)));
108  
-            imdl = new IteratingMDLReader(fin, builder);
  108
+            imdl = new IteratingSDFReader(fin, builder);
109 109
         } catch (IOException exc1) {
110 110
             throw new CDKException("Problems loading file ringTemplateStructures.sdf.gz", exc1);
111 111
         }
26  ...ience/cdk/io/iterator/IteratingMDLReaderTest.java → ...ience/cdk/io/iterator/IteratingSDFReaderTest.java
@@ -53,16 +53,16 @@
53 53
  * @cdk.module test-io
54 54
  * @see org.openscience.cdk.io.MDLReader
55 55
  */
56  
-public class IteratingMDLReaderTest extends CDKTestCase {
  56
+public class IteratingSDFReaderTest extends CDKTestCase {
57 57
 
58 58
     private ILoggingTool logger =
59  
-        LoggingToolFactory.createLoggingTool(IteratingMDLReaderTest.class);
  59
+        LoggingToolFactory.createLoggingTool(IteratingSDFReaderTest.class);
60 60
 
61 61
     @Test public void testSDF() throws Exception {
62 62
         String filename = "data/mdl/test2.sdf";
63 63
         logger.info("Testing: " + filename);
64 64
         InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
65  
-        IteratingMDLReader reader = new IteratingMDLReader(
  65
+        IteratingSDFReader reader = new IteratingSDFReader(
66 66
             ins, DefaultChemObjectBuilder.getInstance()
67 67
         );
68 68
 
@@ -90,7 +90,7 @@ public boolean ready() throws IOException {
90 90
 		}
91 91
 	};
92 92
 
93  
-	IteratingMDLReader reader = new IteratingMDLReader(
  93
+	IteratingSDFReader reader = new IteratingSDFReader(
94 94
             streamReader, DefaultChemObjectBuilder.getInstance()
95 95
         );
96 96
 
@@ -111,7 +111,7 @@ public boolean ready() throws IOException {
111 111
         String filename = "data/mdl/test.sdf";
112 112
         logger.info("Testing: " + filename);
113 113
         InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
114  
-        IteratingMDLReader reader = new IteratingMDLReader(
  114
+        IteratingSDFReader reader = new IteratingSDFReader(
115 115
             ins, DefaultChemObjectBuilder.getInstance()
116 116
         );
117 117
 
@@ -128,7 +128,7 @@ public boolean ready() throws IOException {
128 128
         String filename = "data/mdl/test.sdf";
129 129
         logger.info("Testing: " + filename);
130 130
         InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
131  
-        IteratingMDLReader reader = new IteratingMDLReader(
  131
+        IteratingSDFReader reader = new IteratingSDFReader(
132 132
             ins, DefaultChemObjectBuilder.getInstance()
133 133
         );
134 134
 
@@ -145,7 +145,7 @@ public boolean ready() throws IOException {
145 145
     @Test public void testMultipleEntryFields() throws Exception {
146 146
         String filename = "data/mdl/test.sdf";
147 147
         InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
148  
-        IteratingMDLReader reader = new IteratingMDLReader(
  148
+        IteratingSDFReader reader = new IteratingSDFReader(
149 149
             ins, DefaultChemObjectBuilder.getInstance()
150 150
         );
151 151
 
@@ -159,7 +159,7 @@ public boolean ready() throws IOException {
159 159
         String filename = "data/mdl/bug682233.mol";
160 160
         logger.info("Testing: " + filename);
161 161
         InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
162  
-        IteratingMDLReader reader = new IteratingMDLReader(
  162
+        IteratingSDFReader reader = new IteratingSDFReader(
163 163
             ins, DefaultChemObjectBuilder.getInstance()
164 164
         );
165 165
 
@@ -178,7 +178,7 @@ public boolean ready() throws IOException {
178 178
         String filename = "data/mdl/singleMol.sdf";
179 179
         logger.info("Testing: " + filename);
180 180
         InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
181  
-        IteratingMDLReader reader = new IteratingMDLReader(
  181
+        IteratingSDFReader reader = new IteratingSDFReader(
182 182
             ins, DefaultChemObjectBuilder.getInstance()
183 183
         );
184 184
 
@@ -197,7 +197,7 @@ public boolean ready() throws IOException {
197 197
         String filename = "data/mdl/emptyStructures.sdf";
198 198
         logger.info("Testing: " + filename);
199 199
         InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
200  
-        IteratingMDLReader reader = new IteratingMDLReader(
  200
+        IteratingSDFReader reader = new IteratingSDFReader(
201 201
             ins, DefaultChemObjectBuilder.getInstance()
202 202
         );
203 203
         int molCount = 0;
@@ -228,7 +228,7 @@ public boolean ready() throws IOException {
228 228
         Properties prop = new Properties();
229 229
         prop.setProperty("ForceReadAs3DCoordinates","true");
230 230
         PropertiesListener listener = new PropertiesListener(prop);
231  
-        IteratingMDLReader reader = new IteratingMDLReader(
  231
+        IteratingSDFReader reader = new IteratingSDFReader(
232 232
             ins, DefaultChemObjectBuilder.getInstance()
233 233
         );
234 234
         reader.addChemObjectIOListener(listener);
@@ -249,7 +249,7 @@ public boolean ready() throws IOException {
249 249
         String filename = "data/mdl/no3dStructures.sdf";
250 250
         logger.info("Testing: " + filename);
251 251
         InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
252  
-        IteratingMDLReader reader = new IteratingMDLReader(
  252
+        IteratingSDFReader reader = new IteratingSDFReader(
253 253
             ins, DefaultChemObjectBuilder.getInstance()
254 254
         );
255 255
         int molCount = 0;
@@ -269,7 +269,7 @@ public boolean ready() throws IOException {
269 269
     	// Now test forced 3D coordinates
270 270
         logger.info("Testing: " + filename);
271 271
         ins = this.getClass().getClassLoader().getResourceAsStream(filename);
272  
-        reader = new IteratingMDLReader(
  272
+        reader = new IteratingSDFReader(
273 273
             ins, DefaultChemObjectBuilder.getInstance()
274 274
         );
275 275
         reader.addChemObjectIOListener(new MyListener());
4  src/test/org/openscience/cdk/modulesuites/MioTests.java
@@ -62,7 +62,7 @@
62 62
 import org.openscience.cdk.io.XYZWriterTest;
63 63
 import org.openscience.cdk.io.cml.CMLIOTests;
64 64
 import org.openscience.cdk.io.iterator.IteratingMDLConformerReaderTest;
65  
-import org.openscience.cdk.io.iterator.IteratingMDLReaderTest;
  65
+import org.openscience.cdk.io.iterator.IteratingSDFReaderTest;
66 66
 import org.openscience.cdk.io.iterator.IteratingPCCompoundASNReaderTest;
67 67
 import org.openscience.cdk.io.iterator.IteratingPCCompoundXMLReaderTest;
68 68
 import org.openscience.cdk.io.iterator.IteratingPCSubstancesXMLReaderTest;
@@ -114,7 +114,7 @@
114 114
     ChemObjectIOInstantionTests.class,
115 115
 
116 116
         // cdk.io.iterator package
117  
-    IteratingMDLReaderTest.class,
  117
+    IteratingSDFReaderTest.class,
118 118
     IteratingMDLConformerReaderTest.class,
119 119
     IteratingPCCompoundASNReaderTest.class,
120 120
     IteratingPCCompoundXMLReaderTest.class,
12  src/test/org/openscience/cdk/pharmacophore/PharmacophoreMatcherTest.java
@@ -41,7 +41,7 @@
41 41
 import org.openscience.cdk.interfaces.IAtomContainer;
42 42
 import org.openscience.cdk.interfaces.IBond;
43 43
 import org.openscience.cdk.io.iterator.IteratingMDLConformerReader;
44  
-import org.openscience.cdk.io.iterator.IteratingMDLReader;
  44
+import org.openscience.cdk.io.iterator.IteratingSDFReader;
45 45
 
46 46
 /**
47 47
  * @cdk.module test-pcore
@@ -227,7 +227,7 @@ public void testInvalidQuery() throws CDKException {
227 227
     public void testCNSPcore() throws FileNotFoundException, CDKException {
228 228
         String filename = "data/mdl/cnssmarts.sdf";
229 229
         InputStream ins = PharmacophoreMatcherTest.class.getClassLoader().getResourceAsStream(filename);
230  
-        IteratingMDLReader reader = new IteratingMDLReader(ins,
  230
+        IteratingSDFReader reader = new IteratingSDFReader(ins,
231 231
             DefaultChemObjectBuilder.getInstance()
232 232
         );
233 233
 
@@ -258,7 +258,7 @@ public void testCNSPcore() throws FileNotFoundException, CDKException {
258 258
     public void testMatchingBonds() throws FileNotFoundException, CDKException {
259 259
         String filename = "data/mdl/cnssmarts.sdf";
260 260
         InputStream ins = PharmacophoreMatcherTest.class.getClassLoader().getResourceAsStream(filename);
261  
-        IteratingMDLReader reader = new IteratingMDLReader(ins,
  261
+        IteratingSDFReader reader = new IteratingSDFReader(ins,
262 262
             DefaultChemObjectBuilder.getInstance());
263 263
 
264 264
         PharmacophoreQuery query = new PharmacophoreQuery();
@@ -295,7 +295,7 @@ public void testMatchingBonds() throws FileNotFoundException, CDKException {
295 295
     public void testAngleMatch1() throws Exception {
296 296
         String filename = "data/mdl/cnssmarts.sdf";
297 297
         InputStream ins = PharmacophoreMatcherTest.class.getClassLoader().getResourceAsStream(filename);
298  
-        IteratingMDLReader reader = new IteratingMDLReader(ins,
  298
+        IteratingSDFReader reader = new IteratingSDFReader(ins,
299 299
             DefaultChemObjectBuilder.getInstance());
300 300
 
301 301
         PharmacophoreQuery query = new PharmacophoreQuery();
@@ -321,7 +321,7 @@ public void testAngleMatch1() throws Exception {
321 321
     public void testAngleMatch2() throws Exception {
322 322
         String filename = "data/mdl/cnssmarts.sdf";
323 323
         InputStream ins = PharmacophoreMatcherTest.class.getClassLoader().getResourceAsStream(filename);
324  
-        IteratingMDLReader reader = new IteratingMDLReader(ins,
  324
+        IteratingSDFReader reader = new IteratingSDFReader(ins,
325 325
             DefaultChemObjectBuilder.getInstance());
326 326
 
327 327
         PharmacophoreQuery query = new PharmacophoreQuery();
@@ -419,7 +419,7 @@ public void multiSmartsQuery() throws IOException, CDKException {
419 419
 
420 420
         String filename = "data/pcore/multismartpcore.sdf";
421 421
         InputStream ins = PharmacophoreMatcherTest.class.getClassLoader().getResourceAsStream(filename);
422  
-        IteratingMDLReader reader = new IteratingMDLReader(ins,
  422
+        IteratingSDFReader reader = new IteratingSDFReader(ins,
423 423
             DefaultChemObjectBuilder.getInstance());
424 424
 
425 425
         IAtomContainer mol = (IAtomContainer) reader.next();

0 notes on commit 08a06c0

Please sign in to comment.
Something went wrong with that request. Please try again.