Spaces:
Runtime error
Runtime error
Commit ·
4493ead
1
Parent(s): fa4355c
make it exactly like the docs
Browse files
app.py
CHANGED
|
@@ -196,16 +196,6 @@ def get_heatmap(gene, locus1, locus2):
|
|
| 196 |
return img
|
| 197 |
|
| 198 |
|
| 199 |
-
def set_loop(img, gene, locus1, locus2, evt: gr.SelectData):
|
| 200 |
-
print(evt)
|
| 201 |
-
print(evt.target)
|
| 202 |
-
print(gene, locus1, locus2)
|
| 203 |
-
idx = evt.index
|
| 204 |
-
value = evt.value
|
| 205 |
-
print(idx)
|
| 206 |
-
print(value)
|
| 207 |
-
return idx[0], idx[1]
|
| 208 |
-
|
| 209 |
def perturb(gene, locus1, locus2):
|
| 210 |
locus1 = locus1.replace(',', '')
|
| 211 |
locus2 = locus2.replace(',', '')
|
|
@@ -360,6 +350,15 @@ with gr.Blocks(theme='WeixuanYuan/Soft_dark') as demo:
|
|
| 360 |
fn=perturb, cache_examples=os.getenv('SYSTEM') == 'spaces')
|
| 361 |
run_button.click(perturb, inputs, outputs=outputs)
|
| 362 |
heatmap_button.click(get_heatmap, inputs, outputs=[out_heatmap])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 363 |
out_heatmap.select(set_loop, [out_heatmap, in_locus, anchor1, anchor2], outputs=[anchor1, anchor2])
|
| 364 |
|
| 365 |
|
|
|
|
| 196 |
return img
|
| 197 |
|
| 198 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
def perturb(gene, locus1, locus2):
|
| 200 |
locus1 = locus1.replace(',', '')
|
| 201 |
locus2 = locus2.replace(',', '')
|
|
|
|
| 350 |
fn=perturb, cache_examples=os.getenv('SYSTEM') == 'spaces')
|
| 351 |
run_button.click(perturb, inputs, outputs=outputs)
|
| 352 |
heatmap_button.click(get_heatmap, inputs, outputs=[out_heatmap])
|
| 353 |
+
def set_loop(img, gene, locus1, locus2, evt: gr.SelectData):
|
| 354 |
+
print(evt)
|
| 355 |
+
print(evt.target)
|
| 356 |
+
print(gene, locus1, locus2)
|
| 357 |
+
idx = evt.index
|
| 358 |
+
value = evt.value
|
| 359 |
+
print(idx)
|
| 360 |
+
print(value)
|
| 361 |
+
return idx[0], idx[1]
|
| 362 |
out_heatmap.select(set_loop, [out_heatmap, in_locus, anchor1, anchor2], outputs=[anchor1, anchor2])
|
| 363 |
|
| 364 |
|