dcjones / proseg

Probabilistic cell segmentation for in situ spatial transcriptomics
Other
44 stars 1 forks source link

Shifting centroids / originals not reported #18

Open roanvanscheppingen opened 3 months ago

roanvanscheppingen commented 3 months ago

Adding onto #17 is the difficulty to try to find back the same cells in a proseg run compared to an initial Cosmx run. I use the x-global-px and y-global-px of the Cosmx flatfile as input, and of course this is transformed by factor 0.12 during the proseg run.

Since the proseg output generates its own boundaries and is 'blind' for the initial segmentation, it is creating it's own polygons and centroids. However, given the fact that the unique is not transferred, it's hard to compare. Especially since the centroid moves both in x and y and differs per cell in how much it changes. Therefore a general conversion factor back towards cell centroid is (for now) impossible

For example, I have manually checked the centroids of 2 cells in Seurat Seurat - X = 1,216165 x_global_mm, Y = 15.59431 y_global_mm Proseg - X = 1213,7107, Y = 15557,44

The conversion factors are 997,98 and 997,63

An other example Seurat - X = 1,246355, Y = 15,58228 Proseg - X = 1234,5040, Y = 155567,54

The conversion factors are now 990,49 and 999,05

roanvanscheppingen commented 3 months ago

In addition to this, I am now coming to the realisation that matching back to the original cells might be of more use. For example, there is also IF staining data per cell available, which can subsequently be used for the InSituType cohort as information.