SpatialExperiment icon indicating copy to clipboard operation
SpatialExperiment copied to clipboard

Potential new`.parquet` format for `tissue_position` of VisiumHD might trigger issues for `read10xVisium`

Open boyiguo1 opened this issue 2 months ago • 0 comments

Thanks for creating and maintaining the package.

I'm experimenting the SpatialExperiment::read10xVisiumto import the Visium HD data via https://www.10xgenomics.com/datasets/visium-hd-cytassist-gene-expression-libraries-of-mouse-brain-he.

I noticed in this example data, specifically default Spaceranger output square_008um_outputs.tar.gz (unzipped and outs folder created), they changed the format for the tissue_position file from .csv to .parquet.

>tree spatial
spatial
├── aligned_fiducials.jpg
├── aligned_tissue_image.jpg
├── cytassist_image.tiff
├── detected_tissue_image.jpg
├── scalefactors_json.json
├── tissue_hires_image.png
├── tissue_lowres_image.png
└── tissue_positions.parquet

This seems to both cause problem when setting names for xyz because the function only detects .csv files, https://github.com/drighelli/SpatialExperiment/blob/cfd929f7310e3f85c966e7d56b661a0ba99b40b6/R/read10xVisium.R#L132-L139, and the error reports on L139 due to xyz is a character vector of length zero.

Error in names(xyz) <- names(sfs) <- sids : 
  'names' attribute [1] must be the same length as the vector [0]

Secondly, the current implementation .read_xyz doesn't seem to be compatible to read in .parquet file.

The parquet file may be able to be loaded via https://www.rdocumentation.org/packages/arrow/versions/0.14.1/topics/read_parquet.

Thanks!

boyiguo1 avatar Apr 15 '24 01:04 boyiguo1