Spaces:
Runtime error
Runtime error
jennzhuge
commited on
Commit
·
2c039db
1
Parent(s):
964fd26
hi
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import json
|
2 |
import pandas as pd
|
3 |
import gradio as gr
|
4 |
-
from transformers import PreTrainedTokenizerFast, BertForMaskedLM
|
5 |
from datasets import load_dataset
|
6 |
import infer
|
7 |
|
@@ -68,13 +68,15 @@ with gr.Blocks() as demo:
|
|
68 |
gr.Markdown("Enter a DNA sequence and the coordinates at which its sample was taken to get a genus prediction. Click 'I'm feeling lucky' to see a prediction for a random sequence.")
|
69 |
|
70 |
# Collect inputs for app (DNA and location)
|
71 |
-
with gr.
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
78 |
|
79 |
with gr.Row():
|
80 |
btn_run = gr.Button("Run")
|
@@ -91,11 +93,13 @@ with gr.Blocks() as demo:
|
|
91 |
|
92 |
with gr.Tab('DNA Embedding Space Similarity Visualizer'):
|
93 |
gr.Markdown("If the highest genus probability is very low for your DNA sequence, we can still examine the DNA embedding of the sequence in relation to known samples for clues.")
|
94 |
-
|
95 |
-
|
|
|
|
|
96 |
|
97 |
-
|
98 |
-
|
99 |
|
100 |
|
101 |
|
|
|
1 |
import json
|
2 |
import pandas as pd
|
3 |
import gradio as gr
|
4 |
+
# from transformers import PreTrainedTokenizerFast, BertForMaskedLM
|
5 |
from datasets import load_dataset
|
6 |
import infer
|
7 |
|
|
|
68 |
gr.Markdown("Enter a DNA sequence and the coordinates at which its sample was taken to get a genus prediction. Click 'I'm feeling lucky' to see a prediction for a random sequence.")
|
69 |
|
70 |
# Collect inputs for app (DNA and location)
|
71 |
+
with gr.row():
|
72 |
+
with gr.Column():
|
73 |
+
inp_dna = gr.Textbox(label="DNA", placeholder="e.g. AACAATGTA... (min 200 and max 660 characters)")
|
74 |
+
|
75 |
+
with gr.Column():
|
76 |
+
with gr.Row():
|
77 |
+
inp_lat = gr.Textbox(label="Latitude", placeholder="e.g. -3.009083")
|
78 |
+
with gr.Row():
|
79 |
+
inp_lng = gr.Textbox(label="Longitude", placeholder="e.g. -58.68281")
|
80 |
|
81 |
with gr.Row():
|
82 |
btn_run = gr.Button("Run")
|
|
|
93 |
|
94 |
with gr.Tab('DNA Embedding Space Similarity Visualizer'):
|
95 |
gr.Markdown("If the highest genus probability is very low for your DNA sequence, we can still examine the DNA embedding of the sequence in relation to known samples for clues.")
|
96 |
+
|
97 |
+
with gr.Row():
|
98 |
+
with gr.Column():
|
99 |
+
gr.Markdown("Plot of your DNA sequence among other known species clusters.")
|
100 |
|
101 |
+
with gr.Column():
|
102 |
+
gr.Markdown("Plot of the five most common species at your sample coordinate.")
|
103 |
|
104 |
|
105 |
|