repl.it
@panniu/

DNA Amino Acids

Python

No description

fork
loading
Files
  • main.py
main.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
dna = input()
#dna = dna.upper()

dna_rna = {
	"c":"g",
	"a":"u",
	"g":"c",
	"t":"a"
}
codon = {
	"aaa":"Lysine",
	"aag":"Lysine",
	"aau":"Asparagine",
	"aac":"Asparagine",
	"aga":"Arginine",
	"agg":"Arginine",
	"agu":"Serine",
	"agc":"Serine",
	"aua":"Isoleucine",
	"aug":"Methionine",
	"auu":"Isoleucine",
	"auc":"Isoleucine",
	"aca":"Threonine",
	"acg":"Threonine",
	"acu":"Threonine",
	"acc":"Threonine",
	"gaa":"Glutamic Acid",
	"gag":"Glutamic Acid",
	"gau":"Aspartic Acid",
	"gac":"Aspartic Acid",
	"gga":"Glycine",
	"ggg":"Glycine",
	"ggu":"Glycine",
	"ggc":"Glycine",
	"gua":"Valine",
	"gug":"Valine",
	"guu":"Valine",
	"guc":"Valine",
	"gca":"Alanine",
	"gcg":"Alanine",
	"gcu":"Alanine",
	"gcc":"Alanine",
	"uaa":"STOP",
	"uag":"STOP",
	"uau":"Tyrosine",
	"uac":"Tyrosine",
	"uga":"STOP",
	"ugg":"Tryptophan",
	"ugu":"Cysteine",
	"ugc":"Cysteine",
	"uua":"Leucine",
	"uug":"Leucine",
	"uuu":"Phenylalanine",
	"uuc":"Phenylalanine",
	"uca":"Serine",
	"ucg":"Serine",
	"ucu":"Serine",
	"ucc":"Serine",
	"caa":"Glutamine",
	"cag":"Glutamine",
	"cau":"Histidine",
	"cac":"Histidine",
	"cga":"Arginine",
	"cgg":"Arginine",
	"cgu":"Arginine",
	"cgc":"Arginine",
	"cua":"Leucine",
	"cug":"Leucine",
	"cuu":"Leucine",
	"cuc":"Leucine",
	"cca":"Proline",
	"ccg":"Proline",
	"ccu":"Proline",
	"ccc":"Proline"

}
rna = []
try:
	for n in dna:
		rna.append(dna_rna[n])
	rna = ''.join(rna)

	n = 3
	codons = [rna[i * n:(i + 1) * n] for i in range((len(rna) + n - 1) // n )]

	aa = []
	try:
		for c in codons:
			aa.append(codon[c])
		for a in aa:
			print(a)
	except:
		print("Make sure the length of the sequence is divisible by 3")

except:
	print("Make sure your sequence only contains the characters [A,T,C,G]")
Fetching token
?