HiddenMarkovModel hmm;
+ HiddenMarkovModel alignmentHmm;
+
@BeforeClass(alwaysRun = true)
public void setUp() throws MalformedURLException, IOException
{
HMMFile file = new HMMFile(new FileParse(
"test/jalview/io/test_PKinase_hmm.txt", DataSourceType.FILE));
hmm = file.getHMM();
+
+ // used to check if consensus sequence is automatically aligned with alignment
+ HMMFile alignmentTest = new HMMFile(
+ new FileParse("test/jalview/io/HMMAlignmentTestHMM.hmm",
+ DataSourceType.FILE));
+ alignmentHmm = alignmentTest.getHMM();
}
@Test(groups = "Functional")
assertEquals(subStr, "yelleklGsG");
subStr = seq.getSequenceAsString().substring(150, 161);
assertEquals(subStr, "-dllk------");
+
+ // test to see if consensus sequence maps to alignment correctly
+ // see HMMAlignmentTest.sto for corresponding alignment file
+ SequenceI seq2 = alignmentHmm.getConsensusSequence();
+ assertEquals(seq2.getCharAt(0), '-');
+ assertEquals(seq2.getCharAt(7), '-');
+ assertEquals(seq2.getCharAt(8), 's');
+
}
/**