Commit ·
50b5c11
1
Parent(s): 6031083
update dashboard_region_centric_dashboard with new features and add new data.
Browse files- Data/expr_by_region.pkl +2 -2
- Data/expr_by_region_only_MERFISH.pkl +3 -0
- Data/sub_cell_expression.pickle +2 -2
- app.py +28 -6
Data/expr_by_region.pkl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:46be6d662be7217bd424ada4e9a10f4ea336b7352ee46b7bab6be00a6418e19f
|
| 3 |
+
size 164098
|
Data/expr_by_region_only_MERFISH.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:05aaf2c9f4869d302a67fcc852bb72f6c1f91d6d66ba2c919907ce0f6c7f6207
|
| 3 |
+
size 161876
|
Data/sub_cell_expression.pickle
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d1132d1684d70e49ed1057c9b01acc2385ea50360892ce7babe7d61d30229f1e
|
| 3 |
+
size 758427828
|
app.py
CHANGED
|
@@ -473,20 +473,42 @@ type_selector = pn.widgets.MultiSelect(name='Neurotransmitter selector', options
|
|
| 473 |
with open('./Data/expr_by_region.pkl', 'rb') as pickle_file:
|
| 474 |
dict_expr_by_reg = pickle.load(pickle_file)
|
| 475 |
|
| 476 |
-
|
| 477 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 478 |
|
| 479 |
-
heatmap_data = dict_expr_by_reg[type_selector[0]].loc[division[0]]
|
| 480 |
fig_height = max(200, heatmap_data.shape[0] * 20)
|
| 481 |
# Create HeatMap
|
| 482 |
heatmap = heatmap_data.hvplot.heatmap().opts(
|
| 483 |
cmap='RdYlBu_r', width=600, height=fig_height, tools=['hover'], active_tools=[], colorbar=True,
|
| 484 |
xlabel='Gene', ylabel='Structure', invert_yaxis=True
|
| 485 |
-
)
|
| 486 |
return heatmap
|
| 487 |
|
| 488 |
-
dashboard_region_centric_dashboard = pn.Column(
|
| 489 |
-
|
|
|
|
|
|
|
| 490 |
|
| 491 |
title = "5-HT Transcriptomic"
|
| 492 |
pn.template.BootstrapTemplate(
|
|
|
|
| 473 |
with open('./Data/expr_by_region.pkl', 'rb') as pickle_file:
|
| 474 |
dict_expr_by_reg = pickle.load(pickle_file)
|
| 475 |
|
| 476 |
+
with open('./Data/expr_by_region_only_MERFISH.pkl', 'rb') as pickle_file:
|
| 477 |
+
dict_expr_by_reg_only_MERFISH = pickle.load(pickle_file)
|
| 478 |
+
division_selector = pn.widgets.MultiSelect(name='Division selector', options=["Whole brain"] + order_division,
|
| 479 |
+
value=[(["Whole brain"] + order_division)[0]])
|
| 480 |
+
type_selector = pn.widgets.MultiSelect(name='Neurotransmitter selector',
|
| 481 |
+
options=["Tot", 'Glut', 'GABA', 'Glut-GABA', 'Dopa', '', 'GABA-Glyc', 'Chol',
|
| 482 |
+
'Hist', 'Sero', 'Nora'], value=["Tot"])
|
| 483 |
+
data_source_selector = pn.widgets.RadioButtonGroup(name='Data Source Selector', options=['Default', 'MERFISH'],
|
| 484 |
+
value='Default')
|
| 485 |
+
sortby_selector = pn.widgets.Select(name='Sort by', options=["region"] + list(selected_genes), value="region")
|
| 486 |
+
|
| 487 |
+
|
| 488 |
+
@pn.depends(division_selector, type_selector, data_source_selector, sortby_selector)
|
| 489 |
+
def heatmap_region_centric(division, type_selector, data_source, sortby):
|
| 490 |
+
if data_source == 'Default':
|
| 491 |
+
data_dict = dict_expr_by_reg
|
| 492 |
+
else:
|
| 493 |
+
data_dict = dict_expr_by_reg_only_MERFISH
|
| 494 |
+
|
| 495 |
+
if sortby == "region":
|
| 496 |
+
heatmap_data = data_dict[type_selector[0]].loc[division[0]]
|
| 497 |
+
else:
|
| 498 |
+
heatmap_data = data_dict[type_selector[0]].loc[division[0]].sort_values(sortby, ascending=False)
|
| 499 |
|
|
|
|
| 500 |
fig_height = max(200, heatmap_data.shape[0] * 20)
|
| 501 |
# Create HeatMap
|
| 502 |
heatmap = heatmap_data.hvplot.heatmap().opts(
|
| 503 |
cmap='RdYlBu_r', width=600, height=fig_height, tools=['hover'], active_tools=[], colorbar=True,
|
| 504 |
xlabel='Gene', ylabel='Structure', invert_yaxis=True
|
| 505 |
+
)
|
| 506 |
return heatmap
|
| 507 |
|
| 508 |
+
dashboard_region_centric_dashboard = pn.Column(
|
| 509 |
+
pn.Row(data_source_selector, division_selector, type_selector, sortby_selector),
|
| 510 |
+
heatmap_region_centric
|
| 511 |
+
)
|
| 512 |
|
| 513 |
title = "5-HT Transcriptomic"
|
| 514 |
pn.template.BootstrapTemplate(
|