Repository navigation
Closed
Description
Hi, nice work of spatialdata to facilitate the integrtive analysis of multi-modal spatial omics.
I'm checking out the tutorial provided in the documentation and encountered an Error below:
Tutorial: Use landmark annotations to align multiple -omics layers, https://spatialdata.scverse.org/en/latest/tutorials/notebooks/notebooks/examples/alignment_using_landmarks.html#adding-landmark-annotations
After read in the visium and xenium data, I run the Interactive function to visualize the data:
Interactive([visium_sdata, xenium_sdata], points=False, shapes=False)
- Error 1 occurs :
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[12], line 1
----> 1 Interactive([visium_sdata, xenium_sdata], points=False, shapes=False)
TypeError: Interactive.__init__() got an unexpected keyword argument 'points'
- Error 2 occurs:
Interactive([visium_sdata, xenium_sdata])
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[4], line 1
----> 1 Interactive([visium_sdata, xenium_sdata]) # , points=False, shapes=False
File ~/miniconda3/envs/SpatialData/lib/python3.10/site-packages/napari_spatialdata/_interactive.py:220, in Interactive.__init__(self, sdata)
218 self._viewer = napari.Viewer()
219 self._sdata = sdata
--> 220 self._sdata_widget = SdataWidget(self._viewer, sdata)
221 self._list_widget = self._viewer.window.add_dock_widget(
222 self._sdata_widget, name="SpatialData", area="left", menu=self._viewer.window.window_menu
223 )
File ~/miniconda3/envs/SpatialData/lib/python3.10/site-packages/napari_spatialdata/_interactive.py:56, in SdataWidget.__init__(self, viewer, sdata)
52 self._viewer = viewer
54 self.setLayout(QVBoxLayout())
---> 56 self.coordinate_system_widget = CoordinateSystemWidget(self._sdata)
57 self.elements_widget = ElementWidget(self._sdata)
59 self.layout().addWidget(QLabel("Coordinate System:"))
File ~/miniconda3/envs/SpatialData/lib/python3.10/site-packages/napari_spatialdata/_interactive.py:42, in CoordinateSystemWidget.__init__(self, sdata)
38 super().__init__()
40 self._sdata = sdata
---> 42 self.addItems(self._sdata.coordinate_systems)
AttributeError: 'list' object has no attribute 'coordinate_systems'
More information:
(SpatialData) ➜ ~ pip list | grep spatialdata
napari-spatialdata 0.2.4
spatialdata 0.0.10
spatialdata-io 0.0.4
spatialdata-plot 0.0.2
Metadata
Metadata
Assignees
Labels
No labels
Activity
timtreis commentedon Jun 12, 2023
@rahulbshrestha do you have an idea why that is happening?
rahulbshrestha commentedon Jun 12, 2023
@timtreis This notebook was based off the "spatialdata" branch in napari-spatialdata. The above error is because it used the main branch.
We don't support multiple spatialdata objects in the main branch of the Interactive class right now (scverse/napari-spatialdata#112), which would fix this issue.
jefferyUstc commentedon Jun 13, 2023
Thank you, I see, hope to see the latest updated documentation soon. once I read the manu from biorxiv, I can't wait to use the framework.
jefferyUstc commentedon Jun 13, 2023
BTW, when i run other tutorials, I also got some bugs. I guess it's also raised by the conflicting versions in the releasing ones (pypi) and the ones used in the documentation?
For example:
https://spatialdata.scverse.org/en/latest/tutorials/notebooks/notebooks/examples/technology_visium.html
just load the data and render the image:
It outputs:
https://spatialdata.scverse.org/en/latest/tutorials/notebooks/notebooks/examples/spatial_query.html
the last step when overlay the selected region:
It outputs:

FYI:
anndata 0.9.1
dask 2023.5.1
dask-image 2023.3.0
h5py 3.8.0
imageio 2.31.1
matplotlib 3.7.1
matplotlib-inline 0.1.6
matplotlib-scalebar 0.8.1
napari-matplotlib 0.2.1
napari-spatialdata 0.2.4
networkx 3.1
Pillow 9.5.0
scanpy 1.9.3
scikit-image 0.21.0
shapely 2.0.1
spatial_image 0.3.0
spatialdata 0.0.10
spatialdata-io 0.0.4
spatialdata-plot 0.0.2
if any further info needed, donnot hesitate to contact me.
timtreis commentedon Jun 13, 2023
Hey @jefferyUstc, thank you for pointing these bugs out! Yeah, we're currently in a bug-squashing phase which hasn't translated to a new
pypirelease yet. I'll test the aggregation bug and potentially tag you in the issue over atspatialdata_plotif that's where the bug comes from. For the static plotting in particular, we found and fixed quite a few bugs in the last few weeks. So you might want to just use the githubmainbranch for the most stable version so far :)LucaMarconato commentedon Jun 28, 2023
@jefferyUstc thanks for reporting. As mentioned before the problems with napari were caused by the fact that the
spatialdatabranch was used for visualizing the data with napari and not themainbranch. And as @timtreis said, most of thespatialdata-plotbugs should be fixed by now.The following issues keep track of the bugfix on napari:
There should be only one remaining bug with
spatialdata-plot, tracked here:get_extentproduces wrong output after spatial query spatialdata-plot#100Since now the problems are tracked elsewhere, I will close the current issue. But if you find new problems that are not tracked by the open issues above, please feel free to reopen this issue.