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
Trying to make a side-by-side render_image and render_label plot for my sdata object.
My code worked with earlier versions of spatialdata-plot, but since updating to 0.2.8 have found some issues. (e.g. for render_image, needed to switch from specifying vmin and vmax, to doing this via norm = matplit.colors.Normalize()). My render_image code is now working.
For render_labels though, I seem to get a 'KeyError' when I provide a color parameter. The function works fine when not providing a color parameter. Not sure why, the color name does seem to be a column in sdata.tables['table'].obs
Any pointers?
Am sure this code worked with earlier versions for spatialdata-plot.
Output exceeds the [size limit](command:workbench.action.openSettings?[). Open the full output data [in a text editor](command:workbench.action.openLargeOutput?5f6746ed-c6f8-44ba-95f7-6663ee9aeeae)
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
File c:\Users\U062951\Miniconda3\envs\imc_ome_v1_spatial\lib\site-packages\pandas\core\indexes\base.py:3805, in Index.get_loc(self, key)
3804 try:
-> 3805 return self._engine.get_loc(casted_key)
3806 except KeyError as err:
File index.pyx:167, in pandas._libs.index.IndexEngine.get_loc()
File index.pyx:196, in pandas._libs.index.IndexEngine.get_loc()
File pandas\\_libs\\hashtable_class_helper.pxi:7081, in pandas._libs.hashtable.PyObjectHashTable.get_item()
File pandas\\_libs\\hashtable_class_helper.pxi:7089, in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: 'bulk4_ldn_n50_r0pt15_anno'
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
Cell In[95], line 28
22 palette = sdata.tables['table'].uns[f'{lbl}_colors']
24 # Works, no color by label call
25 # sdata.pl.render_labels(element = f'{coord}_labels', table_name='table').pl.show(coordinate_systems=coord, ax=axs_rvl[1], title='bulk clustering', legend_loc='lower left', legend_fontsize=10)
26
...
3815 # InvalidIndexError. Otherwise we fall through and re-raise
3816 # the TypeError.
3817 self._check_indexing_error(key)
KeyError: 'bulk4_ldn_n50_r0pt15_anno'
The text was updated successfully, but these errors were encountered:
Morning,
Trying to make a side-by-side render_image and render_label plot for my sdata object.
My code worked with earlier versions of spatialdata-plot, but since updating to 0.2.8 have found some issues. (e.g. for render_image, needed to switch from specifying vmin and vmax, to doing this via norm = matplit.colors.Normalize()). My render_image code is now working.
For render_labels though, I seem to get a 'KeyError' when I provide a color parameter. The function works fine when not providing a color parameter. Not sure why, the color name does seem to be a column in
sdata.tables['table'].obs
Any pointers?
Am sure this code worked with earlier versions for spatialdata-plot.
Thanks
Code
Error
The text was updated successfully, but these errors were encountered: