MarioniLab / miloR

R package implementation of Milo for testing for differential abundance in KNN graphs
https://bioconductor.org/packages/release/bioc/html/miloR.html
GNU General Public License v3.0
342 stars 22 forks source link

MiloR in spatial transcriptomics data #344

Closed zeniazen5 closed 1 month ago

zeniazen5 commented 4 months ago

Hey there,

I used MiloR to analyze single cell RNA seq data and currently we are wondering if it could be implemented in spatial transcriptomics analysis in comparing distances across conditions.

Using the k nearest neighbor approach in a spatial graph and the statistical analysis of the implemented MiloR to compare two different conditions.

Let me know your thoughts on this and if you find it a good idea in implementig it!

Thank you in advance! Best Zenia

MikeDMorgan commented 4 months ago

Hi @zeniazen5 - fundamentally Milo assumes there is a shared space in which the cell-to-cell relationships are represented in a graph. Therefore, that requires different cells from different samples to be placed into a common space, which I assume is what you refer to as a spatial graph - do you compute this over all samples so that all cells are placed into the same space?

learning-MD commented 4 weeks ago

Hi, sorry to open this up. I was curious about this as well and didn't want to start a new thread.

I have ~50 samples that I put through the Xenium platform with a targeted gene panel. All samples have been integrated together using Seurat's Xenium analysis pipeline. And the reductions include umap and PCA. Since the umap and pca, I think I should be able to construct the KNN graph using the pca dim reduction based on prior comments:

          Hi @emanuelavilla Milo is agnostic to the data type, as long as it fits into the paradigm of features X cells as a `SingleCellExperiment`/`Milo` object and the data can be represented by a NN-graph, then nothing should stop you using Milo for scATAC-seq. Bear in mind that all of the usual caveats and assumptions still apply. We haven't explicitly tested Milo on scATAC-seq data ourselves - so we can't make any guarantess - but I don't see why it shouldn't apply. There will almost certainly be some features of scATAC-seq, i.e., high sparsity, many features that might impact on the graph and subsequent DA testing.

Originally posted by @MikeDMorgan in https://github.com/MarioniLab/miloR/issues/273#issuecomment-1455987319

HelloWorldLTY commented 2 weeks ago

Hi, I think using Milo for in-situ spatial transcriptomic data make sense, as you have single-cell-resoluation information.

MikeDMorgan commented 2 weeks ago

@learning-MD - indeed, if you have good single-cell segmentation, then in theory it should be possible. However, blindly applying Milo to spatial data is not a good idea. I strongly recommend you construct a set of positive and negative controls to make sure that (a) the limited gene space gives sufficient resolution (e.g. equivalent or close to that achieved from HVGs with dissociated single-cell data, (b) that cells from multiple samples are contained in each neighbour. I would also ensure that when running testNhoods, your batching/processing/slides aren't able to perfectly separate zero from non-zero nhood counts using checkSeparation().

DarioS commented 6 days ago

It looks like it is coming soon! image

MikeDMorgan commented 6 days ago

Yes, this is from Davis McCarthy's group - it's not part of the official release, so I'd have a chat with Jarny for the details.