scverse / squidpy

Spatial Single Cell Analysis in Python
https://squidpy.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
400 stars 70 forks source link

Issue reading visium data when the GEX file is a matrix #802

Closed LinearParadox closed 4 months ago

LinearParadox commented 4 months ago

Description

When using a mtx file to input the expression data, squidpy fails to match the tissue_positions_list.csv data to the file. I believe this is an issue due to how the file is read in, specifically since it utilizes read_mtx from the anndata package. Since the cell barcodes aren't contained in the mtx file, and instead in the barcodes.tsv.gz file, when the code tries to match the indices from tissue_positions_list.csv, none of them are contained in the anndata object. This leads to all the fields in the filled as nan.

...

Minimal reproducible example

adata = sq.read_visium("some/directory", counts_file="matrix.mtx", library_id='some_id')

Version

1.4.1

...