Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Over segmentation of cells in samples with non-uniform cell geometry #140

Open
Riley-Grindle opened this issue Oct 2, 2024 · 5 comments
Labels
question Further information is requested

Comments

@Riley-Grindle
Copy link

Hi Baysor Team,

I am a new-ish user to the baysor tool and have a series of Xenium samples our group is trying to re-segment. After multiple iterations of config settings it seems that I have yet to find an optimal segmentation profile that dynamically handles diverse cell shapes. With that said, is there a setting I may have missed, or a proper way to handle segmentation in cases of non-uniformity? I have attached my config.toml below. (Note: the prior segmentation being referenced was generated via XeniumRanger).

Additionally, it appears my z_location is being removed from associated output files.

Thank you for your consideration.

`[data]
x = "x_location"
y = "y_location"
z = "z_location"
gene = "feature_name"
min_molecules_per_cell = 150

[segmentation]
prior_segmentation_confidence = 0.2
scale = 15
scale_std = "100%"
n_cells_init = 6456`

@VPetukhov
Copy link
Collaborator

Hi @Riley-Grindle ,

That's a good question. scale_std, unfortunately, doesn't work as intended and in my tests its effect on the results was minor (if any). I'd try setting num. clusters to 10-15 and increase scale to be closer to the size of larger cells. Also, if your prior segmentation doesn't work well (which I assume because of confidence 0.2), you can switch to nuclei segmentation and set a higher confidence. It would help with undersegmentation.

Additionally, it appears my z_location is being removed from associated output files.

What about other columns? x/y_location and feature_name?

@Riley-Grindle
Copy link
Author

Disregard the last part of that query. The z_location is preserved in the transcript coordinates, and the cell/nuclei boundaries were never 3 dimensional to begin with.

Thank you for the suggestions! I will initiate a test run with some of these in mind and return with feedback.

@VPetukhov VPetukhov added the question Further information is requested label Oct 3, 2024
@VPetukhov
Copy link
Collaborator

Let me know how that works! If that helps, I'll add it to the documentation.

@Riley-Grindle
Copy link
Author

So I set the scale_std param to 0.8 and my initial scale to the largest observed cell radius (15) which seemed to allow the algorithm to handle highly variable sizes. The only thing i am now noticing is that there are cell boundaries that overlap slightly. Is this to be expected?

@VPetukhov
Copy link
Collaborator

VPetukhov commented Oct 16, 2024

Does that mean that the solution helped? :)

The only thing i am now noticing is that there are cell boundaries that overlap slightly. Is this to be expected?

Do you have 3D data? If so, it's often impossible to create non-overlapping polygons in 2D.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants