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

[Bug] sopa write explorer fails after H&E image is added #176

Open
jpark27 opened this issue Jan 10, 2025 · 1 comment
Open

[Bug] sopa write explorer fails after H&E image is added #176

jpark27 opened this issue Jan 10, 2025 · 1 comment

Comments

@jpark27
Copy link

jpark27 commented Jan 10, 2025

Hi, @quentinblampey! Hope you been well.
I was hoping to access registered H&E image per se through explorer's write function. (Is it correct to expect 'sopa explorer write' will create not only 'morphology.ome.tif' but also rest of aligned images as ome.tif under explorer folder?)

Q1.
Anyhow I executed following but it throws error. [2] part worked fine before add-aligned H&E image.

[1] H&E align to sdata
sopa explorer add-aligned "xxx/ROI1.zarr" "yyy/CAM006_Xenium5K_post_HnE.ome.tif" "yyy/CAM006_Xenium5K_post_HnE_matrix.csv"

[2] Export
sopa explorer write xxx/ROI1.zarr --output-path xxx/ROI1.explorer --gene-column "feature_name" --ram-threshold-gb 4 --mode "-i"

*Error:
AssertionError: No element with the attribute cell_segmentation_image. Provide an element key.

Can you kindly give any advice how to fix the issue? or possible way to generate/locate aligned image on sopa v1?

Q2.
Also, I wonder is there way to export processed sdata into (older Xenium version of) cell feature matrix/summary file format (c.f., cells.csv.gz) so I can feed onto downstream tool like stLearn*?

image
image

*https://stlearn.readthedocs.io/en/latest/tutorials/Xenium_PSTS.html

@quentinblampey
Copy link
Collaborator

Hello @jpark27,
I have a few questions to better understand what you are doing:

  • can you confirm that you have Xenium data?
  • if so, you already have the images for the explorer, so you don't need to re-create them, right? Usually, for Xenium data, we only write the new segmentation / features per cell.

Regarding Q2, no unfortunately sopa explorer write only creates the files mentioned here. Yet, you already have an AnnData object inside your SpatialData object (see into the "tables"), so you can directly use this anndata and skip the st.ReadXenium step. Let me know if you need details to access the AnnData object!

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