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

[Feature] Allow two separate categories of shapes to be written to Xenium Explorer #182

Open
pakiessling opened this issue Jan 21, 2025 · 7 comments

Comments

@pakiessling
Copy link
Contributor

The default Xenium output included sergmented nuclei and cells that can be observed in the Explorer.

With sopa you are able to segment arbitrary shapes: cells, nuclei, organelles.
However it is currently not possible to add more than one type of shape to the Xenium explorer with Sopa.

It would be cool to allow the user to write arbitrary shapes to the Xenium explorer "nuclei slot"

@quentinblampey
Copy link
Collaborator

Yes indeed we could add the nuclei slot, but we would still not be able to display any type of shape (and limited to the number of 2 layers).

Therefore, for more advanced users, I recommend using napari-spatialdata as mentioned in this tutorial. Note that it had some latency for rendering shapes, but it is improving quickly (see this blog post to try new features).

What do you think of Napari? Would you still prefer the Xenium Explorer or it suits your needs?
Usually I recommend the Xenium Explorer for user-friendliness, and Napari for the flexibility

@pakiessling
Copy link
Contributor Author

I think if one does analysis Napari is probably the way to go in the future.

However, I like Xenium explorer for the type of collaborator / colleague that would struggle to install Python. In that setting I had it happen that I reprocessed their Xenium output with Sopa and they were disappointed that the Nuclei were gone.

Is their documentation somewhere on the Xenium explorer formats?

@quentinblampey
Copy link
Collaborator

Thanks for the context, I totally understand

I could add the nucleus segmentation to the Xenium Explorer, but it assumes that the user is running both nucleus and cell segmentation using Sopa, which is (I believe) not the case for 99% of the users. Do you already have both layers, i.e. nucleus and cell segmentation using Sopa? If yes, how did you proceed? Like two round of cellpose segmentation with different parameters I imagine

You can find the documentation of the Xenium Explorer inputs here, but it's not detailed in-depth

@pakiessling
Copy link
Contributor Author

pakiessling commented Jan 21, 2025

Yes I added another round of segmentation to the Snakemake.
I am working with very challenging cells. It is very helpful to have the nuclei as this helps me discard under-segmented cells (those that have 2 or more nuclei) and retain only sepatate nuclei in this case.

I am actually working on polishing the workflow as a small part of an upcoming publication.
I believe this is of interest to everyone working with skeletal/heart muscle or multinucleated cells (liver..)

I think that the study of subcellular RNA patterns is also gathering some interest e.g

and there it is necessary to have both nuclei and cell segmentation.

Would it be a lot of effort to add an optional parameter to sopa explorer that writes another shape key from the Spatialdata object to the nuclei slot?

@quentinblampey
Copy link
Collaborator

And have you found a way to ensure the segmentations are paired, i.e. one shape from the nucleus segmentation is assigned to exactly one shape from the cell segmentation?

Regarding adding the nucleus, I think it shouldn't be too complex, although I don't have a lot of time to prioritize this right now...
In case you want to have a look, I think the change should be done here, since I stack the same polygons.

If you want to do a PR, I would be happy to review it, else I can add the feature myself but I can't tell when it will be done!

@pakiessling
Copy link
Contributor Author

I am using geopandas covered_by ect with some tolerances to establish parent <> child relatonships.

I will look into a PR in the next couple of months, thank you!

@quentinblampey
Copy link
Collaborator

Great, that sounds good, I'll be happy to review the PR!

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

No branches or pull requests

2 participants