-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprot.py
80 lines (75 loc) · 1.42 KB
/
prot.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
f=open('rosalind_prot.txt', 'r')
rna=f.readline().strip()
codon={}
codon['UUU'] = 'F'
codon['CUU'] = 'L'
codon['AUU'] = 'I'
codon['GUU'] = 'V'
codon['UUC'] = 'F'
codon['CUC'] = 'L'
codon['AUC'] = 'I'
codon['GUC'] = 'V'
codon['UUA'] = 'L'
codon['CUA'] = 'L'
codon['AUA'] = 'I'
codon['GUA'] = 'V'
codon['UUG'] = 'L'
codon['CUG'] = 'L'
codon['AUG'] = 'M'
codon['GUG'] = 'V'
codon['UCU'] = 'S'
codon['CCU'] = 'P'
codon['ACU'] = 'T'
codon['GCU'] = 'A'
codon['UCC'] = 'S'
codon['CCC'] = 'P'
codon['ACC'] = 'T'
codon['GCC'] = 'A'
codon['UCA'] = 'S'
codon['CCA'] = 'P'
codon['ACA'] = 'T'
codon['GCA'] = 'A'
codon['UCG'] = 'S'
codon['CCG'] = 'P'
codon['ACG'] = 'T'
codon['GCG'] = 'A'
codon['UAU'] = 'Y'
codon['CAU'] = 'H'
codon['AAU'] = 'N'
codon['GAU'] = 'D'
codon['UAC'] = 'Y'
codon['CAC'] = 'H'
codon['AAC'] = 'N'
codon['GAC'] = 'D'
codon['UAA'] = 'Stop'
codon['CAA'] = 'Q'
codon['AAA'] = 'K'
codon['GAA'] = 'E'
codon['UAG'] = 'Stop'
codon['CAG'] = 'Q'
codon['AAG'] = 'K'
codon['GAG'] = 'E'
codon['UGU'] = 'C'
codon['CGU'] = 'R'
codon['AGU'] = 'S'
codon['GGU'] = 'G'
codon['UGC'] = 'C'
codon['CGC'] = 'R'
codon['AGC'] = 'S'
codon['GGC'] = 'G'
codon['UGA'] = 'Stop'
codon['CGA'] = 'R'
codon['AGA'] = 'R'
codon['GGA'] = 'G'
codon['UGG'] = 'W'
codon['CGG'] = 'R'
codon['AGG'] = 'R'
codon['GGG'] = 'G'
prot=""
string=""
while prot != "Stop":
(sym,rna) = (rna[0:3], rna[3:])
prot = codon[sym]
if prot != "Stop":
string += prot
print string