コード例 #1
0
    def setUp(self):
        """Define some standard Organizers for testing"""
        self.Empty = Organizer([])

        self.a = Filter('a', {None: [find_any('a')]})
        self.b = Filter('b', {None: [find_any('b')]})
        self.Ab_org = Organizer([self.a, self.b])

        lsu = Filter('LSU',{None:[exclude_if_more('N',5)],\
                            'Gene':[find_any(['LSU'])]})
        ssu = Filter('SSU',{None:[exclude_if_more('N',5)],\
                            'Gene':[find_any(['SSU'])]})
        self.Gene_org = Organizer([lsu, ssu])

        self.Ab_seq = ['aa', 'bb', 'abab', 'cc', '']
        self.seq1 = Sequence('ACGU', {'Gene': 'LSU'})
        self.seq2 = Sequence('ACGUACGU', {'Gene': 'SSU'})
        self.seq3 = Sequence('ACGUNNNNNN', {'Gene': 'LSU'})
        self.seq4 = Sequence('ACGUNNNNNN', {'Gene': 'SSU'})
        self.seq5 = Sequence('ACGU', {})
        self.seq6 = Sequence('', {})
        self.seq7 = Sequence('ACGU', {'Gene': 'unit'})

        self.Gene_seq = [self.seq1,self.seq2,self.seq3,self.seq4,\
                self.seq5,self.seq6,self.seq7]

        f = Filter('valid',{None:[find_all('AGCU'),find_no('N')],\
                            'Gene':[find_any(['LSU'])]})
        self.Mult_func_org = Organizer([f])
コード例 #2
0
 def test_init_full(self):
     """Organizer should init correctly with multiple functions"""
     org = Organizer([self.a, self.b])
     self.assertEqual(org[0], self.a)
     self.assertEqual(org[1], self.b)
     self.assertEqual(len(org), 2)