almaan / stereoscope

Spatial mapping of cell types by integration of transcriptomics data
MIT License
87 stars 26 forks source link

Metric for co-ocurrence of cells within ST Visium spots #15

Closed cartal closed 3 years ago

cartal commented 4 years ago

Hi @almaan ,

I was wondering if there is a way to estimate the co-localisation of cell types within a given spot in the ST Visium datasets. Is this something that can be done with the current implementation? or is it in the works?

almaan commented 4 years ago

Hello again @cartal!

I'm not fully sure of what you mean with "in given spot" - the proportions estimates in a single spot only represents a single observation; meaning that you could for sure look at the raw proportion values to see whether your cell types of interest both have high values - but it's hard to say if this is simply due to whether both types are abundant or if they actually share a pattern of spatial co-localization.

To generally assess co-localization between types, I tend to recommend computing the Pearson correlation across all spots, that is informative of whether the types seem to share (or not) the same spatial distribution.

Maybe you are requesting something more quantitative, a metric of co-localization that is given at a "per spot basis" rather than for the whole section? In case of this, I would recommend the following, assuming you have two cell types (T1 and T2) of interest:

  1. Interpret the proportion values (w(z,s)) as the probability of sampling a cell of a given type (z) from the associated spot (s). That is p(z = T1 | s ) = w(T1,s) and p(z = T1 | s) = w_(T2,s).
  2. Then (assuming independence and an infinite amount of cells) the probability of picking two cells where one is of type T1 and the other type T2 would be p(T_1,T_2 | s) = p(T_1 | s)p(T2 | s) = w(T1,s) * w_(T2,s)
  3. Thus, just cross-multiply your proportion values and you sort of have a metric that is indicative of co-localization of cell types in each respective spot

Maybe I could recommend this pre-print, where we are doing something similar to that (check out the section "Inferring TLSs from cell type proportions")

Hope that answered your question!

cartal commented 4 years ago

Thanks for the quick reply @almaan!

Yes, this is exactly what I was looking for. I will take a look at the preprint and explore your suggestion on my data and be right back.

Regards