From 99aad1cbca8bfe33d5fe1db5a952ed2a1743f57a Mon Sep 17 00:00:00 2001 From: Luca Marconato <2664412+LucaMarconato@users.noreply.github.com> Date: Sat, 20 May 2023 19:32:32 +0200 Subject: [PATCH 1/2] fixed category string in xenium --- .gitignore | 3 +++ src/spatialdata_io/readers/xenium.py | 1 + 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 07298b9d..26dffade 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,6 @@ __pycache__/ # docs /docs/generated/ /docs/_build/ + +# other +_version.py diff --git a/src/spatialdata_io/readers/xenium.py b/src/spatialdata_io/readers/xenium.py index 71c58139..1910aeeb 100644 --- a/src/spatialdata_io/readers/xenium.py +++ b/src/spatialdata_io/readers/xenium.py @@ -168,6 +168,7 @@ def _poly(arr: ArrayLike) -> Polygon: def _get_points(path: Path, specs: dict[str, Any]) -> Table: table = read_parquet(path / XeniumKeys.TRANSCRIPTS_FILE) + table['feature_name'] = table['feature_name'].apply(lambda x: x.decode('utf-8'), meta=('feature_name', 'object')) transform = Scale([1.0 / specs["pixel_size"], 1.0 / specs["pixel_size"]], axes=("x", "y")) points = PointsModel.parse( From 7241646cb13ee782788068085073c8fcc4e472b9 Mon Sep 17 00:00:00 2001 From: Luca Marconato <2664412+LucaMarconato@users.noreply.github.com> Date: Sat, 20 May 2023 19:36:05 +0200 Subject: [PATCH 2/2] fixed category name bug with xenium --- src/spatialdata_io/readers/xenium.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spatialdata_io/readers/xenium.py b/src/spatialdata_io/readers/xenium.py index 1910aeeb..d328dd97 100644 --- a/src/spatialdata_io/readers/xenium.py +++ b/src/spatialdata_io/readers/xenium.py @@ -168,7 +168,7 @@ def _poly(arr: ArrayLike) -> Polygon: def _get_points(path: Path, specs: dict[str, Any]) -> Table: table = read_parquet(path / XeniumKeys.TRANSCRIPTS_FILE) - table['feature_name'] = table['feature_name'].apply(lambda x: x.decode('utf-8'), meta=('feature_name', 'object')) + table["feature_name"] = table["feature_name"].apply(lambda x: x.decode("utf-8"), meta=("feature_name", "object")) transform = Scale([1.0 / specs["pixel_size"], 1.0 / specs["pixel_size"]], axes=("x", "y")) points = PointsModel.parse(