bioalpha.h5ad_map.SparseDatasetMap.from_dataset
- static SparseDatasetMap.from_dataset(dataset: Dataset, spformat: Literal['csr', 'csc'], file: H5ADMapFile, key: str, force: bool = False)
Convert h5py.Dataset to SparseDatasetMap without load full matrix to memory.
- Parameters:
dataset (
Dataset) – Dataset with shape (n_rows x n_cols) for converting to SparseDatasetMap.spformat (
"csr"|"csc") – Format that will convert to. Ifspformat == self.format_str, do nothing.file (
AlignedMixinMap) – Output handle that backed matrix will saved on. File must have functionscreate_datasetandcreate_group.key (
str, default =None) – Key saved tofile. Default isspformat.
- Returns:
spmatrix – Converted backed sparse matrix.
- Return type:
SparseDatasetMap