Skip to content

Commit b9c3262

Browse files
Merge pull request #314 from scverse/fix_index_check_xenium
more permissive check index xenium
2 parents d374ec8 + 3efc7b7 commit b9c3262

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/spatialdata_io/readers/xenium.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,8 @@ def _get_labels_and_indices_mapping(
468468
"label_index": real_label_index.astype(np.int64),
469469
}
470470
)
471+
# because AnnData converts the indices to str
472+
indices_mapping.index = indices_mapping.index.astype(str)
471473
return labels, indices_mapping
472474

473475

@@ -497,6 +499,8 @@ def _get_cells_metadata_table_from_zarr(
497499

498500
cell_id_str = cell_id_str_from_prefix_suffix_uint32(cell_id_prefix, dataset_suffix)
499501
df[XeniumKeys.CELL_ID] = cell_id_str
502+
# because AnnData converts the indices to str
503+
df.index = df.index.astype(str)
500504
return df
501505

502506

0 commit comments

Comments
 (0)