-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change default leiden clustering backend to igraph
, and reduce default number of iterations
#2865
Comments
|
I first understood the warning that the default will be switched so that we have to be explicit ( When switching to |
@aeisenbarth Could you provide a small code sample or point to one of our unit tests where this happens? I am not seeing what you are referring to. For example: import scanpy as sc
adata = sc.datasets.pbmc3k()
sc.pp.pca(adata)
sc.pp.neighbors(adata)
sc.tl.leiden(adata, flavor="igraph", resolution=5, directed=False, n_iterations=2, copy=True)
sc.tl.leiden(adata, flavor="leidenalg", resolution=5, copy=True) do not seem to yield the warnings you describe. Thanks! |
DeprecationWarning is silenced by default, for not annoying users. But I get all when running unit tests with pytest. Here with all warnings enabled: >>> import warnings
>>> warnings.filterwarnings("always")
>>> import scanpy as sc
>>> adata = sc.datasets.pbmc3k()
>>> sc.pp.pca(adata)
>>> sc.pp.neighbors(adata)
>>> sc.tl.leiden(adata, flavor="igraph", n_iterations=2)
…/lib/python3.9/site-packages/scanpy/tools/_leiden.py:185: DeprecationWarning: resolution_parameter keyword argument is deprecated, use resolution=... instead
part = g.community_leiden(**clustering_args) $ pip freeze | grep -E "anndata|scanpy|igraph|python-igraph|leidenalg"
anndata==0.10.7
igraph==0.11.5
leidenalg==0.10.2
python-igraph==0.11.5
scanpy==1.10.1 |
@aeisenbarth I still cannot reproduce this warning, which is very frustrating. But I also don't understand how this could be happening. Looking at the code: scanpy/scanpy/tools/_leiden.py Lines 163 to 184 in 3ba3f46
I cannot see how |
Ah I see @aeisenbarth: #2999 solved this, so this will be resolved in an upcoming release: https://github.com/scverse/scanpy/blob/main/docs/release-notes/1.10.2.md |
What kind of feature would you like to request?
Additional function parameters / changed functionality / changed defaults?
Please describe your wishes
On the recommendation of the library authors, we should change the default leiden backend to
igraph
(#1053) now that this has been made available in #2815).At the same time, we should change the number of default iterations. Right now, we iterate until convergence. This can be very slow, especially for large datasets. We should probably just stick with the default of the underlying library (which is 2).
The text was updated successfully, but these errors were encountered: