scverse / spatialdata

An open and interoperable data framework for spatial omics data
https://spatialdata.scverse.org/
BSD 3-Clause "New" or "Revised" License
174 stars 34 forks source link

Failing join when index values are not unique #531

Closed melonora closed 1 month ago

melonora commented 1 month ago

Not certain what the best approach is here, but it can happen with visium data that the index in the table does not contain unique values. This can give problems in napari as we try to match the data using a left join.

In particular with visualizing the visium_brain dataset and opening ST805905 in the cs of equal name, this causes an error currently. stacktrace.pdf

LucaMarconato commented 1 month ago

Thanks for reporting, we can call obs_names_make_unique() in the visium() reader. Another option is to use np.arange() for instance_id in the reader.

melonora commented 1 month ago

Closing this as the suggestion was implemented.