示例#1
0
 def test_align___0(self):
     # initialize SequencePair
     sp = pairwise.SequencePair("", "")
     # call align function with specific input
     self.assertTrue(
         sp.align("AAA", "GAAAGGG", open_penalty=3,
                  extend_penalty=3).traceback.query == '-AAA---')
示例#2
0
 def test_SequencePair___returns_hamming_distance0_5(self):
     self.assertTrue(
         pairwise.SequencePair("AAAAAAAAAA", "AAAAA").hamming_distance ==
         5.0)
示例#3
0
 def test_SequencePair___returns_hamming_distance0_083(self):
     self.assertTrue(
         pairwise.SequencePair("CAGQASQGNLIF",
                               "CAGQRSQGNLIF").hamming_distance == 1.0)
示例#4
0
 def test_SequencePair___leninput2_lt_5_returns_distance_None(self):
     self.assertTrue(
         pairwise.SequencePair("CAGQASQGNLIF", "CAGA").hamming_distance ==
         None)
示例#5
0
 def test_SequencePair___returns_TypeError(self):
     with self.assertRaises(TypeError):
         pairwise.SequencePair("CAGQASQGNLIF", 1)
示例#6
0
 def test_align___2(self):
     self.assertTrue(
         pairwise.SequencePair("AACAGQASQGNLIF", "CAGQASQGNLIF").a2 ==
         '--CAGQASQGNLIF')
示例#7
0
 def my_distance_wrapper(a, b):
     return (float(pairwise.SequencePair(a, b).hamming_distance))