2014-04-17 19:07:00 +02:00
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
if sys.version_info[0] == 2:
|
|
|
|
|
from string import maketrans
|
|
|
|
|
else:
|
|
|
|
|
maketrans = str.maketrans
|
2013-07-30 09:32:35 -05:00
|
|
|
|
2014-02-22 10:55:33 +08:00
|
|
|
|
2013-07-30 09:01:03 -05:00
|
|
|
class DNA(object):
|
2014-02-15 22:19:02 +01:00
|
|
|
rna_translation = maketrans('AGCT', 'UCGA')
|
2013-07-30 09:01:03 -05:00
|
|
|
|
|
|
|
|
def __init__(self, strand):
|
|
|
|
|
self.strand = strand
|
|
|
|
|
|
|
|
|
|
def to_rna(self):
|
2013-07-30 09:32:35 -05:00
|
|
|
return self.strand.translate(self.rna_translation)
|