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

Option to treat y_s as detection probability #118

Open vitkl opened 2 years ago

vitkl commented 2 years ago

Published cell2location uses the following prior on y_s detection sensitivity:

y_s ~ Gamma(detection_alpha, detection_alpha * y_e)
y_e ~ Gamma(alpha, alpha * mu)
detection_alpha = 200
alpha = 10
mu = (spatial_total_UMI / N_cells_per_location) / scRNAreference_total_UMI

This PR adds an option to treat y_s as the detection probability:

y_s ~ Beta(detection_alpha * y_e, detection_alpha * (1 - y_e))
y_e ~ Beta(alpha * p, alpha * (1 - p))
detection_alpha = 2000
alpha = 100
p = (spatial_total_UMI / N_cells_per_location) / scRNAreference_total_UMI

with alpha priors scaled to result in y_e and y_s with the same prior variance as the published model.