diff --git a/docs/release-notes/1.9.7.md b/docs/release-notes/1.9.7.md index 6528993402..8fa8487b8e 100644 --- a/docs/release-notes/1.9.7.md +++ b/docs/release-notes/1.9.7.md @@ -7,3 +7,4 @@ - Fix {func}`scanpy.pl.violin` usage of `seaborn.catplot` {pr}`2739` {smaller}`E Roellin` - Fix {func}`scanpy.pp.highly_variable_genes` to handle the combinations of `inplace` and `subset` consistently {pr}`2757` {smaller}`E Roellin` - Replace usage of various deprecated functionality from {mod}`anndata` and {mod}`pandas` {pr}`2678` {pr}`2779` {smaller}`P Angerer` +- Allow to use default `n_top_genes` when using {func}`scanpy.pp.highly_variable_genes` flavor `'seurat_v3'` {pr}`2782` {smaller}`P Angerer` diff --git a/scanpy/tests/test_highly_variable_genes.py b/scanpy/tests/test_highly_variable_genes.py index 4c322b4b3b..9f1c1b56b3 100644 --- a/scanpy/tests/test_highly_variable_genes.py +++ b/scanpy/tests/test_highly_variable_genes.py @@ -387,12 +387,16 @@ def test_higly_variable_genes_compare_to_seurat_v3(): seu = pd.Index(seurat_hvg_info_batch["x"].values) assert len(seu.intersection(df.index)) / 4000 > 0.95 + +@needs.skmisc +def test_higly_variable_genes_seurat_v3_warning(): + pbmc = pbmc3k()[:200].copy() sc.pp.log1p(pbmc) with pytest.warns( UserWarning, match="`flavor='seurat_v3'` expects raw count data, but non-integers were found.", ): - sc.pp.highly_variable_genes(pbmc, n_top_genes=1000, flavor="seurat_v3") + sc.pp.highly_variable_genes(pbmc, flavor="seurat_v3") def test_filter_genes_dispersion_compare_to_seurat():