1 """Code to transcribe DNA into RNA or back (OBSOLETE).
2
3 You are now encouraged to use the Seq object methods or the functions
4 in Bio.Seq instead.
5
6 This module is now considered to be obsolete, and is likely to be deprecated
7 in a future release of Biopython, and later removed.
8 """
9 import string
10
11 from Bio import Alphabet, Seq
12 from Bio.Alphabet import IUPAC
13
15 - def __init__(self, dna_alphabet, rna_alphabet):
18
20 assert dna.alphabet == self.dna_alphabet, \
21 "transcribe has the wrong DNA alphabet"
22 s = dna.data
23 return Seq.Seq(string.replace(s, "T", "U"), self.rna_alphabet)
25 assert rna.alphabet == self.rna_alphabet, \
26 "back transcribe has the wrong RNA alphabet"
27 s = rna.data
28 return Seq.Seq(string.replace(s, "U", "T"), self.dna_alphabet)
29
30 generic_transcriber = Transcribe(Alphabet.generic_dna,
31 Alphabet.generic_rna)
32 ambiguous_transcriber = Transcribe(IUPAC.ambiguous_dna,
33 IUPAC.ambiguous_rna)
34 unambiguous_transcriber = Transcribe(IUPAC.unambiguous_dna,
35 IUPAC.unambiguous_rna)
36