def test_model_to_model(self): """Model sequence should convert to model sequence""" r = RNA.make_array_seq("AAA", name="x") s = RNA.make_array_seq(r) self.assertEqual(str(s), "AAA") self.assertEqual(s.moltype, RNA) self.assertEqual(s.name, "x")
def test_regular_to_regular(self): """Regular sequence should convert to regular sequence""" r = RNA.make_seq("AAA", name="x") s = RNA.make_seq(r) self.assertEqual(str(s), "AAA") self.assertEqual(s.moltype, RNA) self.assertEqual(s.name, "x")
def test_strand_symmetric_motifs(self): """construction of strand symmetric motif sets""" # fails for a moltype with no strand complement with self.assertRaises(TypeError): PROTEIN.strand_symmetric_motifs() got = DNA.strand_symmetric_motifs(motif_length=1) expect = set([("A", "T"), ("C", "G")]) self.assertEqual(got, expect) got = RNA.strand_symmetric_motifs(motif_length=1) expect = set([("A", "U"), ("C", "G")]) self.assertEqual(got, expect) got = DNA.strand_symmetric_motifs(motif_length=2) self.assertEqual(len(got), 8) got = DNA.strand_symmetric_motifs(motif_length=3) self.assertEqual(len(got), 32)