minwoosun commited on
Commit
8686715
1 Parent(s): 31a75e1

disable file upload for default data selection && remove css black color

Browse files
Files changed (1) hide show
  1. app.py +16 -1
app.py CHANGED
@@ -70,6 +70,13 @@ def plot_umap(adata):
70
  return img
71
 
72
 
 
 
 
 
 
 
 
73
  def main(input_file_path, species, default_dataset):
74
 
75
  # Get the current working directory
@@ -209,7 +216,7 @@ if __name__ == "__main__":
209
  Upload a `.h5ad` single cell gene expression file and select the species (Human/Mouse).
210
  The demo will generate UMAP projections of the embeddings and allow you to download the embeddings for further analysis.
211
  </div>
212
- <div style="margin-bottom:20px; color: black;">
213
  <ol style="list-style:none; padding-left:0;">
214
  <li>1. Upload your `.h5ad` file or select one of the default datasets (subset of 10x pbmc data)</li>
215
  <li>2. Select the species</li>
@@ -232,6 +239,14 @@ if __name__ == "__main__":
232
  with gr.Row():
233
  species_input = gr.Dropdown(choices=["human", "mouse"], label="Select species")
234
  default_dataset_input = gr.Dropdown(choices=["None", "PBMC 100 cells", "PBMC 1000 cells"], label="Select default dataset")
 
 
 
 
 
 
 
 
235
  run_button = gr.Button("Run", elem_classes="run-button")
236
 
237
  # Arrange UMAP plot and file output side by side
 
70
  return img
71
 
72
 
73
+ def toggle_file_input(default_dataset):
74
+ if default_dataset != "None":
75
+ return gr.update(interactive=False) # Disable the file input if a default dataset is selected
76
+ else:
77
+ return gr.update(interactive=True) # Enable the file input if no default dataset is selected
78
+
79
+
80
  def main(input_file_path, species, default_dataset):
81
 
82
  # Get the current working directory
 
216
  Upload a `.h5ad` single cell gene expression file and select the species (Human/Mouse).
217
  The demo will generate UMAP projections of the embeddings and allow you to download the embeddings for further analysis.
218
  </div>
219
+ <div style="margin-bottom:20px;">
220
  <ol style="list-style:none; padding-left:0;">
221
  <li>1. Upload your `.h5ad` file or select one of the default datasets (subset of 10x pbmc data)</li>
222
  <li>2. Select the species</li>
 
239
  with gr.Row():
240
  species_input = gr.Dropdown(choices=["human", "mouse"], label="Select species")
241
  default_dataset_input = gr.Dropdown(choices=["None", "PBMC 100 cells", "PBMC 1000 cells"], label="Select default dataset")
242
+
243
+ # Attach the `change` event to the dropdown
244
+ default_dataset_input.change(
245
+ toggle_file_input,
246
+ inputs=[default_dataset_input],
247
+ outputs=[file_input]
248
+ )
249
+
250
  run_button = gr.Button("Run", elem_classes="run-button")
251
 
252
  # Arrange UMAP plot and file output side by side