Spaces:
Sleeping
Sleeping
make the input and download button on the same line
Browse files
app.py
CHANGED
@@ -28,11 +28,13 @@ top_coexp_hits = datasets.load_dataset(
|
|
28 |
data_files = {"top_coexp_hits": "top_coexp_hits.tsv"})
|
29 |
top_coexp_hits = top_coexp_hits["top_coexp_hits"].to_pandas()
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
36 |
|
37 |
top_coexp_hits = top_coexp_hits[
|
38 |
top_coexp_hits.gene_id_1 == gene_id]
|
@@ -42,12 +44,11 @@ top_coexp_hits = top_coexp_hits[[
|
|
42 |
'coexp_score', 'blastp_EValue']]
|
43 |
top_coexp_hits.reset_index()
|
44 |
|
45 |
-
|
46 |
-
st.download_button(
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
|
53 |
st.table(top_coexp_hits)
|
|
|
28 |
data_files = {"top_coexp_hits": "top_coexp_hits.tsv"})
|
29 |
top_coexp_hits = top_coexp_hits["top_coexp_hits"].to_pandas()
|
30 |
|
31 |
+
col1, col2 = st.columns(spec = [0.7, 0.3])
|
32 |
+
with col1:
|
33 |
+
gene_id = st.text_input(
|
34 |
+
label = "Gene ID",
|
35 |
+
value = "CNAG_04365",
|
36 |
+
max_chars = 10,
|
37 |
+
help = "CNAG Gene ID e.g. CNAG_04365")
|
38 |
|
39 |
top_coexp_hits = top_coexp_hits[
|
40 |
top_coexp_hits.gene_id_1 == gene_id]
|
|
|
44 |
'coexp_score', 'blastp_EValue']]
|
45 |
top_coexp_hits.reset_index()
|
46 |
|
47 |
+
with col2:
|
48 |
+
st.download_button(
|
49 |
+
label="Download data as TSV",
|
50 |
+
data = top_coexp_hits.to_csv(sep ='\t').encode('utf-8'),
|
51 |
+
file_name= f"top_coexp_hits_{gene_id}.tsv",
|
52 |
+
mime="text/csv")
|
|
|
53 |
|
54 |
st.table(top_coexp_hits)
|