maom commited on
Commit
44662fb
·
verified ·
1 Parent(s): 6ff7501

add download button

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -56,7 +56,7 @@ estimated_expression = estimated_expression["estimated_expression"].to_pandas()
56
  #DEBUG
57
  print(f"estimated_expression shape: {estimated_expression.shape}")
58
 
59
- col1, col2, padding = st.columns(spec = [0.2, 0.2, 0.6])
60
  with col1:
61
  gene_id_1 = st.text_input(
62
  label = "Gene ID 1",
@@ -94,6 +94,15 @@ chart_data = chart_data.merge(
94
  right = estimated_expression_meta,
95
  on = "run_accession")
96
 
 
 
 
 
 
 
 
 
 
97
  st.markdown(f"""
98
  #### Gene 1:
99
  * *Gene ID*: [{gene_id_1}](https://fungidb.org/fungidb/app/record/gene/{gene_id_1})
 
56
  #DEBUG
57
  print(f"estimated_expression shape: {estimated_expression.shape}")
58
 
59
+ col1, col2, col3, padding = st.columns(spec = [0.2, 0.2, 0.2, 0.4])
60
  with col1:
61
  gene_id_1 = st.text_input(
62
  label = "Gene ID 1",
 
94
  right = estimated_expression_meta,
95
  on = "run_accession")
96
 
97
+ with col3:
98
+ st.text('') # help alignment with input box
99
+ st.download_button(
100
+ label = "Download data as TSV",
101
+ data = chart_data.to_csv(sep ='\t').encode('utf-8'),
102
+ file_name = f"CryptoCEN_expression_{gene_id_1}_vs_{gene_id_2}.tsv",
103
+ mime = "text/csv")
104
+
105
+
106
  st.markdown(f"""
107
  #### Gene 1:
108
  * *Gene ID*: [{gene_id_1}](https://fungidb.org/fungidb/app/record/gene/{gene_id_1})