-
Notifications
You must be signed in to change notification settings - Fork 43
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
Overlay custom shape onto cell boundaries from Xenium #547
Comments
hi @EST09 thank you for the question, this is a very interesting use case that we currently do not support. I quickly googled at potential solutions in shapely/geopandas and found these two that it is worth to take a look:
I think if the two shapes have the same index (i.e. a row refers to the same cells, in the two segmentation view), the second option could be relatively straightforward, that would output a new shape (union) that you could parse and make the default for the table annotations. HTH |
Thank you so much for getting back to me. I ended up initially using the GeoPandas overlay function but also asked SOPA the same question and he's very kindly implemented a new feature which I'm hoping to try soon. Thank you for spatial data - it's a really fantastic package and I'm v much enjoying using it |
Thanks for the appreciated feedback, and great to hear that now the feature is implemented in SOPA! 🎉 I'll close the issue. |
Hi,
This may be a question for SOPA but I thought it was also worth asking here as well please.
I have custom polygon segmentation for a particular cell type derived from H&E. I've added this as a shape to my spatialdata object in the same coordinate system as cell boundaries (the default Xenium segmentation). I'd love to overlay this custom segmentation onto the default Xenium cell segmentation (cell boundaries) so that any cells/transcripts in the default under the custom segmentation get merged into the custom segmentation but the other cells from the default are kept.
In an ideal world I'd end up a new segmentation which is mostly cell_boundaries with the custom segmentation replacing cells it overlaid.
I've been struggling a bit with how to achieve this and was wondering if the functionalities already present in spatialdata/SOPA. I've been looking at https://spatialdata.scverse.org/en/latest/tutorials/notebooks/notebooks/examples/tables.html, a use case for table, but haven't managed to implement it yet.
Best wishes,
Emily
The text was updated successfully, but these errors were encountered: