kharchenkolab / Baysor

Bayesian Segmentation of Spatial Transcriptomics Data
https://kharchenkolab.github.io/Baysor/
MIT License
152 stars 31 forks source link

Question about assignment of transcripts in overlapping regions #120

Closed Jwong684 closed 1 month ago

Jwong684 commented 5 months ago

Hi Kharchenko lab,

I've been trying to implement Baysor on my CosMx data. I wanted some clarification about what Baysor does to overlapping regions.

From my understanding of your paper, it essentially tries to correlate transcripts within the overlapping regions with neighbouring cells and assigns these transcripts to the cell that had the best correlation with the region. I.e. if there are a mix of transcript A and transcript B in an overlapping region, and cell A has a good distribution of transcript A, and cell B of transcript B, then all transcript A's in the overlapping region will be assigned to cell A and transcript B's with cell B.

Is that a good assumption to make? I noticed that the number of cells I get after segmentation seemingly doubles from the default segmentation by CellPose.

VPetukhov commented 2 months ago

Hi, your explanation is correct. I'd only add that it also tries to preserve cell continuity. In 2D continuity is guaranteed, and in 3D continuity is not properly defined, but it's in some way preserved.

Regarding doubling the number of cells, it's possible, especially if you're not using a strict threshold on the min. number of molecules. Many cells can be missing DAPI signal, and that's one of the big reasons we made Baysor.