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---')
def test_SequencePair___returns_hamming_distance0_5(self): self.assertTrue( pairwise.SequencePair("AAAAAAAAAA", "AAAAA").hamming_distance == 5.0)
def test_SequencePair___returns_hamming_distance0_083(self): self.assertTrue( pairwise.SequencePair("CAGQASQGNLIF", "CAGQRSQGNLIF").hamming_distance == 1.0)
def test_SequencePair___leninput2_lt_5_returns_distance_None(self): self.assertTrue( pairwise.SequencePair("CAGQASQGNLIF", "CAGA").hamming_distance == None)
def test_SequencePair___returns_TypeError(self): with self.assertRaises(TypeError): pairwise.SequencePair("CAGQASQGNLIF", 1)
def test_align___2(self): self.assertTrue( pairwise.SequencePair("AACAGQASQGNLIF", "CAGQASQGNLIF").a2 == '--CAGQASQGNLIF')
def my_distance_wrapper(a, b): return (float(pairwise.SequencePair(a, b).hamming_distance))