Spaces:
Runtime error
Runtime error
Commit ·
9beb97d
1
Parent(s): 9d5526e
generate heatmaps on update
Browse files
app.py
CHANGED
|
@@ -412,18 +412,20 @@ with gr.Blocks(theme='WeixuanYuan/Soft_dark') as demo:
|
|
| 412 |
inputs = [in_locus, anchor1, anchor2, max_gene_checkbox]
|
| 413 |
outputs = [out_img, out_violin, out_violin_new, out_violin_fc]
|
| 414 |
|
| 415 |
-
gr.Examples(examples=[['INS', 'chr11:2,289,895', 'chr11:2,298,840'],
|
| 416 |
-
['INS', 'INS', 'IGF1'],
|
| 417 |
-
['TSPAN1', 'TSPAN1', 'PIK3R3'],
|
| 418 |
-
['GCG', 'GCG', 'FAP'],
|
| 419 |
-
['KRT19', 'chr17:22,220,637', 'chr17:39,591,813'],
|
| 420 |
-
['LPP', 'chr3:188,097,749', 'chr3:197,916,262'],
|
| 421 |
-
['CEL', 'chr9:135,937,365', 'chr9:135,973,107']],
|
| 422 |
inputs=inputs,
|
| 423 |
outputs=outputs,
|
| 424 |
fn=perturb, cache_examples=os.getenv('SYSTEM') == 'spaces')
|
| 425 |
run_button.click(perturb, inputs, outputs=outputs)
|
| 426 |
heatmap_button.click(get_heatmaps, [in_locus, anchor1, anchor2, heatmap_size], outputs=out_heatmaps)
|
|
|
|
|
|
|
| 427 |
def set_loop(img, gene, locus1, locus2, heatmap_range, evt: gr.SelectData):
|
| 428 |
h, w = img.shape[:2]
|
| 429 |
idx = evt.index
|
|
|
|
| 412 |
inputs = [in_locus, anchor1, anchor2, max_gene_checkbox]
|
| 413 |
outputs = [out_img, out_violin, out_violin_new, out_violin_fc]
|
| 414 |
|
| 415 |
+
gr.Examples(examples=[['INS', 'chr11:2,289,895', 'chr11:2,298,840', False],
|
| 416 |
+
['INS', 'INS', 'IGF1', False],
|
| 417 |
+
['TSPAN1', 'TSPAN1', 'PIK3R3', False],
|
| 418 |
+
['GCG', 'GCG', 'FAP', False],
|
| 419 |
+
['KRT19', 'chr17:22,220,637', 'chr17:39,591,813', False],
|
| 420 |
+
['LPP', 'chr3:188,097,749', 'chr3:197,916,262', False],
|
| 421 |
+
['CEL', 'chr9:135,937,365', 'chr9:135,973,107', False]],
|
| 422 |
inputs=inputs,
|
| 423 |
outputs=outputs,
|
| 424 |
fn=perturb, cache_examples=os.getenv('SYSTEM') == 'spaces')
|
| 425 |
run_button.click(perturb, inputs, outputs=outputs)
|
| 426 |
heatmap_button.click(get_heatmaps, [in_locus, anchor1, anchor2, heatmap_size], outputs=out_heatmaps)
|
| 427 |
+
anchor1.change(get_heatmaps, [in_locus, anchor1, anchor2, heatmap_size], outputs=out_heatmaps)
|
| 428 |
+
anchor2.change(get_heatmaps, [in_locus, anchor1, anchor2, heatmap_size], outputs=out_heatmaps)
|
| 429 |
def set_loop(img, gene, locus1, locus2, heatmap_range, evt: gr.SelectData):
|
| 430 |
h, w = img.shape[:2]
|
| 431 |
idx = evt.index
|