dylanplummer commited on
Commit
ef7f813
·
1 Parent(s): 26a358d

change default heatmap res params

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -197,11 +197,11 @@ def get_heatmap_locus(gene, locus1, locus2, heatmap_range):
197
  heatmap_locus = f'{chrom}:{locus_start}-{locus_end}'
198
  heatmap_size = abs(locus_start - locus_end)
199
  res = 'deeploop'
200
- if heatmap_size > 3000000:
201
  res = '50kb'
202
- if heatmap_size > 7000000:
203
  res = '200kb'
204
- if heatmap_size > 12000000:
205
  res = '500kb'
206
  print(heatmap_locus, res)
207
  return heatmap_locus, res
@@ -417,18 +417,18 @@ with gr.Blocks(theme='WeixuanYuan/Soft_dark') as demo:
417
  with gr.Row():
418
  with gr.Column():
419
  in_locus = gr.Textbox(label="Target Gene", elem_id='in-locus', scale=1)
 
420
  anchor1 = gr.Textbox(label="Locus 1 (gene or genomic coords)", elem_id='anchor1', scale=1)
421
  anchor2 = gr.Textbox(label="Locus 2 (gene or genomic coords)", elem_id='anchor2', scale=1)
422
  heatmap_x = gr.Textbox(label="Heatmap X", elem_id='heatmap-x', scale=1, visible=False)
423
  heatmap_y = gr.Textbox(label="Heatmap Y", elem_id='heatmap-y', scale=1, visible=False)
424
- max_gene_checkbox = gr.Checkbox(label="Max Gene", elem_id='max-gene-checkbox', scale=1, checked=False)
425
- heatmap_size = gr.Slider(label="Heatmap Range", info="kb range aroung input gene locus to expand", minimum=50, maximum=30000, value=2000)
426
  with gr.Row():
427
  out_heatmaps = []
428
  for celltype in cooler_celltypes:
429
  out_heatmaps.append(gr.Image(label=celltype, elem_id=f'out-heatmap-{celltype}', scale=1))
430
  with gr.Row():
431
- heatmap_button = gr.Button(value="Generate Heatmaps", elem_id='heatmap-button', scale=1)
432
  run_button = gr.Button(value="Run", elem_id='run-button', scale=1)
433
  with gr.Row():
434
  out_img = gr.Image(elem_id='out-img', scale=1)
 
197
  heatmap_locus = f'{chrom}:{locus_start}-{locus_end}'
198
  heatmap_size = abs(locus_start - locus_end)
199
  res = 'deeploop'
200
+ if heatmap_size > 6000000:
201
  res = '50kb'
202
+ if heatmap_size > 20000000:
203
  res = '200kb'
204
+ if heatmap_size > 50000000:
205
  res = '500kb'
206
  print(heatmap_locus, res)
207
  return heatmap_locus, res
 
417
  with gr.Row():
418
  with gr.Column():
419
  in_locus = gr.Textbox(label="Target Gene", elem_id='in-locus', scale=1)
420
+ max_gene_checkbox = gr.Checkbox(label="Max Gene", elem_id='max-gene-checkbox', scale=1, checked=False)
421
  anchor1 = gr.Textbox(label="Locus 1 (gene or genomic coords)", elem_id='anchor1', scale=1)
422
  anchor2 = gr.Textbox(label="Locus 2 (gene or genomic coords)", elem_id='anchor2', scale=1)
423
  heatmap_x = gr.Textbox(label="Heatmap X", elem_id='heatmap-x', scale=1, visible=False)
424
  heatmap_y = gr.Textbox(label="Heatmap Y", elem_id='heatmap-y', scale=1, visible=False)
425
+ heatmap_size = gr.Slider(label="Heatmap Range", info="kb range aroung input gene locus to expand", minimum=50, maximum=5000, value=500)
426
+ heatmap_button = gr.Button(value="Generate Heatmaps", elem_id='heatmap-button', scale=1)
427
  with gr.Row():
428
  out_heatmaps = []
429
  for celltype in cooler_celltypes:
430
  out_heatmaps.append(gr.Image(label=celltype, elem_id=f'out-heatmap-{celltype}', scale=1))
431
  with gr.Row():
 
432
  run_button = gr.Button(value="Run", elem_id='run-button', scale=1)
433
  with gr.Row():
434
  out_img = gr.Image(elem_id='out-img', scale=1)