Skip to content

Commit 9cae80f

Browse files
committed
Adding test for raw phenix-produced mmCIF file
1 parent 93f9bb8 commit 9cae80f

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

biojava3-structure/src/test/java/org/biojava/bio/structure/io/TestNonDepositedFiles.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22

33
import static org.junit.Assert.*;
44

5+
import java.io.BufferedReader;
56
import java.io.IOException;
67
import java.io.InputStream;
8+
import java.io.InputStreamReader;
79
import java.util.zip.GZIPInputStream;
810

911
import org.biojava.bio.structure.Chain;
1012
import org.biojava.bio.structure.Structure;
1113
import org.biojava.bio.structure.StructureException;
1214
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;
1318
import org.biojava.bio.structure.xtal.CrystalCell;
1419
import org.biojava3.structure.StructureIO;
1520
import org.junit.Test;
@@ -155,5 +160,33 @@ private void checkChains(Structure s) {
155160
System.out.println("num hetatom groups: "+chain.getAtomLigands().size());
156161
}
157162
}
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+
}
158191

159192
}
Binary file not shown.

0 commit comments

Comments
 (0)