scanpy.read_h5ad#
- scanpy.read_h5ad(filename, backed=None, *, as_sparse=(), as_sparse_fmt=<class 'scipy.sparse._csr.csr_matrix'>, chunk_size=6000)[source]#
- Read - .h5ad-formatted hdf5 file.- Parameters:
- filename PathLike[str] |str
- File name of data file. 
- backed Union[Literal['r','r+'],bool,None] (default:None)
- If - 'r', load- AnnDatain- backedmode instead of fully loading it into memory (- memorymode). If you want to modify backed attributes of the AnnData object, you need to choose- 'r+'.- Currently, - backedonly support updates to- X. That means any changes to other slots like- obswill not be written to disk in- backedmode. If you would like save changes made to these slots of a- backed- AnnData, write them to a new file (see- write()). For an example, see Partial reading of large data.
- as_sparse Sequence[str] (default:())
- If an array was saved as dense, passing its name here will read it as a sparse_matrix, by chunk of size - chunk_size.
- as_sparse_fmt type[csr_matrix|csc_matrix] (default:<class 'scipy.sparse._csr.csr_matrix'>)
- Sparse format class to read elements from - as_sparsein as.
- chunk_size int(default:6000)
- Used only when loading sparse dataset that is stored as dense. Loading iterates through chunks of the dataset of this row size until it reads the whole dataset. Higher size means higher memory consumption and higher (to a point) loading speed. 
 
- filename 
- Return type: