BayraktarLab / cell2location

Comprehensive mapping of tissue cell architecture via integrated single cell and spatial transcriptomics (cell2location model)
https://cell2location.readthedocs.io/en/latest/
Apache License 2.0
324 stars 58 forks source link

cell abundance quantile #148

Closed wangjiawen2013 closed 1 year ago

wangjiawen2013 commented 2 years ago

Hi, how to explain deconvolution results stored in adata.obsm 'means_cell_abundance_w_sf', 'q05_cell_abundance_w_sf', 'q95_cell_abundance_w_sf' ? In my opinion, the cell numbers should be constant in each spot, why cell2location give many different values(q05, q95, mean) ? which one should I use to plot ?

vitkl commented 2 years ago

Hi @wangjiawen2013

Cell2location estimates the posterior distribution of cell abundance - rather than one value. This distribution represents the uncertainty in the numbers. You can interpret q05, which corresponds to 5% quantile of the posterior distribution, as a high-confidence cell abundance. In a quantitative benchmark, we saw that 5% quantile provides a slightly more accurate result.

If you would like to learn more about Bayesian statistics and posterior distributions I recommend looking into the Statistical Rethinking course and the book: https://www.youtube.com/watch?v=BYUykHScxj8&list=PLDcUM9US4XdMROZ57-OIRtIK0aOynbgZN&index=1.

vitkl commented 1 year ago

I am assuming that this is resolved.