Spaces:
Runtime error
Runtime error
Commit ·
44a3abc
1
Parent(s): 28c4be5
fix celltype heatmap gen
Browse files
app.py
CHANGED
|
@@ -41,9 +41,9 @@ graph_file = hf_hub_download(repo_id="dylanplummer/islet-epigenome", filename=f"
|
|
| 41 |
rna_file = unzip(rna_file)
|
| 42 |
hic_file = unzip(hic_file)
|
| 43 |
|
| 44 |
-
|
| 45 |
coolers = []
|
| 46 |
-
for celltype in
|
| 47 |
cooler_file = hf_hub_download(repo_id="dylanplummer/islet-epigenome", filename=f"pseudobulk_coolers/{celltype}_50kb.cool", repo_type="dataset", token=os.environ['DATASET_SECRET'])
|
| 48 |
coolers.append(cooler.Cooler(cooler_file))
|
| 49 |
beta_cooler = coolers[1]
|
|
@@ -206,7 +206,7 @@ def get_heatmap(celltype, gene, locus1, locus2, heatmap_range):
|
|
| 206 |
|
| 207 |
def get_heatmaps(gene, locus1, locus2, heatmap_range):
|
| 208 |
res = []
|
| 209 |
-
for celltype in
|
| 210 |
res.append(get_heatmap(celltype, gene, locus1, locus2, heatmap_range))
|
| 211 |
alpha, beta, delta, pp, acinar, duct, psc, endothelial = res
|
| 212 |
return alpha, beta, delta, pp, acinar, duct, psc, endothelial
|
|
@@ -341,7 +341,7 @@ with gr.Blocks(theme='WeixuanYuan/Soft_dark') as demo:
|
|
| 341 |
heatmap_size = gr.Slider(label="Heatmap Range", info="kb range aroung input gene locus to expand", minimum=50, maximum=30000, value=2000)
|
| 342 |
with gr.Row():
|
| 343 |
out_heatmaps = []
|
| 344 |
-
for celltype, c in zip(
|
| 345 |
out_heatmaps.append(gr.Image(label=celltype, elem_id=f'out-heatmap-{celltype}', scale=1))
|
| 346 |
with gr.Row():
|
| 347 |
heatmap_button = gr.Button(value="Generate Heatmaps", elem_id='heatmap-button', scale=1)
|
|
|
|
| 41 |
rna_file = unzip(rna_file)
|
| 42 |
hic_file = unzip(hic_file)
|
| 43 |
|
| 44 |
+
cooler_celltypes = ['Alpha', 'Beta', 'Delta', 'PP', 'Acinar', 'Duct', 'PSC', 'Endothelial']
|
| 45 |
coolers = []
|
| 46 |
+
for celltype in cooler_celltypes:
|
| 47 |
cooler_file = hf_hub_download(repo_id="dylanplummer/islet-epigenome", filename=f"pseudobulk_coolers/{celltype}_50kb.cool", repo_type="dataset", token=os.environ['DATASET_SECRET'])
|
| 48 |
coolers.append(cooler.Cooler(cooler_file))
|
| 49 |
beta_cooler = coolers[1]
|
|
|
|
| 206 |
|
| 207 |
def get_heatmaps(gene, locus1, locus2, heatmap_range):
|
| 208 |
res = []
|
| 209 |
+
for celltype in cooler_celltypes:
|
| 210 |
res.append(get_heatmap(celltype, gene, locus1, locus2, heatmap_range))
|
| 211 |
alpha, beta, delta, pp, acinar, duct, psc, endothelial = res
|
| 212 |
return alpha, beta, delta, pp, acinar, duct, psc, endothelial
|
|
|
|
| 341 |
heatmap_size = gr.Slider(label="Heatmap Range", info="kb range aroung input gene locus to expand", minimum=50, maximum=30000, value=2000)
|
| 342 |
with gr.Row():
|
| 343 |
out_heatmaps = []
|
| 344 |
+
for celltype, c in zip(cooler_celltypes, coolers):
|
| 345 |
out_heatmaps.append(gr.Image(label=celltype, elem_id=f'out-heatmap-{celltype}', scale=1))
|
| 346 |
with gr.Row():
|
| 347 |
heatmap_button = gr.Button(value="Generate Heatmaps", elem_id='heatmap-button', scale=1)
|