예제 #1
0
 def test_align_to_ref_generic_moltype(self):
     """tests when the moltype is generic"""
     test_moltypes = ["text", "rna", "protein", "protein_with_stop", "bytes", "ab"]
     for test_moltype in test_moltypes:
         aligner = align_app.align_to_ref(moltype=test_moltype)
         self.assertEqual(aligner._moltype.label, test_moltype)
         self.assertEqual(
             aligner._kwargs["S"],
             make_generic_scoring_dict(10, get_moltype(test_moltype)),
         )
예제 #2
0
    def test_pwise_protein(self):
        """works for pairwise protein alignment"""
        from cogent3 import PROTEIN

        S = make_generic_scoring_dict(1, PROTEIN)
        seq1 = PROTEIN.make_seq("MAYPFQLGLQD", "seq1")
        seq2 = PROTEIN.make_seq("MAYPFGLQD", "seq2")
        a1 = classic_align_pairwise(seq1, seq2, S, 10, 2, local=False)
        self.assertEqual(a1.to_dict(),
                         dict(seq1="MAYPFQLGLQD", seq2="MAYPF--GLQD"))