Ejemplo n.º 1
0
 def setUp(self):
     self.test_mrna0 = MRNA(identifier='bdor_foo',
                            indices=[3734, 7436],
                            strand='-',
                            parent_id=1)
     self.test_mrna1 = MRNA(identifier=2, indices=[3734, 7436], parent_id=1)
     self.fake_exon = Mock()
     self.fake_cds = Mock()
     self.fake_start_codon = Mock()
     self.test_mrna1.exon = self.fake_exon
     self.test_mrna1.cds = self.fake_cds
     self.test_mrna1.add_other_feature(self.fake_start_codon)
Ejemplo n.º 2
0
 def process_mrna_line(self, line):
     """Extracts arguments from a line and instantiates an MRNA object."""
     kwargs = self.extract_mrna_args(line)
     if not kwargs:
         return
     mrna_id = kwargs['identifier']
     self.mrnas[mrna_id] = MRNA(**kwargs)
Ejemplo n.º 3
0
 def test_indices_intersect_mrna_true(self):
     mrna = MRNA(identifier=1, indices=[10, 20], parent_id='foo')
     self.assertTrue(mrna.indices_intersect_mrna([5, 10]))
     self.assertTrue(mrna.indices_intersect_mrna([20, 25]))
     self.assertTrue(mrna.indices_intersect_mrna([9, 21]))
Ejemplo n.º 4
0
 def test_constructor_takes_annotations(self):
     self.assertTrue(
         MRNA(identifier="foo",
              indices=[1, 10],
              parent_id="bar",
              annotations=[["Dbxref", "pfam:foo"]]))
Ejemplo n.º 5
0
 def test_indices_intersect_mrna_false(self):
     mrna = MRNA(identifier=1, indices=[10, 20], parent_id='foo')
     self.assertFalse(mrna.indices_intersect_mrna([5, 9]))
     self.assertFalse(mrna.indices_intersect_mrna([21, 25]))