Ejemplo n.º 1
0
 def test_smith_waterman_2(self):
     seq1 = "a nice and short sentence to start with".split()
     seq2 = "let's start with a really nice sentence".split()
     scores, alignment = smith_waterman(seq1, seq2, self.sim_score, self.gap_cost)
     print_scores(seq1, seq2, scores)
     print_alignment(seq1, seq2, alignment)
     self.assertEqual(alignment, [(6,1),(7,2)])
Ejemplo n.º 2
0
 def test_needleman_wunsch_2(self):
     seq1 = "SEND"
     seq2 = "N"
     scores, alignment = needleman_wunsch(seq1, seq2, self.sim_score, self.gap_cost)
     print_scores(seq1, seq2, scores)
     print_alignment(seq1, seq2, alignment)
     self.assertEqual(alignment, [(2,0)])
Ejemplo n.º 3
0
 def test_smith_waterman_1(self):
     seq1 = "ABCCBA"
     seq2 = "CBAABC"
     scores, alignment = smith_waterman(seq1, seq2, self.sim_score, self.gap_cost)
     print_scores(seq1, seq2, scores)
     print_alignment(seq1, seq2, alignment)
     self.assertEqual(alignment, [(3, 0), (4, 1), (5, 2)])
Ejemplo n.º 4
0
 def test_smith_waterman_example(self):
     seq1 = "CCAATCTACTACTGCTTGCAGTAC"
     seq2 = "AGTCCGAGGGCTACTCTACTGAAC"
     scores, alignment = smith_waterman(seq1, seq2, self.sim_score, self.gap_cost)
     print_scores(seq1, seq2, scores)
     print_alignment(seq1, seq2, alignment)
     self.assertEqual(alignment, [(0, 10), (1, 11), (2, 12), (3, 13), (4,14), 
                                  (5, 15), (6, 16), (7, 17), (8, 18), (9, 19)])
Ejemplo n.º 5
0
 def test_smith_waterman_2(self):
     seq1 = "a nice and short sentence to start with".split()
     seq2 = "let's start with a really nice sentence".split()
     scores, alignment = smith_waterman(seq1, seq2, self.sim_score,
                                        self.gap_cost)
     print_scores(seq1, seq2, scores)
     print_alignment(seq1, seq2, alignment)
     self.assertEqual(alignment, [(6, 1), (7, 2)])
Ejemplo n.º 6
0
 def test_smith_waterman_1(self):
     seq1 = "ABCCBA"
     seq2 = "CBAABC"
     scores, alignment = smith_waterman(seq1, seq2, self.sim_score,
                                        self.gap_cost)
     print_scores(seq1, seq2, scores)
     print_alignment(seq1, seq2, alignment)
     self.assertEqual(alignment, [(3, 0), (4, 1), (5, 2)])
Ejemplo n.º 7
0
 def test_needleman_wunsch_2(self):
     seq1 = "SEND"
     seq2 = "N"
     scores, alignment = needleman_wunsch(seq1, seq2, self.sim_score,
                                          self.gap_cost)
     print_scores(seq1, seq2, scores)
     print_alignment(seq1, seq2, alignment)
     self.assertEqual(alignment, [(2, 0)])
Ejemplo n.º 8
0
 def test_smith_waterman_example(self):
     seq1 = "CCAATCTACTACTGCTTGCAGTAC"
     seq2 = "AGTCCGAGGGCTACTCTACTGAAC"
     scores, alignment = smith_waterman(seq1, seq2, self.sim_score,
                                        self.gap_cost)
     print_scores(seq1, seq2, scores)
     print_alignment(seq1, seq2, alignment)
     self.assertEqual(alignment,
                      [(0, 10), (1, 11), (2, 12), (3, 13), (4, 14), (5, 15),
                       (6, 16), (7, 17), (8, 18), (9, 19)])