def test_index_numeric(self): from multicov.alphabet import NumericAlphabet alpha = NumericAlphabet(4, 8) for i, n in enumerate(alpha.letters()): self.assertEqual(alpha[i], n)
def test_numeric_letters_nonzero_base(self): from multicov.alphabet import NumericAlphabet alpha = NumericAlphabet(2, 7) self.assertTrue(np.array_equal(alpha.letters(), list(range(2, 7))))
def test_numeric_letters_nogap_nonzero_base_gapful(self): from multicov.alphabet import NumericAlphabet alpha = NumericAlphabet(5, 11, has_gap=True) self.assertTrue(np.array_equal(alpha.letters(no_gap=True), list(range(6, 11))))
def test_numeric_letters_nogap_base0_gapless(self): from multicov.alphabet import NumericAlphabet alpha = NumericAlphabet(4, has_gap=False) self.assertTrue(np.array_equal(alpha.letters(no_gap=True), list(range(4))))