Beispiel #1
0
 def test_with_site_outside_cds(self):
     dna_seq = Seq("GAGATCCGGTCCATATCTTATTCAACGCAAGAATTCAT",
                   unambiguous_dna)
     new_seq = recode_site_from_cds(dna_seq, self.EcoRI, self.codon_sampler,
                                    self.cds_start, self.cds_end)
     assert new_seq.find(self.EcoRI) >= 0
     assert new_seq == dna_seq
Beispiel #2
0
 def test_bad_cds_with_site(self):
     # NOTE: CDS is different in this test
     cds_start = 10
     cds_end = 27
     dna_seq = Seq("GAGATCCGGAATTCATCTTATTCAACGAAGTTGTTAT")
     with raises(PepsynError):
         new_seq = recode_site_from_cds(dna_seq, self.EcoRI,
                                        self.codon_sampler, cds_start,
                                        cds_end)
Beispiel #3
0
 def test_with_site_on_left_boundary(self):
     dna_seq = Seq("GAGATCCGGTCCATATCTTATTCGAATTCAGTTGTTAT")
     new_seq = recode_site_from_cds(dna_seq, self.EcoRI, self.codon_sampler,
                                    self.cds_start, self.cds_end)
     orig_trans = dna_seq[self.cds_start:self.cds_end].translate(
         table=self.codon_sampler.table)
     new_trans = new_seq[self.cds_start:self.cds_end].translate(
         table=self.codon_sampler.table)
     assert new_seq.find(self.EcoRI) == -1
     assert new_seq != dna_seq
     assert len(new_seq) == len(dna_seq)
     assert new_seq[:self.cds_start] == dna_seq[:self.cds_start]
     assert new_seq[self.cds_end:] == dna_seq[self.cds_end:]
     assert new_trans == orig_trans
Beispiel #4
0
 def test_no_site(self):
     dna_seq = Seq("GAGATCCGGTCCATATCTTATTCAACGCAAGTTGTTAT")
     new_seq = recode_site_from_cds(dna_seq, self.EcoRI, self.codon_sampler,
                                    self.cds_start, self.cds_end)
     assert new_seq.find(self.EcoRI) == -1
     assert new_seq == dna_seq