Open grst opened 9 months ago
I'd like to CC @AnnaChristina here who's also been working on this AFAIK.
@timtreis, here is one for "spatial perturbation analysis" already
@grst we're discussing this now and might get back with an update here
@Zethson we discussed this before going on holiday, we have a zulip channel for that, I'll add you
cellcharter already has a function for differential neighborhood enrichment that does statistics on the sample level: https://github.com/CSOgroup/cellcharter/blob/396c415f706e46ce5d9b82df062d0b6509aa526e/src/cellcharter/gr/_nhood.py#L136
Most functions in squidpy seem to be centered around analyzing a single sample. For me, in the context of clinical trials, it would be important to compare between sample groups. The usual variables of interest are
A few things that came to my mind
Would be great to have dedicated functions for this, and happy about further ideas!
CC @Zethson, because this is basically "spatial pertpy"
Example data
adata = cc.datasets.codex_mouse_spleen('./data/codex_mouse_spleen.h5ad')
-> 3 vs. 6Collection of use-cases and implementation ideas
Differential neighborhood enrichment
Sharing here a very simple approach that estimates for each "niche" (e.g. tumor spots), the average neighborhood (i.e. across all spots of that niche, what's the fraction of neighboring niches). This allows to distinguish, for instance, between immune-infiltrated and immune-excluded tumors.
This results in something like this (each column a sample):
Statistics between groups of samples can be computed using a standard linear model.
Visualization idea: (but instead color heatmap by enriched/depleted)