def test_end_in_non_match(self, get_consensus, _, __): get_consensus.return_value = "**ATT**AAA*C" tester = AlignedSeq("_", alignment="_", min_match_length=3) match, non_match = tester.interval_partition() self.assertEqual(match, [[2, 4], [7, 9]]) self.assertEqual(non_match, [[0, 1], [5, 6], [10, 11]])
def test_short_match_counted_as_non_match(self, get_consensus, _, __): get_consensus.return_value = "AT***" tester = AlignedSeq("_", alignment="_", min_match_length=3) match, non_match = tester.interval_partition() self.assertEqual(match, []) self.assertEqual(non_match, [[0, 4]])
def test_match_non_match_match(self, get_consensus, _, __): get_consensus.return_value = "ATT**AAAC" tester = AlignedSeq("_", alignment="_", min_match_length=3) match, non_match = tester.interval_partition() self.assertEqual(match, [[0, 2], [5, 8]]) self.assertEqual(non_match, [[3, 4]])
def test_all_match(self, get_consensus, _, __): get_consensus.return_value = "ATATAAA" tester = AlignedSeq("_", alignment="_", min_match_length=3) match, non_match = tester.interval_partition() self.assertEqual(match, [[0, 6]]) self.assertEqual(non_match, [])