sopa icon indicating copy to clipboard operation
sopa copied to clipboard

[Bug]"Could not find element with name ['cell_circles']"

Open Yifan-debug opened this issue 5 months ago • 7 comments

Dear Developer,

I'm trying to use the sopa to output the xenium file, so I can open it with xenium. but I got the error said no cell circles, I actually have this one in my spatialdata (pelase check the image) Please let me know how to solve it.

image


KeyError Traceback (most recent call last) Cell In[8], line 4 2 query_sdata 3 explorer_path = "./Crop_sdata" ----> 4 sopa.io.write(explorer_path, query_sdata)

File d:\Yifan_Wang\Software\envs\sopa\lib\site-packages\sopa\io\explorer\converter.py:113, in write(path, sdata, image_key, shapes_key, points_key, gene_column, pixel_size, layer, polygon_max_vertices, lazy, ram_threshold_gb, mode, save_h5ad) 110 adata = sdata.tables[SopaKeys.TABLE] 112 shapes_key = adata.uns["spatialdata_attrs"]["region"] --> 113 geo_df = sdata[shapes_key] 115 if _should_save(mode, "c"): 116 write_gene_counts(path, adata, layer=layer)

File d:\Yifan_Wang\Software\envs\sopa\lib\site-packages\spatialdata_core\spatialdata.py:2124, in SpatialData.getitem(self, item) 2111 def getitem(self, item: str) -> SpatialElement: 2112 """ 2113 Return the element with the given name. 2114 (...) 2122 The element. 2123 """ -> 2124 _, _, element = self._find_element(item) 2125 return element

File d:\Yifan_Wang\Software\envs\sopa\lib\site-packages\spatialdata_core\spatialdata.py:2031, in SpatialData.find_element(self, element_name) 2028 found.append((element_type, element_name, element)) 2030 if len(found) == 0: -> 2031 raise KeyError(f"Could not find element with name {element_name!r}") 2033 if len(found) > 1: 2034 raise ValueError(f"Found multiple elements with name {element_name!r}")

KeyError: "Could not find element with name ['cell_circles']"

Yifan-debug avatar Sep 02 '24 21:09 Yifan-debug