drieslab / Giotto

Spatial omics analysis toolbox
https://drieslab.github.io/Giotto_website/
Other
240 stars 95 forks source link

Spatial correlation without preprocessing #70

Open melanieloth opened 3 years ago

melanieloth commented 3 years ago

Hello,

I am interested in using Giotto to calculate spatial correlations on a reduced dimension representation (NMF) of my visium spatial transcriptomic data. Is it possible to calculate the spatial correlation without going through the Giotto pipeline?

Thank you, Melanie

RubD commented 3 years ago

Hi Melanie,

I'm not entirely sure if I understand exactly what you want to do. Do you want to calculate spatial correlations for genes or for the factors of your NMF? Currently, the spatial gene detection methods and spatial correlation method detectSpatialCorGenes only work on the gene expression matrix. I would need a bit of time to think about how easy it would be to extend it to other types of input (e.g. NMF, PCA, ...) in the future.

Apologies if I did not understand it correctly. I could think about some simple hacks so that you wouldn't have to go through the whole pipeline, once I know what you want to do. Alternatively, I can also show you the minimum commands that you need for the detectSpatialCorGenes to work. Which is perhaps 3 or 4 commands only.

Thanks for checking out Giotto, Ruben

melanieloth commented 3 years ago

I used CoGAPS to preform NMF on my spatial expression matrix resulting into two matrices. One matrix is genes by patterns and the other is patterns by spots where the patterns are signatures identified in the original data. I want to calculate the spatial correlation of different pattern weights across the spots. I was thinking of using the pattern by spot matrix as the input for Giotto where we can think of the patterns as the genes and then calculate the spatial correlation.

RubD commented 3 years ago

Ok, I see. That's more or less what I guessed it would be. So that's currently not possible, but we do have slots to store similar data (e.g. from spot spatial cell type enrichment or spot deconvolution analysis) and maybe that could be used as input. I need to check my code to see how feasible that is in the short term.

melanieloth commented 3 years ago

Hello, Did you get the chance to check if we could use data stored in slots as input for calculating spatial correlation? Thank you

RubD commented 3 years ago

Hi, It's not yet possible without some hacking of the code and I currently don't have the bandwidth to work on this issue. Once we've released the new version I might be able to look into it. Which specific function command would you like to use? Perhaps I could write a generic function that accepts a simple matrix. Best, Ruben