UMAP incorrectly installed?

Hello folks,

I’ve been following along with the PBMC 3k preprocessing and clustering tutorial, both the with 3k dataset and my dataset. I get identical results up to the UMAP step. During this step, my UMAP plot is nothing like the one produced by the tutorial (and the exact same thing is seen when using my own data set). Changing the UMAP plot with PAGA produces strange results as well…

I was wondering if this would be because for some reason that I have UMAP incorrectly installed, or that I am just missing some argument somewhere. I’d like to get this figured out and think it’s probably just some simple solution that I’m missing, but I’m not sure as I am very new to Scanpy and Python in general (I am currently transitioning from R/Seurat to Python/Scanpy).

Any help would be appreciated!
Thanks,
G

1 Like

Hi, yes we saw this problem last Friday and raised the issue on the Scanpy repo here umap embedding not working as expected in umap-learn 0.5.2 · Issue #2026 · theislab/scanpy · GitHub. It turns out that the latest release of umap-learn 0.5.2 made a change to their non-user facing API, which Scanpy is using, and is causing UMAP to run with 0 epochs. The umap-learn developers have introduced a pull request to fix the issue (Update for cope with issue introduced in umap-learn 0.5.2 by lmcinnes · Pull Request #2028 · theislab/scanpy · GitHub) but it has not been merged and a new release of Scanpy has not been made yet. Based on my understanding of the way that Scanpy sets its version dependency for umap-learn this problem will effect most/all older releases of Scanpy.

The problem can be reproduced in these two colab notebooks

I see, thanks for the info! Glad to know it’s not just me spinning tires here.

G

1 Like

one solution for the time being is to add this line in your notebook after you have installed scanpy

!pip install -q umap-learn==0.5.1

This seems to have been resolved in the latest relese 1.8.2 scanpy · PyPI. Thanks Scanpy team :smiley:

This notebook now runs correctly - Google Colab

1 Like

Thanks! I’m replying late but this actually allowed me to use scanpy, which was nice.
G

1 Like