scverse / scanpy-tutorials

Scanpy Tutorials.
https://scanpy-tutorials.readthedocs.io/
188 stars 116 forks source link

pbmc scanpy tutorial reproducibility error in sc.tl.leiden arguments #85

Closed Lor-96 closed 8 months ago

Lor-96 commented 8 months ago

Hello, I am a PhD student working on single-cell analysis. I got hired two months ago, I have to move the analysis from R in Python, so I downloaded directly the .ipynb file in my laptop with the dataset to check if it works. I got this error :

TypeError: RBConfigurationVertexPartition.init() got an unexpected keyword argument 'flavor'

In this part of the code: sc.tl.leiden( adata, resolution=0.9, random_state=0, flavor="igraph", n_iterations=2, directed=False, )

And it is actually right there is no "flavor" argument in the sc.tl.leiden function, so I commented the 'flavor="igraph"' line of code and it works, however the clusterization it is slightly different and also the assignation of the genes it is not the same of the analysis reported here https://scanpy-tutorials.readthedocs.io/en/latest/pbmc3k.html.

I know it is an hard work create tutorials and pages to demonstrate workflows, so if it possible I would like to know how to reproduce the same clusters, and/or if there is a different argument that I could use to reproduce the same results, sorry for my few experience with scanpy but it is the first time I am trying this workflow on Python. Thank you for your availability.

ivirshup commented 8 months ago

The documentation you're looking at is actually for the upcoming release of scanpy (which will be out sometime this week)

Unfortunately, the documentation setup we have been using doesn't let us version the tutorials along with the documentation site. This is also something that will be changing and improving with the next release.

The tutorial that matches the scanpy 1.9 release series can be found here: https://github.com/scverse/scanpy-tutorials/blob/cb3dfa2ba04321a5f0be9869c19d75edd40e76af/pbmc3k.ipynb

Lor-96 commented 8 months ago

Ok thank you I will wait for the next release thank you so much for your time and your availability. Have a nice day.