Ejemplo n.º 1
0
 def remove_mrnas_with_internal_stops(self):
     helper = SeqHelper(self.bases)
     for gene in self.genes:
         gene.remove_mrnas_with_internal_stops(helper)
         if not gene.mrnas:
             gene.death_flagged = True
     self.genes = [g for g in self.genes if not g.death_flagged]
Ejemplo n.º 2
0
 def test_mrna_contains_internal_stop(self):
     helper = SeqHelper("gattacaTAGgattaca")  # TAG = stop codon
     mrna = Mock()
     mrna.strand = '+'
     mrna.cds = Mock()
     mrna.cds.indices = [[2, 4], [8, 14]]
     # verify that the internal stop is in the sequence ...
     self.assertEquals(
         "attTAGgatt",
         helper.get_sequence_from_indices('+', mrna.cds.indices))
     # make sure the method catches it
     self.assertTrue(helper.mrna_contains_internal_stop(mrna))
Ejemplo n.º 3
0
 def to_protein_fasta(self):
     helper = SeqHelper(self.bases)
     result = ""
     for gene in self.genes:
         result += gene.to_protein_fasta(helper)
     return result
Ejemplo n.º 4
0
 def setUp(self):
     self.helper = SeqHelper("nnnGATTACAnnnnnNNNNNgattacaNNN")