示例#1
0
    def test_sixframes(self):
        """GeneticCode sixframes should provide six-frame translation"""
        
        class fake_rna(str):
            """Fake RNA class with reverse-complement"""
            def __new__(cls, seq, rev):
                return str.__new__(cls, seq)
            def __init__(self, seq, rev):
                self.seq = seq
                self.rev = rev
            def rc(self):
                return self.rev

        test_rna = fake_rna('AUGCUAACAUAAA', 'UUUAUGUUAGCAU')
        #                    .  .  .  .  .    .  .  .  .  .
        sgc = GeneticCode(self.SGC)
        self.assertEqual(sgc.sixframes(test_rna), [
            'MLT*', 'C*HK', 'ANI', 'FMLA', 'LC*H', 'YVS'])
        
        # should also actually work with an RNA or DNA sequence!!!
        test_rna = RNA.makeSequence('AUGCUAACAUAAA')
        self.assertEqual(sgc.sixframes(test_rna), [
            'MLT*', 'C*HK', 'ANI', 'FMLA', 'LC*H', 'YVS'])
示例#2
0
    def test_sixframes(self):
        """GeneticCode sixframes should provide six-frame translation"""

        class fake_rna(str):
            """Fake RNA class with reverse-complement"""

            def __new__(cls, seq, rev):
                return str.__new__(cls, seq)

            def __init__(self, seq, rev):
                self.seq = seq
                self.rev = rev

            def rc(self):
                return self.rev

        test_rna = fake_rna("AUGCUAACAUAAA", "UUUAUGUUAGCAU")
        #                    .  .  .  .  .    .  .  .  .  .
        sgc = GeneticCode(self.SGC)
        self.assertEqual(sgc.sixframes(test_rna), ["MLT*", "C*HK", "ANI", "FMLA", "LC*H", "YVS"])

        # should also actually work with an RNA or DNA sequence!!!
        test_rna = RNA.makeSequence("AUGCUAACAUAAA")
        self.assertEqual(sgc.sixframes(test_rna), ["MLT*", "C*HK", "ANI", "FMLA", "LC*H", "YVS"])
示例#3
0
    def test_sixframes(self):
        """GeneticCode sixframes should provide six-frame translation"""
        class fake_rna(str):
            """Fake RNA class with reverse-complement"""
            def __new__(cls, seq, rev):
                return str.__new__(cls, seq)

            def __init__(self, seq, rev):
                self.seq = seq
                self.rev = rev

            def rc(self):
                return self.rev

        test_rna = fake_rna('AUGCUAACAUAAA', 'UUUAUGUUAGCAU')
        #                    .  .  .  .  .    .  .  .  .  .
        sgc = GeneticCode(self.SGC)
        self.assertEqual(sgc.sixframes(test_rna),
                         ['MLT*', 'C*HK', 'ANI', 'FMLA', 'LC*H', 'YVS'])

        # should also actually work with an RNA or DNA sequence!!!
        test_rna = RNA.makeSequence('AUGCUAACAUAAA')
        self.assertEqual(sgc.sixframes(test_rna),
                         ['MLT*', 'C*HK', 'ANI', 'FMLA', 'LC*H', 'YVS'])