Closed GuoshengMa closed 7 months ago
Hi @GuoshengMa, thanks for reaching out. The error above is expected and of easy fix. In the latest release we refactored the IO system to separate the moment in which new elements are added in memory and the moment when they are saved to disk.
To add the new element in-memory you can now simply do sdata['labels_name'] = labels
. If you also need to save it to disk you have two options:
sdata.write('data.zarr')
Last comment, I see you are using Windows and Xenium data; some users reported problems with Xenium and Steinbock data (and if the element name contain the character /
), please check out also https://github.com/scverse/spatialdata-io/issues/129 if you have any problems of that kind.
Great! It works for me and below is my code:
from spatialdata.models import ShapesModel
visium_landmarks = ShapesModel.parse(
np.array(visium_sdata['visium_temp_points'].drop('z', axis=1)), geometry=0, radius=1000
)
visium_sdata["visium_temp_shape"] = visium_landmarks
Hi @LucaMarconato ! A few days ago, following the instructions in the Use landmark annotations to align multiple -omics layers section, I successfully aligned the layers using data from visium and xenium. However, today I encountered an error when running the
add_shapes()
function following the same code.Here is my code:
And here is the error:
In these past few days, I encountered another error while using the
polygon_query()
function and resolved it based on the suggestions provided in #474. During this process, I updated spatialdata usingpip install git+https://github.com/scverse/spatialdata
. I'm not sure if this operation caused the error mentioned above.