dcjones / proseg

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

Perimeter-bound and other options #9

Closed pakiessling closed 3 months ago

pakiessling commented 3 months ago

Hi, I am trying Proseg with my own datasets and I have a few questions regarding the choice of parameters.

1) I am working with muscle tissue and cells are commonly 5 times as long as they are wide. What does this mean in terms of setting the perimeter-bound argument? What does 1.3 mean? 2) I am taking the membrane based segmentation of the Merscope as prior. Should I instead segment DAPI or does this not matter much? 3) Should ncomponents simply be the number of major cell types I expect? 4) How do I choose the voxel lengths? Should the xy-voxel be bigger in my case as I have very big cells? 5) How to properly deal with the z-axis? Our tissue slices are only 5 µm thick and the z coordinates reported by the Merscope tend to be unreliable. How do I choose z-voxels or should I maybe completely ignore it?

Thank you so much!

dcjones commented 3 months ago

Hi, thanks for trying proseg!

  1. The --perimeter-bound argument is not on a super interpretable scale, but controls the allowable ratio of "effective" surface area to volume. You can try to make that a little higher if the morphology looks off.
  2. I prefer using prior nuclear segmentation, but you can absolutely use any prior segmentation and just proseg refine it.
  3. You can try to do that if you think you know ahead of time, but I don't find that it's super sensitive to the number of clusters.
  4. The initial xy size (edge length in microns) of the voxels is set with --initial-voxel-size. By default proseg starts with 4x4 micron voxels and and increases resolution until it's sampling 1x1 voxels. The resolution increases are controlled by the --schedule parameter. With the default sampling schedule the voxel size with be the initial voxel size divided by 4. The voxel size on the z-axis is just the z-span of the data divided by the number of voxel layers.
  5. If you z coordinates are not thought to be accurate, the best option would probably run with fewer layers of voxels on the z-axis, or in 2d with (--voxel-layers 1).
pakiessling commented 3 months ago

Ty!