File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
biojava-structure/src/test/java/org/biojava/nbio/structure/io Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 2323import static org .junit .Assert .*;
2424
2525import java .io .BufferedReader ;
26+ import java .io .ByteArrayInputStream ;
2627import java .io .IOException ;
2728import java .io .InputStream ;
2829import java .io .InputStreamReader ;
@@ -408,6 +409,23 @@ public void testWaterOnlyChainCif() throws IOException {
408409 assertSame (c , cAsymId );
409410
410411 }
412+
413+ /**
414+ * Some PDB files coming from phenix or other software can have a CRYST1 line without z and not padded with white-spaces
415+ * for the space group column.
416+ * @throws Exception
417+ * @since 5.0.0
418+ */
419+ @ Test
420+ public void testCryst1Parsing () throws Exception {
421+ String cryst1Line = "CRYST1 11.111 11.111 111.111 70.00 80.00 60.00 P 1" ;
422+ Structure s ;
423+ PDBFileParser pdbPars = new PDBFileParser ();
424+ try (InputStream is = new ByteArrayInputStream (cryst1Line .getBytes ()) ) {
425+ s = pdbPars .parsePDBFile (is );
426+ }
427+ assertEquals ("P 1" , s .getPDBHeader ().getCrystallographicInfo ().getSpaceGroup ().getShortSymbol ());
428+ }
411429
412430
413431 private static int [] countEntityTypes (List <EntityInfo > entities ) {
You can’t perform that action at this time.
0 commit comments