stereo.io.read_h5ad#
- stereo.io.read_h5ad(file_path=None, anndata=None, flavor='scanpy', bin_type=None, bin_size=None, **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 which to be loaded, only available whileflavor
is'scanpy'
.file_path
andanndata
only can input one of them.flavor (
str
) – the format of the h5ad file, defaults to'scanpy'
.scanpy
: AnnData format of scanpystereopy
: h5ad format of stereobin_type (
Optional
[str
]) – the bin type includes'bins'
or'cell_bins'
.bin_size (
Optional
[int
]) – the size of bin to merge, whenbin_type
is set to'bins'
.
- Return type:
Union
[StereoExpData
,AnnBasedStereoExpData
]- Returns:
An object of StereoExpData while
flavor
is'stereopy'
or an object of AnnBasedStereoExpData whileflavor
is'scanpy'