From f9fe4f9169fbbc92122ffded42049092eb46cead Mon Sep 17 00:00:00 2001 From: Nicholas Mei Date: Sat, 30 Mar 2024 14:30:38 -0700 Subject: [PATCH] Address deprecated way of initializing AnnData in _scrublet.py While running SnapAtac2 notebooks the following warning was fairly frequently encountered when running `snap.pp.scrublet()`: ``` /usr/local/lib/python3.11/site-packages/anndata/_core/anndata.py:522: FutureWarning: The dtype argument is deprecated and will be removed in late 2024. ``` It looks like the `anndata` project plans to deprecate and completely remove the `dtype` argument to `AnnData` instantiation somewhat soon. See: https://github.com/scverse/anndata/commit/85162c75e152e1f86bd0f7bbe35688602914ca29 See also: https://github.com/scverse/anndata/pull/1126 This commit removes the `dtype` argument from `AnnData` instantiation as it will be removed in future versions of `AnnData`. --- snapatac2-python/python/snapatac2/preprocessing/_scrublet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snapatac2-python/python/snapatac2/preprocessing/_scrublet.py b/snapatac2-python/python/snapatac2/preprocessing/_scrublet.py index e4225fbeb..b7900e8f7 100644 --- a/snapatac2-python/python/snapatac2/preprocessing/_scrublet.py +++ b/snapatac2-python/python/snapatac2/preprocessing/_scrublet.py @@ -255,7 +255,7 @@ def scrub_doublets_core( del count_matrix_sim gc.collect() _, evecs = spectral( - AnnData(X=merged_matrix, dtype=merged_matrix.dtype), + AnnData(X=merged_matrix), features=None, n_comps=n_comps, inplace=False,