forked from mtarbit/Rosalind-Problems
-
Notifications
You must be signed in to change notification settings - Fork 0
/
e002-rna.py
executable file
·34 lines (26 loc) · 1.57 KB
/
e002-rna.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python
# RNA Transcription
# =================
#
# An RNA string is formed from the alphabet containing A, C, G, and U.
#
# Given a DNA string t corresponding to a coding strand, its transcribed RNA
# string u is formed by replacing all occurrences of T with U.
#
# Given: A DNA string t of length at most 1000 nucleotides.
#
# Return: The transcribed RNA string of t.
#
# Sample Dataset
# --------------
# GATGGAACTTGACTACGTAAATT
#
# Sample Output
# -------------
# GAUGGAACUUGACUACGUAAAUU
def transcribe_rna(t):
return t.replace('T','U')
if __name__ == "__main__":
small_dataset = "GATGGAACTTGACTACGTAAATT"
large_dataset = "GAACTAAGGGCTGGGTTATGCTCCCTAGTTCCAACCTGCGGCTAAGAATCATTAGGTAGATAGTGCGGTAAGGGTGTAACATTACCGCCTTTAATCTTCTCTCCGTAGGGTTAAGGCTGGGTTAAGAGTACGACTATGATCCAGGGCGACTGATGGGTGTTTCGGGGACGCCCTGTTGAGCAAGGCTGAATTAATGCGAGTGTAACTTAGTATGTCGCAACTCGCTGTGCCATCCGTAAGGCGTTACGCACAGGTTATGCATCTTGCACGGCCTCTATGGAGAGACTTGTCACGTTATTTATGACAACACTGGGGCAGATATACCCTCACCGAGTGCCCGCCCTGTTCACTACAACCATCGACGCGATCTCGAACTTGATACTAACTCTGGGCGACGTACAAGGTCGGGGTCACACCGCCCGGGGCATACATTAGTGAGAGCTAACCCACATATTTCATTGGTGTCCCGATACTCCGCCGCTATTATGTATAATTTGTCACACCGCTGGCCTAGACCACACCACACACTGACTTAATGCTTGCACCTCTCCTAAAACAAGTGCACATGAGGGTAATATCGCGACTTTCTTCATGAACATCATCGATGTCACATCTCAATAGTGCTTCTGAATCGCTAGCCTCTGGTCGGAGGATACTGATAAGGCGCTTAACCAAGGCATTCAGTGAGTTAGCGGGTCGTCTTGCGCGCCAATCCCTTACAAATTTTTCTGGCTTAGCCCTGAAGCCTTCTCTACATATAGGGGTATGTGAGTCGCAGGTAAGCCTTCTTCTAGGGTAAGGTCAGACAATCTGTGTATTATATCGTAAGGTAGGCAAGCCCGTTGCTTCGTGCCTTTATCATTGACATATTCAAAATTGGCGGGACTCAAGCTTGCGTGGAC"
print transcribe_rna(large_dataset)