stereo.io.read_h5ad¶
- stereo.io.read_h5ad(file_path=None, anndata=None, flavor='scanpy', bin_type=None, bin_size=None, spatial_key='spatial', **kwargs)[source]¶
Read a h5ad file or load a AnnData object
- Parameters:
file_path (
Optional[str]) – the path of the h5ad file.anndata (
Optional[AnnData]) – the object of AnnData to be loaded, only available whileflavoris'scanpy'.file_pathandanndataonly can input one of them.flavor (
str) – the format of the h5ad file, defaults to'scanpy'.scanpy: AnnData format of scanpystereopy: h5 format of stereobin_type (
Optional[str]) – the bin type includes'bins'and'cell_bins'.bin_size (
Optional[int]) – the size of bin to merge, whenbin_typeis set to'bins'.spatial_key (
str) – the key of spatial information in AnnData.obsm, default to'spatial'. Only available whileflavoris'scanpy'.
- Return type:
An object of StereoExpData while
flavoris'stereopy'or an object of AnnBasedStereoExpData whileflavoris'scanpy'