Skip to content

Commit 8dba3dc

Browse files
authored
Merge pull request #53 from broadinstitute/DEGA-138-Clustergrammer-PY
bringing in Clustergrammer-PY back-end
2 parents 2f435bb + b24b6fe commit 8dba3dc

32 files changed

+4127
-16
lines changed

docs/python/clust/api.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Clust Module API Reference
2+
3+
::: celldega.clust

docs/python/index.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Python API Overview
22

3-
## [Neighborhood Overview](nbhd/api)
4-
The `nbhd` module contains methods for calculating tissue neighborhoods.
5-
63
## [Pre Module Overview](pre/api)
7-
84
The `pre` module contains methods for pre-processing LandscapeFiles.
95

6+
## [Clust Module Overview](clust/api)
7+
The `clust` module contains methods for clustering high-dimensional data.
108

11-
## [Viz Module Overview](viz/api)
9+
## [Neighborhood Overview](nbhd/api)
10+
The `nbhd` module contains methods for calculating tissue neighborhoods.
1211

12+
## [Viz Module Overview](viz/api)
1313
The `viz` module contains functions and classes for data visualization.

docs/python/nbhd/api.md

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# Neighborhood Module API Reference
22

3-
<!-- ::: celldega.pre.landscape -->
4-
<!-- ::: celldega.pre -->
53
::: celldega.nbhd

docs/python/viz/api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
## Widget Classes
44

5-
::: celldega.viz.widget
5+
::: celldega.viz
66

js/deck-gl/make_tooltip.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ export const make_tooltip = (viz_state, info) => {
88
let inst_name = ''
99
let inst_cat = ''
1010

11-
console.log(info.layer.id)
12-
1311
if (info.layer.id.startsWith('cell-layer') || info.layer.id.startsWith('path-layer')) {
1412
inst_name = info.layer.id.startsWith('cell-layer') ? viz_state.cats.cell_names_array[info.index] : viz_state.cats.polygon_cell_names[info.index]
1513
inst_cat = viz_state.cats.dict_cell_cats[inst_name]
@@ -26,8 +24,16 @@ export const make_tooltip = (viz_state, info) => {
2624
inst_html = `<div>neighborhood: ${inst_name}</div><div>cluster: ${inst_cat}</div>`
2725
}
2826

29-
d3.selectAll('.deck-tooltip')
30-
.style('margin-top', '75px')
27+
// d3.selectAll('.deck-tooltip')
28+
// .style('margin-top', '75px')
29+
30+
// console.log(viz_state.root)
31+
32+
// select the parent element of .deck-tooltip within viz_state.root
33+
const tooltipContainer = viz_state.root.querySelector('.deck-tooltip');
34+
tooltipContainer.style.marginTop = '50px'
35+
const tooltipParent = tooltipContainer.parentElement.parentElement;
36+
tooltipParent.style.position = 'unset'
3137

3238
return {
3339
html: inst_html,

js/deck-gl/matrix/matrix_tooltip.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ export const get_tooltip = (viz_state, params) => {
44

55
const {object, layer} = params;
66

7-
d3.selectAll('.deck-tooltip')
8-
.style('margin-top', '50px')
7+
// select the parent element of .deck-tooltip within viz_state.root
8+
const tooltipContainer = viz_state.root.querySelector('.deck-tooltip');
9+
tooltipContainer.style.marginTop = '50px'
10+
const tooltipParent = tooltipContainer.parentElement.parentElement;
11+
tooltipParent.style.position = 'unset'
912

1013
if (object) {
1114
// Check which layer the tooltip is currently over

js/viz/landscape_ist.js

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export const landscape_ist = async (
5151

5252
let viz_state = {}
5353

54+
viz_state.root = el
55+
5456
viz_state.buttons = {}
5557
viz_state.buttons.blue = '#8797ff'
5658
viz_state.buttons.gray = 'gray'

mkdocs.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ nav:
2222
- Python API:
2323
- python/index.md
2424
- pre: python/pre/api.md
25+
- clust: python/clust/api.md
26+
- nbhd: python/nbhd/api.md
2527
- viz: python/viz/api.md
2628

2729
- JavaScript API:
@@ -39,6 +41,7 @@ nav:
3941
- examples/index.md
4042
- Brief Notebooks:
4143
- Landscape View Xenium: examples/brief_notebooks/Landscape_View_Xenium.ipynb
44+
- Landscape-Matrix View Xenium: examples/brief_notebooks/Landscape-Matrix_Xenium.ipynb
4245
- Pre-Process LandscapeFiles: examples/brief_notebooks/Pre-process_Xenium_V1_human_Pancreas_FFPE_outs.ipynb
4346
# - Tutorials:
4447
# - examples/Landscape_View_Xenium.ipynb

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ dependencies = [
1717
"imagecodecs~=2024.1.1",
1818
"scanpy~=1.10.2",
1919
"squidpy~=1.5.0",
20-
"clustergrammer2==0.18.0",
2120
"shapely~=2.0.5",
2221
"polars~=1.10.0",
2322
"libpysal~=4.8.1"

src/celldega/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from celldega.pre import landscape
55
from celldega.nbhd import alpha_shape
66

7+
from celldega.clust import Network
8+
79
# temporary fix for libpysal warning
810
import warnings
911
warnings.filterwarnings("ignore", category=FutureWarning)

0 commit comments

Comments
 (0)