Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visium observation with NaN metadata #906

Open
jychien opened this issue Oct 30, 2024 · 1 comment
Open

Visium observation with NaN metadata #906

jychien opened this issue Oct 30, 2024 · 1 comment
Assignees

Comments

@jychien
Copy link

jychien commented Oct 30, 2024

Description

When tissue_positions.csv rather than tissue_positions_list.csv is in the spatial directory for a Visium dataset, the resulting AnnData object has:

  • NaN in adata.obs array_row, array_col, and in_tissue
  • nan in adata.obsm[‘spatial’] for the first cell barcode in the tissue_positions.csv list.

Minimal reproducible example

Image

Traceback

It looks like this the issue could be that it should be header=0 rather than header=1 in this line:

header=1 if tissue_positions_file.name == "tissue_positions.csv" else None,

Version

squidpy 1.2.3 and later

@LLehner
Copy link
Member

LLehner commented Nov 3, 2024

Hi @jychien, the squidpy reader functions will be deprecated eventually, since we use spatialdata-io for reading now. I would suggest to use the Visium reader from spatialdata-io which loads the data into a spatialdata object.

sdata = sd.visium("path/to/directory")

The anndata object with coordinates can be found under sdata.tables, so you can continue to use squidpy as usal for analysis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants