LIANA+ has a recently introduced workflow designed for doing cell-cell communication at the single-cell level and taking into account spatial coordinates, which could be useful for your Xenium data. Chunyu Liu led the coding for this work in the habenula, but I'll give some high-level tips here. Her scripts are in this directory.
Choosing bandwidth
Like the bivariate workflow, the inflow workflow depends on a spatial kernel with a tunable bandwidth which controls how cleanly you can pick up local signals or how far apart cells can possibly be determined to be communicating. Here's their guide. Our biological question centered on whether medial and lateral habenula were communicating, and this required a MUCH larger bandwidth than the vignette (we tested up to ~1000um). This was only reasonable in our case because neurons can have very long axons, and habenula is quite neuron-rich. I'm personally not convinced that checking the number of typical neighbors (as recommended in the vignette) is a useful strategy for choosing an appropriate bandwidth.
Computing inflow score
The main output, the inflow score, is computed like:
lrdata = li.mt.inflow(
adata, groupby='cell_type', resource=resource, use_raw=False
)
That's useful for knowing which cells are receiving signals from each cell type, and makes nice visualizations for top-scoring pairs or interesting pairs you already have in mind. But in my mind, the first interesting question was: which cell types are communicating? That's better answered by using the global scores (next)
Global scores
After computing the global scores, Chunyu wrote some nice code here to generate various heatmaps summarizing those scores for each combination of cell types, to get a general idea of which cell types were communicating.
Misc Tips
- This inflow workflow is another tool designed for one sample at a time, so you can compute the scores as an array job over samples, and do something like this to get dataset-wide scores.
- Another interesting idea Chunyu implemented here was generating a cell-type-specificity score for each LR pair. That way you can ask what interactions are unique to a cell type-- it's based on the mean-ratio concept.
We're still in the process of working on some of this so I don't have a clear map other than these tips of what final visualizations are useful, etc, but hopefully this is a nice starting point.
LIANA+ has a recently introduced workflow designed for doing cell-cell communication at the single-cell level and taking into account spatial coordinates, which could be useful for your Xenium data. Chunyu Liu led the coding for this work in the habenula, but I'll give some high-level tips here. Her scripts are in this directory.
Choosing bandwidth
Like the bivariate workflow, the inflow workflow depends on a spatial kernel with a tunable bandwidth which controls how cleanly you can pick up local signals or how far apart cells can possibly be determined to be communicating. Here's their guide. Our biological question centered on whether medial and lateral habenula were communicating, and this required a MUCH larger bandwidth than the vignette (we tested up to ~1000um). This was only reasonable in our case because neurons can have very long axons, and habenula is quite neuron-rich. I'm personally not convinced that checking the number of typical neighbors (as recommended in the vignette) is a useful strategy for choosing an appropriate bandwidth.
Computing inflow score
The main output, the inflow score, is computed like:
That's useful for knowing which cells are receiving signals from each cell type, and makes nice visualizations for top-scoring pairs or interesting pairs you already have in mind. But in my mind, the first interesting question was: which cell types are communicating? That's better answered by using the global scores (next)
Global scores
After computing the global scores, Chunyu wrote some nice code here to generate various heatmaps summarizing those scores for each combination of cell types, to get a general idea of which cell types were communicating.
Misc Tips
We're still in the process of working on some of this so I don't have a clear map other than these tips of what final visualizations are useful, etc, but hopefully this is a nice starting point.