visium

visium#

squidpy.read.visium(path, *, counts_file='filtered_feature_bc_matrix.h5', library_id=None, load_images=True, source_image_path=None, **kwargs)[source]#

Read 10x Genomics Visium formatted dataset.

In addition to reading the regular Visium output, it looks for the spatial directory and loads the images, spatial coordinates and scale factors.

See also

Parameters:
path PathLike[str] | str

Path to the root directory containing Visium files.

counts_file str (default: 'filtered_feature_bc_matrix.h5')

Which file in the passed directory to use as the count file. Typically either filtered_feature_bc_matrix.h5 or raw_feature_bc_matrix.h5.

library_id str | None (default: None)

Identifier for the Visium library. Useful when concatenating multiple anndata.AnnData objects.

kwargs Any

Keyword arguments for scanpy.read_10x_h5(), scanpy.read_10x_mtx() or anndata.io.read_text().

Returns:

AnnData – Annotated data object with the following keys: