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
squidpy.pl.spatial_scatter()on how to plot spatial data.
- 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.AnnDataobjects.- kwargs
Any Keyword arguments for
scanpy.read_10x_h5(),scanpy.read_10x_mtx()oranndata.io.read_text().
- path
- Returns:
AnnData– Annotated data object with the following keys:anndata.AnnData.obsm['spatial']- spatial spot coordinates.anndata.AnnData.uns['spatial']['{library_id}']['images']- hires and lowres images.anndata.AnnData.uns['spatial']['{library_id}']['scalefactors']- scale factors for the spots.anndata.AnnData.uns['spatial']['{library_id}']['metadata']- various metadata.