maom commited on
Commit
61ae154
·
verified ·
1 Parent(s): 466adbf

make the input and download button on the same line

Browse files
Files changed (1) hide show
  1. app.py +13 -12
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
- gene_id = st.text_input(
32
- label = "Gene ID",
33
- value = "CNAG_04365",
34
- max_chars = 10,
35
- help = "CNAG Gene ID e.g. CNAG_04365")
 
 
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
- label="Download data as TSV",
48
- data = top_coexp_hits.to_csv(sep ='\t').encode('utf-8'),
49
- file_name= f"top_coexp_hits_{gene_id}.tsv",
50
- mime="text/csv")
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)