|
2 | 2 |
|
3 | 3 | import static org.junit.Assert.*; |
4 | 4 |
|
| 5 | +import java.io.BufferedReader; |
5 | 6 | import java.io.IOException; |
6 | 7 | import java.io.InputStream; |
| 8 | +import java.io.InputStreamReader; |
7 | 9 | import java.util.zip.GZIPInputStream; |
8 | 10 |
|
9 | 11 | import org.biojava.bio.structure.Chain; |
10 | 12 | import org.biojava.bio.structure.Structure; |
11 | 13 | import org.biojava.bio.structure.StructureException; |
12 | 14 | import org.biojava.bio.structure.align.util.AtomCache; |
| 15 | +import org.biojava.bio.structure.io.mmcif.MMcifParser; |
| 16 | +import org.biojava.bio.structure.io.mmcif.SimpleMMcifConsumer; |
| 17 | +import org.biojava.bio.structure.io.mmcif.SimpleMMcifParser; |
13 | 18 | import org.biojava.bio.structure.xtal.CrystalCell; |
14 | 19 | import org.biojava3.structure.StructureIO; |
15 | 20 | import org.junit.Test; |
@@ -155,5 +160,33 @@ private void checkChains(Structure s) { |
155 | 160 | System.out.println("num hetatom groups: "+chain.getAtomLigands().size()); |
156 | 161 | } |
157 | 162 | } |
| 163 | + |
| 164 | + /** |
| 165 | + * A test for reading a phenix-produced (ver 1.9_1692) mmCIF file. |
| 166 | + * This is the file submitted to the PDB for deposition of entry 4lup |
| 167 | + * @throws IOException |
| 168 | + */ |
| 169 | + //@Test |
| 170 | + public void testPhenixFile() throws IOException { |
| 171 | + InputStream inStream = new GZIPInputStream(this.getClass().getResourceAsStream("/org/biojava/bio/structure/io/4lup_phenix_output.cif.gz")); |
| 172 | + MMcifParser parser = new SimpleMMcifParser(); |
| 173 | + |
| 174 | + SimpleMMcifConsumer consumer = new SimpleMMcifConsumer(); |
| 175 | + |
| 176 | + FileParsingParameters fileParsingParams = new FileParsingParameters(); |
| 177 | + fileParsingParams.setAlignSeqRes(true); |
| 178 | + |
| 179 | + consumer.setFileParsingParameters(fileParsingParams); |
| 180 | + |
| 181 | + parser.addMMcifConsumer(consumer); |
| 182 | + |
| 183 | + parser.parse(new BufferedReader(new InputStreamReader(inStream))); |
| 184 | + |
| 185 | + Structure s = consumer.getStructure(); |
| 186 | + |
| 187 | + assertNotNull(s); |
| 188 | + |
| 189 | + assertTrue(s.isCrystallographic()); |
| 190 | + } |
158 | 191 |
|
159 | 192 | } |
0 commit comments