-
Notifications
You must be signed in to change notification settings - Fork 15
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]"Could not find element with name ['cell_circles']" #117
Comments
Hello @Yifan-debug, can you show me which line of code you used to get this error? My guess is that you provided |
import sopa Here is the line which got this error. |
I think I understand the error now, but this is due to the fact that your data is not formated as an output of Sopa. Indeed, the Can you try this, though? |
Okay, thanks for giving a try. I'll try to fix What is your actual use case? I have a few questions, it will help me better understand what you want to do:
|
Hi @quentinblampey |
Thanks for sharing these details! In that case, since you want to use Sopa for segmentation, you should do the following:
Hope that helps, let me know! |
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.
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']"
The text was updated successfully, but these errors were encountered: