shangll123 / SpatialPCA

Spatially aware dimension reduction for spatial transcriptomics.
40 stars 9 forks source link

Multiple sample SpatialPCA #8

Closed hahia closed 11 months ago

hahia commented 11 months ago

Hello, I'm interested in performing SpatialPCA on multiple spatial transcriptomes. Can SpatialPCA be applied to multiple samples? If I understand correctly, it uses spatial location information, but when I have multiple samples, spatial locations may overlap.

vravik commented 10 months ago

Hi not sure why this issue was closed. I have the same question. If we have matched primary / recurrent slides for the same patient and want to infer trajectories / shared clusters in this data, can we run spatialPCA jointly on the dataset? The examples don't really show how this could be done.

Thank you,

shangll123 commented 10 months ago

Hi vravik,

Thank you for your interest in our method! Here is then multiple tissue sections version of SpatialPCA: https://github.com/shangll123/SpatialPCA/blob/main/R/SpatialPCA_multiple_sample.R. I may need to feature this application in the tutorial and package website...

Best, Lulu

vravik commented 10 months ago

Thank you Lulu, exactly what I was looking for. I have a related question to ask. Is there a more formal way we can select the number of clusters for community detection using the spatial PCs? You seem to have them hard-coded in the examples.

shangll123 commented 10 months ago

This is a very good question, we are working on that, this is a common problem in community detection, and it may need rigorous statistical proof if one want to do it in a very solid way. In k-means we can use elbow method to select the number of clusters, I am not sure in walktrap or louvain do we also have such kind of methods, worth checking on that.

vravik commented 10 months ago

Hi Lulu,

Could I use GMMs on the inferred spatial PC space to identify clusters? With GMMs we have well defined metrics for identifying optimal number of mixtures right?