-
Notifications
You must be signed in to change notification settings - Fork 0
/
mRNAutomator.sh
executable file
·118 lines (111 loc) · 1.69 KB
/
mRNAutomator.sh
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/bash
#mRNAutomator by Isaac Moore
#03/18/2012
#==FUNCTIONS==
#Function to sanitize the entered DNA sequence
sanitize() {
case "${dna}" in
*[^agtc]*)
clear
echo "Invalid sequence"
exit 1
;;
esac
length=${#dna}
if [ "$length" != "3" ]; then
clear
echo "Invalid sequence"
exit 1
fi
}
#Function to calculate the mRNA sequence from the given DNA sequence
calcMRNA() {
mRNA=$(tr agtcAGTC UCAGUCAG <<< "$dna")
}
#Function to calculate the Amino Acid pair from the pre-calculated mRNA sequence
calcAminoAcid() {
case "$mRNA" in
UUU|UUC)
aminoAcid="Phenylalanine"
;;
UUA|UUG)
aminoAcid="Leucine"
;;
UC*|AGU|AGC)
aminoAcid="Serine"
;;
UAU|UAC)
aminoAcid="Tyrosine"
;;
UAA|UAG|UGA)
aminoAcid="Stop Codon"
;;
UGU|UGC)
aminoAcid="Cysteine"
;;
UGG)
aminoAcid="Tryptophan"
;;
CU*)
aminoAcid="Leucine"
;;
CC*)
aminoAcid="Proline"
;;
CAU|CAC)
aminoAcid="Histidine"
;;
CAA|CAG)
aminoAcid="Glutamine"
;;
CG*|AGA|AGG)
aminoAcid="Arginine"
;;
AUU|AUC|AUA)
aminoAcid="Isoleucine"
;;
AUG)
aminoAcid="Methionine"
;;
AC*)
aminoAcid="Threonine"
;;
AAU|AAC)
aminoAcid="Asparagine"
;;
AAA|AAG)
aminoAcid="Lysine"
;;
GU*)
aminoAcid="Valine"
;;
GC*)
aminoAcid="Alanine"
;;
GAU|GAC)
aminoAcid="Aspartic Acid"
;;
GAA|GAG)
aminoAcid="Glutamic Acid"
;;
GG*)
aminoAcid="Glycine"
;;
esac
}
#Function to calculate the tRNA sequence from the pre-calculated mRNA sequence
calcTRNA() {
tRNA=$(tr acgtT ACGUU <<< "$dna")
}
#==END FUNCTIONS==
echo "==mRNAutomator=="
read -p "Please enter a DNA strand: " dna
sanitize
calcMRNA
clear
echo "mRNA Sequence:" ${mRNA}
calcAminoAcid
echo "Amino Acid pair:" ${aminoAcid}
calcTRNA
echo "tRNA Sequence:" ${tRNA}
exit 0