Пример #1
0
    def test_reverse_complement(self):
        s = dna("GGGGaaaaaaaatttatatat")
        rc = s.reverse_complement()
        self.assertEqual(rc, dna("atatataaattttttttCCCC"))

        self.assertEqual(
            dna("ACGTRYSWKMBDHVN").reverse_complement(),
            dna("NBDHVKMWSRYACGT"))

        self.assertRaises(ValueError, protein("G").reverse_complement)
Пример #2
0
    def test_reverse_complement(self):
        s = dna('GGGGaaaaaaaatttatatat')
        rc = s.reverse_complement()
        self.assertEqual(rc, dna('atatataaattttttttCCCC'))

        self.assertEqual(
            dna('ACGTRYSWKMBDHVN').reverse_complement(),
            dna('NBDHVKMWSRYACGT'))

        self.assertRaises(ValueError, protein('G').reverse_complement)
Пример #3
0
    def test_shortcuts(self):
        protein('gGGGGG-PPPPP')
        dna('ACGTRYSWKMBDHVN')
        dna('t')
        dna('actgta')
        dna('acgtrysw-kmb-dhvn')

        rna('ACUUUUU')
Пример #4
0
    def test_shortcuts(self):
        protein("gGGGGG-PPPPP")
        dna("ACGTRYSWKMBDHVN")
        dna("t")
        dna("actgta")
        dna("acgtrysw-kmb-dhvn")

        rna("ACUUUUU")
Пример #5
0
def test_bad_mask():
    with pytest.raises(ValueError):
        dna('AAaaaaAAA').mask(mask='ABC')
Пример #6
0
 def test_slice(self):
     s1 = dna('ACGTRYSWKMBDHVN')
     s2 = s1[4:6]
     assert s2 == dna('RY')
Пример #7
0
 def test_casechange(self):
     s1 = dna('ACGTRYSWKMBDHVN')
     s2 = s1.lower().upper()
     self.assertEqual(s1, s2)
Пример #8
0
 def test_mask(self):
     s = dna('AAaaaaAAA').mask()
     self.assertEqual(str(s), 'AAXXXXAAA')
Пример #9
0
 def test_translate(self):
     s = dna('GCCATTGTAATGGGCCGCTGAAAGGGTGCCCGA')
     p = s.translate()
     self.assertEqual(str(p), 'AIVMGR*KGAR')
     p.back_translate()
Пример #10
0
def test_bad_mask():
    with pytest.raises(ValueError):
        dna("AAaaaaAAA").mask(mask="ABC")
Пример #11
0
 def test_slice(self):
     s1 = dna("ACGTRYSWKMBDHVN")
     s2 = s1[4:6]
     assert s2 == dna("RY")
Пример #12
0
 def test_mask(self):
     s = dna("AAaaaaAAA").mask()
     self.assertEqual(str(s), "AAXXXXAAA")