Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 3
0
    def test_shortcuts(self):
        protein('gGGGGG-PPPPP')
        dna('ACGTRYSWKMBDHVN')
        dna('t')
        dna('actgta')
        dna('acgtrysw-kmb-dhvn')

        rna('ACUUUUU')
Exemplo n.º 4
0
    def test_shortcuts(self):
        protein("gGGGGG-PPPPP")
        dna("ACGTRYSWKMBDHVN")
        dna("t")
        dna("actgta")
        dna("acgtrysw-kmb-dhvn")

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