You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No warning when the manually specified table doesn't actually annotate the labels element #467
I forgot to set the spatialdata_attrs so the function was generating random colors for my labels - instead it should've failed and told me that the table doesn't annotate that labels object.
@timtreis I am having the same issue, could you explain how you are supposed to set the spatialdata_attrs to make this work? I've tried replacing the table.uns['spatialdata_attrs']['region_key'] with 'leiden', but it throws the error (Regions in the AnnData object and leiden do not match.)
table.uns["spatialdata_attrs"] = {
"region": "<name of the sdata element it annotates>",
"region_key": "<column in adata.obs that will link a given obs to the elements it annotates, same entry as region>",
"instance_key": "<column that matches a given obs in the table to a given circle by id>",
}
Activity
timtreis commentedon May 24, 2025
Correct plot after setting it:
VikramGanesanjs commentedon Sep 9, 2025
@timtreis I am having the same issue, could you explain how you are supposed to set the spatialdata_attrs to make this work? I've tried replacing the table.uns['spatialdata_attrs']['region_key'] with 'leiden', but it throws the error (Regions in the AnnData object and
leidendo not match.)timtreis commentedon Sep 11, 2025
Hey @VikramGanesanjs,
here you can find an example on how to manually set it: https://github.com/scverse/spatialdata-notebooks/blob/main/notebooks/examples/sdata_from_scratch.ipynb
the tl;dr is like this: