package jalview.datamodel; import static org.testng.Assert.assertEquals; import jalview.io.DataSourceType; import jalview.io.FileParse; import jalview.io.HMMFile; import java.io.IOException; import java.net.MalformedURLException; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class HMMNodeTest { private HiddenMarkovModel hmm; @BeforeClass(alwaysRun = true) public void setUp() throws MalformedURLException, IOException { /* * load hmm model of a Kinase domain to a HiddenMarkovModel */ HMMFile file = new HMMFile(new FileParse( "test/jalview/io/test_PKinase_hmm.txt", DataSourceType.FILE)); hmm = file.getHMM(); } @Test(groups="Functional") public void testGetMaxMatchEmissionIdex() { assertEquals(hmm.getAlphabetType(), "amino"); String symbols = hmm.getSymbols(); assertEquals(hmm.getNode(1).getMaxMatchEmissionIndex(), symbols.indexOf('Y')); assertEquals(hmm.getNode(17).getMaxMatchEmissionIndex(), symbols.indexOf('K')); } }