From 16a4d14562fc76de167d5717131959495737c8b9 Mon Sep 17 00:00:00 2001 From: Luca Marconato Date: Fri, 14 Jul 2023 17:02:38 +0200 Subject: [PATCH] fix coordinate transformation --- src/spatialdata_io/readers/merscope.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/spatialdata_io/readers/merscope.py b/src/spatialdata_io/readers/merscope.py index 1ff2c736..da347f9e 100644 --- a/src/spatialdata_io/readers/merscope.py +++ b/src/spatialdata_io/readers/merscope.py @@ -152,11 +152,10 @@ def merscope( transcripts = PointsModel.parse( transcript_df, coordinates={"x": MerscopeKeys.GLOBAL_X, "y": MerscopeKeys.GLOBAL_Y}, - transformations={"pixels": Identity()}, + transformations={"pixels": microns_to_pixels}, ) - gene_categorical = dd.from_pandas( - transcripts["gene"].compute().astype("category"), npartitions=transcripts.npartitions - ).reset_index(drop=True) + categories = transcripts["gene"].compute().astype("category") + gene_categorical = dd.from_pandas(categories, npartitions=transcripts.npartitions).reset_index(drop=True) transcripts["gene"] = gene_categorical points = {f"{dataset_id}_transcripts": transcripts}