Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,17 +2,17 @@ import gradio as gr
|
|
2 |
|
3 |
base_pairing = {'A':'U', 'U':'A', 'C':'G','G':'C'}
|
4 |
|
5 |
-
|
6 |
-
|
7 |
### Define location of start codon (AUG)
|
8 |
-
|
9 |
-
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
|
17 |
#######################################################################################
|
18 |
# define dictionary to translate three-letter mRNA to three-letter amino acid here
|
@@ -110,12 +110,12 @@ def get_protein_from_DNA(DNA):
|
|
110 |
|
111 |
results = get_protein_from_DNA(DNA)
|
112 |
|
113 |
-
def highlight_text(string_in):
|
114 |
-
string_in=string_in.replace('<','\033[1m\033[94m')
|
115 |
-
string_in=string_in.replace('>','\033[0m')
|
116 |
-
print(string_in)
|
117 |
|
118 |
-
highlight_text(results)
|
119 |
|
120 |
|
121 |
##configure inputs/outputs
|
|
|
2 |
|
3 |
base_pairing = {'A':'U', 'U':'A', 'C':'G','G':'C'}
|
4 |
|
5 |
+
def transcribe(seq):
|
6 |
+
RNA_seq = seq.replace('T', 'U')
|
7 |
### Define location of start codon (AUG)
|
8 |
+
start_codon = RNA_seq.find('AUG')
|
9 |
+
codons = []
|
10 |
|
11 |
+
for i in range(start_codon, len(RNA_seq), 3):
|
12 |
+
codon = RNA_seq[i:i + 3]
|
13 |
+
if len(codon)==3:
|
14 |
+
codons.append(codon)
|
15 |
+
return codons
|
16 |
|
17 |
#######################################################################################
|
18 |
# define dictionary to translate three-letter mRNA to three-letter amino acid here
|
|
|
110 |
|
111 |
results = get_protein_from_DNA(DNA)
|
112 |
|
113 |
+
#def highlight_text(string_in):
|
114 |
+
#string_in=string_in.replace('<','\033[1m\033[94m')
|
115 |
+
#string_in=string_in.replace('>','\033[0m')
|
116 |
+
#print(string_in)
|
117 |
|
118 |
+
#highlight_text(results)
|
119 |
|
120 |
|
121 |
##configure inputs/outputs
|