scverse / spatialdata-io

BSD 3-Clause "New" or "Revised" License
41 stars 25 forks source link

New Xenium 5K output bundle incompatible with Squidpy #221

Open ScienceComputing opened 1 month ago

ScienceComputing commented 1 month ago

Description

Hello, Squidpy seems not to read the newly released Xenium 5K data (https://www.10xgenomics.com/datasets/preview-data-xenium-prime-gene-expression) correctly. In particular, the function sdata.write(zarr_path) outputs AssertionError: only one path". As a result, the transcripts folder under points folder is empty. How to address this issue? Any advice would be highly appreciated. Look forward to learning your expertise at your earliest convenience. Thank you so much. ...

Minimal reproducible example

ls ./Data/Raw/Xenium_Prime_Human_Lymph_Node_Reactive_FFPE_outs
# analysis.zarr.zip     gene_groups.csv
# analysis_summary.html     gene_panel.json
# cell_boundaries.csv.gz        he_image.ome.tif
# cell_boundaries.parquet       he_imagealignment.csv
# cell_feature_matrix.h5        metrics_summary.csv
# cell_feature_matrix.zarr.zip  morphology.ome.tif
# cell_groups.csv           morphology_focus
# cells.csv.gz          nucleus_boundaries.csv.gz
# cells.parquet         nucleus_boundaries.parquet
# cells.zarr.zip            transcripts.parquet
# experiment.xenium     transcripts.zarr.zip
import spatialdata as sd
from spatialdata_io import xenium
import matplotlib.pyplot as plt
import seaborn as sns
import scanpy as sc
import squidpy as sq
xenium_path = "./Data/Raw/Xenium_Prime_Human_Lymph_Node_Reactive_FFPE_outs"
sdata = xenium(xenium_path)
zarr_path = "./Data/Derived/Xenium_5K_Human_Lymph_Node"
sdata.write(zarr_path)

Traceback

```pytb "sdata.write(zarr_path) /Users/xyz/.pyenv/versions/3.9.19/lib/python3.9/site-packages/tifffile/tifffile.py:9437: UserWarning: reading array from closed file warnings.warn( Traceback (most recent call last): File "", line 1, in File "/Users/xyz/.pyenv/versions/3.9.19/lib/python3.9/site-packages/spatialdata/_core/spatialdata.py", line 1159, in write self._write_element( File "/Users/xyz/.pyenv/versions/3.9.19/lib/python3.9/site-packages/spatialdata/_core/spatialdata.py", line 1207, in _write_element write_points(points=element, group=element_type_group, name=element_name, format=parsed["points"]) File "/Users/xyz/.pyenv/versions/3.9.19/lib/python3.9/site-packages/spatialdata/_io/io_points.py", line 74, in write_points points.to_parquet(path) File "/Users/xyz/.pyenv/versions/3.9.19/lib/python3.9/site-packages/dask/dataframe/core.py", line 5642, in to_parquet return to_parquet(self, path, *args, **kwargs) File "/Users/xyz/.pyenv/versions/3.9.19/lib/python3.9/site-packages/dask/dataframe/io/parquet/core.py", line 851, in to_parquet assert len(_paths) == 1, "only one path" AssertionError: only one path" ```

Version

print(squidpy.__version__)

1.6.1 ...

ScienceComputing commented 6 days ago

Hello team, any updates on this issue? With gratitude.