Ejemplo n.º 1
0
    def test_N_boundary_positions(self):
        boundaries = find_N_boundaries(self.src_seq)
        self.assertTupleEqual(boundaries, (16, 33))
        self.assertEqual(self.src_seq[16], 'T')
        self.assertEqual(self.src_seq[33], 'C')

        boundaries = find_N_boundaries(self.fwd_seq)
        self.assertTupleEqual(boundaries, (0, 33))

        boundaries = find_N_boundaries(self.rev_seq)
        self.assertTupleEqual(boundaries, (16, 46))
        self.assertEqual(self.rev_seq[46], 'T')
        self.assertEqual(self.rev_seq[33], 'C')
Ejemplo n.º 2
0
    def test_elongate_reverse_sequence_kmer_mode(self):
        boundaries = find_N_boundaries(self.src_seq)
        hexamer_table = build_hexamer_table()

        hexamer_pair = determine_hexamers(self.src_seq, boundaries,
                                          hexamer_table)
        tst_seq = elongate_reverse_sequence(self.src_seq, hexamer_pair[1],
                                            "kmer_mode")

        self.assertEqual(len(tst_seq), len(self.rev_seq))
        self.assertEqual(tst_seq, self.rev_seq)
Ejemplo n.º 3
0
    def test_elongate_forward_sequence(self):
        boundaries = find_N_boundaries(self.src_seq)
        hexamer_table = build_hexamer_table()

        hexamer_pair = determine_hexamers(self.src_seq, boundaries,
                                          hexamer_table)
        tst_seq = elongate_forward_sequence(self.src_seq, hexamer_pair[0],
                                            "naive_mode")

        self.assertEqual(len(tst_seq), len(self.fwd_seq))
        self.assertEqual(tst_seq, self.fwd_seq)
Ejemplo n.º 4
0
    def test_determine_hexamer(self):
        boundaries = find_N_boundaries(self.src_seq)
        hexamer_table = build_hexamer_table()

        # Will find known pattern CCCTAA in sequence
        hexamer_pair = determine_hexamers(self.src_seq, boundaries,
                                          hexamer_table)
        self.assertEqual('TAACCC', hexamer_pair[0])
        self.assertEqual('TAACCC', hexamer_pair[1])

        # Should not find any pattern in sequence
        hexamer_pair = determine_hexamers(self.no_patt, boundaries,
                                          hexamer_table)
        self.assertNotIn('TAACCC', hexamer_pair)
        self.assertEqual(hexamer_pair, [None, None])