Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1fc77f8

Browse files
committed
finish one beta
1 parent 2916371 commit 1fc77f8

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

β€Ž[beta]RNA to Protein Sequence Translation

Whitespace-only changes.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
rnaDict = '''Phenylalanine (F): UUU, UUC
2+
Leucine (L): UUA, UUG, CUU, CUC, CUA, CUG
3+
Isoleucine (I): AUU, AUC, AUA
4+
Methionine (M): AUG
5+
Valine (V): GUU, GUC, GUA, GUG
6+
Serine (S): UCU, UCC, UCA, UCG, AGU, AGC
7+
Proline (P): CCU, CCC, CCA, CCG
8+
Threonine (T): ACU, ACC, ACA, ACG
9+
Alanine(A): GCU, GCC, GCA, GCG
10+
Tyrosine (Y): UAU, UAC
11+
Histidine (H): CAU, CAC
12+
Glutamine (Q): CAA, CAG
13+
Asparagine (N): AAU, AAC
14+
Lysine (K): AAA, AAG
15+
Aspartic Acid (D): GAU, GAC
16+
Glutamic Acid (E): GAA, GAG
17+
Cysteine (C): UGU, UGC
18+
Tryptophan (W): UGG
19+
Artinine (R): CGU, CGC, CGA, CGG, AGA, AGG
20+
Glycine (G): GGU, GGC, GGA, GGG
21+
Stop Codon ('Stop'): UGA, UAA, UAG'''
22+
23+
import re
24+
def protein(rna):
25+
transDict = {}
26+
for line in rnaDict.split('\n'):
27+
for section in line[line.index(':')+1:].replace(' ','').split(','):
28+
transDict[section] = re.findall(r'\(+\'?(\w+)',line)[0]
29+
codec = ''
30+
while len(rna) > 0:
31+
if transDict[rna[:3]] == 'Stop':
32+
pass
33+
else:
34+
codec += transDict[rna[:3]]
35+
rna = rna[3:]
36+
return codec
37+

0 commit comments

Comments
(0)

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /