+
+ /**
+ * Test parsing a chain with missing residues
+ *
+ * @throws Exception
+ */
+ @Test(groups = { "Functional" })
+ public void testParse_missingResidues() throws Exception
+ {
+ PDBfile mctest = new PDBfile(false, false, false, pdbWithChainBreak,
+ AppletFormatAdapter.PASTE);
+ PDBFileWithJmol jtest = new PDBFileWithJmol(pdbWithChainBreak,
+ jalview.io.AppletFormatAdapter.PASTE);
+ Vector<SequenceI> seqs = jtest.getSeqs();
+ Vector<SequenceI> mcseqs = mctest.getSeqs();
+
+ assertEquals("Failed to find 2 sequences\n", 2, seqs.size());
+ assertEquals("Failed to find 2 sequences\n", 2, mcseqs.size());
+ assertEquals("VGKA", seqs.get(0).getSequenceAsString());
+ assertEquals("VGKA", mcseqs.get(0).getSequenceAsString());
+ assertEquals("SA", seqs.get(1).getSequenceAsString());
+ assertEquals("SA", mcseqs.get(1).getSequenceAsString());
+ }
+
+ /**
+ * Test parsing a chain with 'altloc' residues
+ *
+ * @throws Exception
+ */
+ @Test(groups = { "Functional" })
+ public void testParse_alternativeResidues() throws Exception
+ {
+ PDBfile mctest = new PDBfile(false, false, false, pdbWithAltLoc,
+ AppletFormatAdapter.PASTE);
+ PDBFileWithJmol jtest = new PDBFileWithJmol(pdbWithAltLoc,
+ jalview.io.AppletFormatAdapter.PASTE);
+ Vector<SequenceI> seqs = jtest.getSeqs();
+ Vector<SequenceI> mcseqs = mctest.getSeqs();
+
+ assertEquals("Failed to find 1 sequence\n", 1, seqs.size());
+ assertEquals("Failed to find 1 sequence\n", 1, mcseqs.size());
+ assertEquals("ALC", seqs.get(0).getSequenceAsString());
+ assertEquals("ALC", mcseqs.get(0).getSequenceAsString());
+ }
+
+ @Test(groups = "Functional")
+ public void testSetSecondaryStructure()
+ {
+ PDBFileWithJmol testee = new PDBFileWithJmol();
+ char[] struct = new char[10];
+ char[] structCode = new char[10];
+ struct[0] = '1';
+ structCode[0] = '1';
+
+ testee.setSecondaryStructure(STR.NONE, 0, struct, structCode);
+ testee.setSecondaryStructure(STR.HELIX, 1, struct, structCode);
+ testee.setSecondaryStructure(STR.HELIX310, 2, struct, structCode);
+ testee.setSecondaryStructure(STR.HELIXALPHA, 3, struct, structCode);
+ testee.setSecondaryStructure(STR.HELIXPI, 4, struct, structCode);
+ testee.setSecondaryStructure(STR.SHEET, 5, struct, structCode);
+
+ assertEquals(0, struct[0]);
+ assertEquals('H', struct[1]);
+ assertEquals('3', struct[2]);
+ assertEquals('H', struct[3]);
+ assertEquals('P', struct[4]);
+ assertEquals('E', struct[5]);
+
+ assertEquals(0, structCode[0]);
+ assertEquals('H', structCode[1]);
+ assertEquals('H', structCode[2]);
+ assertEquals('H', structCode[3]);
+ assertEquals('H', structCode[4]);
+ assertEquals('E', structCode[5]);
+ }