spatialdata icon indicating copy to clipboard operation
spatialdata copied to clipboard

Problem with substituting sdata.table with external AnnData

Open gboscagli opened this issue 1 year ago • 2 comments

Hi all, I'm starting to use SpatialData framework but I'm still missing something. I'm working on this public CosMx dataset. I'm able to read it as a SpatialData object and to visualize it using Napari, annotations included. However, I have done previous work on the same dataset and stored some annotations (louvain clusters, cell type annotations, etc...) in an AnnData object. At a first glance, I naively tried to substitute sdata.table with my AnnData (I saw you "recommended" it in #270): it kinda works, except for the fact that when opened in Napari the table isn't recognized anymore in the "Tables annotating layer" menu, and thus I'm not able to plot any annotation. Maybe some references and metadata linking labels to annotations got lost during the transition: I thought of the missing region, region_key and instance_key metadata, but they are missing from the SpatialData table too. For the moment, I worked around it by concatenating specific columns from AnnData to SpatialData table, but I don't think this is the ideal solution. I also guess that adding my AnnData as additional table wouldn't solve my problem.

Do you have some recommendations for my issue?

gboscagli avatar Aug 02 '24 16:08 gboscagli