-
Notifications
You must be signed in to change notification settings - Fork 0
/
PROT.py
12 lines (11 loc) · 8.81 KB
/
PROT.py
1
2
3
4
5
6
7
8
9
10
11
12
dict={'UUU':'F','CUU':'L','AUU':'I','GUU':'V','UUC':'F','CUC':'L','AUC':'I','GUC':'V','UUA':'L','CUA':'L','AUA':'I','GUA':'V','UUG':'L','CUG':'L','AUG':'M','GUG':'V','UCU':'S','CCU':'P','ACU':'T','GCU':'A','UCC':'S','CCC':'P','ACC':'T','GCC':'A','UCA':'S','CCA':'P','ACA':'T','GCA':'A','UCG':'S','CCG':'P','ACG':'T','GCG':'A','UAU':'Y','CAU':'H','AAU':'N','GAU':'D','UAC':'Y','CAC':'H','AAC':'N','GAC':'D','UAA':'Stop','CAA':'Q','AAA':'K','GAA':'E','UAG':'Stop','CAG':'Q','AAG':'K','GAG':'E','UGU':'C','CGU':'R','AGU':'S','GGU':'G','UGC':'C','CGC':'R','AGC':'S','GGC':'G','UGA':'Stop','CGA':'R','AGA':'R','GGA':'G','UGG':'W','CGG':'R','AGG':'R','GGG':'G'}
def transcribe(dna):
p=''
for i in range(len(dna)):
if i%3==0:
if dict[dna[i:i+3]]=='Stop':
return p
p+=dict[dna[i:i+3]]
return p
str='AUGAAGAUGUAUCUGCUACAACGCUCUACUAGGUAUUCUCUAUUAACCAGCCCGCGCCGCCCAGCACACAAUAUUUAUGAGGUCGACAUCUUGGAGUCGAGCUUUCACUCUGCGGAUGAUACAUUGACGGACCACGCAGGAACGGCUGGGACGGCUCUACUUAACGCACUCGUUUGGACCGGGUCGAAACUAAUGGUAGUGGUGUCCCUCAAUUGCCCGCAUGAGUCGUGUUUGGGGGCCUAUGAACCAAUAAGUCGGAUCUAUAUCGAAAGGAGCUGUAACGGUGACACACUGAUCCCCUCAGCACAGCGACACCUCAAGACACCCGUUCAUUGUGCGGGUACCGUACCAGGGCACAACACCGAAUGUCUGGAAGGUUACAAUGCGUGCAACCUCAACGCAUUGGUGCUAGAAAAUAAAGCAGGUCAGCGC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