gustaveroussy / sopa

Technology-invariant pipeline for spatial omics analysis (Xenium / MERSCOPE / CosMx / PhenoCycler / MACSima / Hyperion) that scales to millions of cells
https://gustaveroussy.github.io/sopa/
BSD 3-Clause "New" or "Revised" License
94 stars 8 forks source link

RuntimeError in rule patchify_cellpose: add_image(), add_labels(), add_points() and add_shapes() #43

Closed suhridbuddha closed 2 months ago

suhridbuddha commented 3 months ago

I am getting in this error at patchify stage:

RuntimeError: The functions add_image(), add_labels(), add_points() and add_shapes() have been removed in favor of dict-like access to the elements. Please use the following syntax to add an element:

    sdata.images["image_name"] = image
    sdata.labels["labels_name"] = labels
    ...

The new syntax does not automatically updates the disk storage, so you need to call sdata.write() when the in-memory object is ready to be saved. To save only a new specific element to an existing Zarr storage please use the functions write_image(), write_labels(), write_points(), write_shapes() and write_table(). We are going to make these calls more ergonomic in a follow up PR.

any idea?

i am using snakemake-lsf profile (default setup) and xenium ome.tif

quentinblampey commented 3 months ago

Hello,

Yes, this is an issue related to the new version of Sopa (it solved a bug, but also created another one...). Sorry for this second issue, I'll fix this on Wednesday!

suhridbuddha commented 3 months ago

Hello @quentinblampey thank you. the sopa i have now is Version: 1.0.6. Do you think downgrade may help?

Update: Another project of ours with the same xenium data and same sopa version is working fine on the same server. Do you think there are some lib dependencies as well?

suhridbuddha commented 3 months ago

even with the tuto.zarr i am getting the same error now.

quentinblampey commented 3 months ago

Hello @suhridbuddha, the newest releases of spatialdata and spatialdata-io introduced some breaking changes, so I need to update Sopa (I know that everything is broken right now, sorry for that). This will be done tonight or tomorrow morning.

These changes came with the publication of SpatialData, but now there shouldn't have breaking changes anymore! Wait for the next Sopa release and it should be all fixed 😊

quentinblampey commented 3 months ago

Hello @suhridbuddha, I released sopa==1.0.9, can you try? It should now work, even though I still need to check some new functionalities from spatialdata, and perform additional checks.

NB: spatialdata is now using multiple tables, but the old sdata.table syntax is still supported

suhridbuddha commented 2 months ago

Thank you @quentinblampey. The new sopa has resolved the problem