Spaces:
Runtime error
Runtime error
Commit ·
9beb97d
1
Parent(s): 9d5526e
generate heatmaps on update
Browse files411 unmodified lines412413414415416417418419420421422423424425426427428429411 unmodified linesinputs = [in_locus, anchor1, anchor2, max_gene_checkbox]outputs = [out_img, out_violin, out_violin_new, out_violin_fc]gr.Examples(examples=[['INS', 'chr11:2,289,895', 'chr11:2,298,840'],['INS', 'INS', 'IGF1'],['TSPAN1', 'TSPAN1', 'PIK3R3'],['GCG', 'GCG', 'FAP'],['KRT19', 'chr17:22,220,637', 'chr17:39,591,813'],['LPP', 'chr3:188,097,749', 'chr3:197,916,262'],['CEL', 'chr9:135,937,365', 'chr9:135,973,107']],inputs=inputs,outputs=outputs,fn=perturb, cache_examples=os.getenv('SYSTEM') == 'spaces')run_button.click(perturb, inputs, outputs=outputs)heatmap_button.click(get_heatmaps, [in_locus, anchor1, anchor2, heatmap_size], outputs=out_heatmaps)def set_loop(img, gene, locus1, locus2, heatmap_range, evt: gr.SelectData):h, w = img.shape[:2]idx = evt.index411 unmodified lines412413414415416417418419420421422423424425426427428429430431411 unmodified linesinputs = [in_locus, anchor1, anchor2, max_gene_checkbox]outputs = [out_img, out_violin, out_violin_new, out_violin_fc]gr.Examples(examples=[['INS', 'chr11:2,289,895', 'chr11:2,298,840', False],['INS', 'INS', 'IGF1', False],['TSPAN1', 'TSPAN1', 'PIK3R3', False],['GCG', 'GCG', 'FAP', False],['KRT19', 'chr17:22,220,637', 'chr17:39,591,813', False],['LPP', 'chr3:188,097,749', 'chr3:197,916,262', False],['CEL', 'chr9:135,937,365', 'chr9:135,973,107', False]],inputs=inputs,outputs=outputs,fn=perturb, cache_examples=os.getenv('SYSTEM') == 'spaces')run_button.click(perturb, inputs, outputs=outputs)heatmap_button.click(get_heatmaps, [in_locus, anchor1, anchor2, heatmap_size], outputs=out_heatmaps)anchor1.change(get_heatmaps, [in_locus, anchor1, anchor2, heatmap_size], outputs=out_heatmaps)anchor2.change(get_heatmaps, [in_locus, anchor1, anchor2, heatmap_size], outputs=out_heatmaps)def set_loop(img, gene, locus1, locus2, heatmap_range, evt: gr.SelectData):h, w = img.shape[:2]idx = evt.index
app.py+9-7