[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of scanpy.
[x] (optional) I have confirmed this bug exists on the master branch of scanpy.
What happened?
The exception happened when try to run scanpy highly_variable_genes with sparse dataset loaded in backed mode
Minimal code sample
# read backed
adata = anndata.read_h5ad(file_path, backed='r')
X = adata.raw.X if adata.raw is not None else adata.X
# dataset must be sparse there
print(issparse(X[0]))
# calculate dispersions
sc.pp.highly_variable_genes(adata, min_mean=0.0125, max_mean=3, min_disp=0.5, inplace=False)
True
### Error output
```pytb
loop of ufunc does not support argument 0 of type SparseDataset which has no callable expm1 method!
I don't think we're going to get this implemented for sparse dataset per-se, but we have implemented this for dask arrays wrapping the sparse dataset in
Please make sure these conditions are met
What happened?
The exception happened when try to run scanpy
highly_variable_genes
with sparse dataset loaded in backed modeMinimal code sample
True
goes from https://github.com/scverse/scanpy/blob/bc349b999be62196aa51b59db6e2daa37f428322/scanpy/preprocessing/_highly_variable_genes.py#L206
Versions