X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fext%2Fjmol%2FJmolParserTest.java;h=f728d63518b7c6b1d53fd0dc1a9f430daa2dad5e;hb=1986948868e6643ea811a70cd0018c8103a7b3f0;hp=09b309de29fa3e0ba9c77612bd8e519403e7b264;hpb=6d7ab37f37b09174ec61fee301aed6057ef86605;p=jalview.git diff --git a/test/jalview/ext/jmol/JmolParserTest.java b/test/jalview/ext/jmol/JmolParserTest.java index 09b309d..f728d63 100644 --- a/test/jalview/ext/jmol/JmolParserTest.java +++ b/test/jalview/ext/jmol/JmolParserTest.java @@ -30,6 +30,8 @@ import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; import jalview.io.AppletFormatAdapter; import jalview.io.FileLoader; +import jalview.structure.StructureImportSettings; +import jalview.structure.StructureImportSettings.StructureParser; import java.util.Vector; @@ -50,12 +52,12 @@ public class JmolParserTest * 1QCF is the full PDB file including headers, HETATM etc */ String[] testFile = new String[] { "./examples/1GAQ.txt", - "./test/jalview/ext/jmol/1QCF.pdb" }; // , - // String[] testFile = new String[] { "./examples/testdata/1qcf.cif" }; // , + "./test/jalview/ext/jmol/1xyz.pdb", + "./test/jalview/ext/jmol/1qcf.pdb" }; //@formatter:off // a modified and very cut-down extract of 4UJ4 - String pdbWithChainBreak = + String pastePDBDataWithChainBreak = "HEADER TRANSPORT PROTEIN 08-APR-15 4UJ4\n" + // chain B has missing residues; these should all go in the same sequence: "ATOM 1909 CA VAL B 358 21.329 -19.739 -67.740 1.00201.05 C\n" + @@ -84,10 +86,16 @@ public class JmolParserTest @BeforeMethod(alwaysRun = true) public void setUp() { + Cache.loadProperties("test/jalview/io/testProps.jvprops"); Cache.applicationProperties.setProperty("STRUCT_FROM_PDB", Boolean.TRUE.toString()); + Cache.applicationProperties.setProperty("ADD_TEMPFACT_ANN", + Boolean.FALSE.toString()); Cache.applicationProperties.setProperty("ADD_SS_ANN", Boolean.TRUE.toString()); + StructureImportSettings.setDefaultStructureFileFormat("PDB"); + StructureImportSettings + .setDefaultPDBFileParser(StructureParser.JALVIEW_PARSER); } @Test(groups = { "Functional" }) @@ -105,16 +113,11 @@ public class JmolParserTest @Test(groups = { "Functional" }) public void testFileParser() throws Exception { - boolean annotFromStructure = false; - boolean localSecondaryStruct = false; - boolean serviceSecondaryStruct = false; for (String pdbStr : testFile) { PDBfile mctest = new PDBfile(false, false, false, pdbStr, AppletFormatAdapter.FILE); - JmolParser jtest = new JmolParser(annotFromStructure, - localSecondaryStruct, serviceSecondaryStruct, pdbStr, - jalview.io.AppletFormatAdapter.FILE); + JmolParser jtest = new JmolParser(pdbStr, AppletFormatAdapter.FILE); Vector seqs = jtest.getSeqs(), mcseqs = mctest.getSeqs(); assertTrue( @@ -132,6 +135,7 @@ public class JmolParserTest validateSecStrRows(al); } } + } private void validateSecStrRows(AlignmentI al) @@ -161,7 +165,8 @@ public class JmolParserTest private void checkFirstAAIsAssoc(SequenceI sq) { - assertTrue("No secondary structure assigned for protein sequence.", + assertTrue("No secondary structure assigned for protein sequence for " + + sq.getName(), sq.getAnnotation() != null && sq.getAnnotation().length >= 1 && sq.getAnnotation()[0].hasIcons); assertTrue( @@ -177,15 +182,11 @@ public class JmolParserTest @Test(groups = { "Functional" }) public void testParse_missingResidues() throws Exception { - PDBfile mctest = new PDBfile(false, false, false, pdbWithChainBreak, + PDBfile mctest = new PDBfile(false, false, false, + pastePDBDataWithChainBreak, + AppletFormatAdapter.PASTE); + JmolParser jtest = new JmolParser(pastePDBDataWithChainBreak, AppletFormatAdapter.PASTE); - boolean annotFromStructure = false; - boolean localSecondaryStruct = false; - boolean serviceSecondaryStruct = false; - JmolParser jtest = new JmolParser(annotFromStructure, - localSecondaryStruct, serviceSecondaryStruct, - pdbWithChainBreak, - jalview.io.AppletFormatAdapter.PASTE); Vector seqs = jtest.getSeqs(); Vector mcseqs = mctest.getSeqs(); @@ -207,12 +208,8 @@ public class JmolParserTest { PDBfile mctest = new PDBfile(false, false, false, pdbWithAltLoc, AppletFormatAdapter.PASTE); - boolean annotFromStructure = false; - boolean localSecondaryStruct = false; - boolean serviceSecondaryStruct = false; - JmolParser jtest = new JmolParser(annotFromStructure, - localSecondaryStruct, serviceSecondaryStruct, pdbWithAltLoc, - jalview.io.AppletFormatAdapter.PASTE); + JmolParser jtest = new JmolParser(pdbWithAltLoc, + AppletFormatAdapter.PASTE); Vector seqs = jtest.getSeqs(); Vector mcseqs = mctest.getSeqs();