Skip to content

UMAP goes wrong on scanpy v1.7.2 #2045

Closed
@hyjforesight

Description

@hyjforesight

Hello Scanpy,
I reimaged my Windows from 20H2 to 21H1 today and reinstalled the environment for scanpy. However, in the new environment, when I run the official workflow of pbmc3k by just using the official pbmc3k notebook. The UMAP becomes different from the pbmc3k tutorial like below. But all other codings generate the same results and plots as the pbmc3k tutorial.
image
image

Then I run the same coding on my older computer, which installed scanpy one month ago, the UMAP is the same as the standard workflow.
image

Is it because of the packages' problem or Windows 21H1? I list the packages information here. Could you please help me to solve this issue?

<style> </style>
  Right UMAP Wrong UMAP
Package Version Version
Anaconda 2.1.0 2.1.0
Python 3.6.13 3.6.13
anndata 0.7.6 0.7.6
anyio 2.2.0 2.2.0
argon2-cffi 20.1.0 20.1.0
async-generator 1.1 1.1
attrs 21.2.0 21.2.0
Babel 2.9.1 2.9.1
backcall 0.2.0 0.2.0
bleach 4.0.0 4.0.0
brotlipy 0.7.0 0.7.0
cached-property 1.5.2 1.5.2
certifi 2021.5.30 2021.5.30
cffi 1.14.6 1.14.6
charset-normalizer 2.0.4 2.0.4
colorama 0.4.4 0.4.4
contextvars 2.4 2.4
**cryptography 3.4.7 35.0.0**
cycler 0.10.0 0.11.0
dataclasses 0.8 0.8
decorator 4.4.2 4.4.2
defusedxml 0.7.1 0.7.1
entrypoints 0.3 0.3
get-version 2.1 2.1
h5py 3.1.0 3.1.0
idna 3.2 3.2
igraph 0.9.8 0.9.8
immutables 0.16 0.16
importlib-metadata 4.8.1 4.8.1
ipykernel 5.3.4 5.3.4
ipython 7.16.1 7.16.1
ipython-genutils 0.2.0 0.2.0
jedi 0.17.0 0.17.0
**Jinja2 3.0.1 3.0.2**
joblib 1.1.0 1.1.0
json5 0.9.6 0.9.6
jsonschema 3.2.0 3.2.0
jupyter-client 7.0.1 7.0.1
jupyter-core 4.8.1 4.8.1
jupyter-server 1.4.1 1.4.1
**jupyterlab 3.1.7 3.2.1**
jupyterlab-pygments 0.1.2 0.1.2
jupyterlab-server 2.8.2 2.8.2
kiwisolver 1.3.1 1.3.1
legacy-api-wrap 1.2 1.2
leidenalg 0.8.8 0.8.8
llvmlite 0.36.0 0.36.0
MarkupSafe 2.0.1 2.0.1
matplotlib 3.3.4 3.3.4
mistune 0.8.4 0.8.4
**natsort 7.1.1 8.0.0**
nbclassic 0.2.6 0.2.6
nbclient 0.5.3 0.5.3
nbconvert 6.0.7 6.0.7
nbformat 5.1.3 5.1.3
nest-asyncio 1.5.1 1.5.1
networkx 2.5.1 2.5.1
notebook 6.4.3 6.4.3
numba 0.53.1 0.53.1
numexpr 2.7.3 2.7.3
numpy 1.19.5 1.19.5
packaging 21 21
pandas 1.1.5 1.1.5
pandocfilters 1.4.3 1.4.3
parso 0.8.2 0.8.2
patsy 0.5.2 0.5.2
pickleshare 0.7.5 0.7.5
Pillow 8.4.0 8.4.0
pip 21.0.1 21.2.2
prometheus-client 0.11.0 0.11.0
prompt-toolkit 3.0.20 3.0.20
pycparser 2.2 2.2
Pygments 2.10.0 2.10.0
pynndescent 0.5.5 0.5.5
pyOpenSSL 20.0.1 21.0.0
**pyparsing 2.4.7 3.0.4**
pyrsistent 0.17.3 0.17.3
PySocks 1.7.1 1.7.1
python-dateutil 2.8.2 2.8.2
python-igraph 0.9.8 0.9.8
pytz 2021.3 2021.3
pywin32 228 228
pywinpty 0.5.7 0.5.7
pyzmq 22.2.1 22.2.1
requests 2.26.0 2.26.0
scanpy 1.7.2 1.7.2
scikit-learn 0.24.2 0.24.2
scipy 1.5.4 1.5.4
seaborn 0.11.2 0.11.2
Send2Trash 1.8.0 1.8.0
setuptools 58.0.4 58.0.4
sinfo 0.3.4 0.3.4
six 1.16.0 1.16.0
sniffio 1.2.0 1.2.0
statsmodels 0.12.2 0.12.2
stdlib-list 0.8.0 0.8.0
tables 3.6.1 3.6.1
terminado 0.9.4 0.9.4
testpath 0.5.0 0.5.0
texttable 1.6.4 1.6.4
threadpoolctl 3.0.0 3.0.0
tornado 6.1 6.1
tqdm 4.62.3 4.62.3
traitlets 4.3.3 4.3.3
typing-extensions 3.10.0.2 3.10.0.2
**umap-learn 0.5.1 0.5.2**
urllib3 1.26.7 1.26.7
wcwidth 0.2.5 0.2.5
webencodings 0.5.1 0.5.1
wheel 0.37.0 0.37.0
win-inet-pton 1.1.0 1.1.0
wincertstore 0.2 0.2
xlrd 1.2.0 1.2.0
zipp 3.6.0 3.6.0

Thanks!
Best,
YJ

Activity

changed the title [-]UMAP goes wrong on scanpy v1.8.2[/-] [+]UMAP goes wrong on scanpy v1.7.2[/+] on Nov 7, 2021
hyjforesight

hyjforesight commented on Nov 7, 2021

@hyjforesight
Author

I installed the newest versions of JAVA and VC+++, didn't work.
Here also attaches the information of install scapy[leiden]:

Collecting scanpy[leiden]
Using cached scanpy-1.7.2-py3-none-any.whl (10.3 MB)
Collecting h5py>=2.10.0
Using cached h5py-3.1.0-cp36-cp36m-win_amd64.whl (2.7 MB)
Collecting tables
Using cached tables-3.6.1-2-cp36-cp36m-win_amd64.whl (3.2 MB)
Collecting numpy>=1.17.0
Using cached numpy-1.19.5-cp36-cp36m-win_amd64.whl (13.2 MB)
Collecting joblib
Using cached joblib-1.1.0-py2.py3-none-any.whl (306 kB)
Collecting pandas>=0.21
Using cached pandas-1.1.5-cp36-cp36m-win_amd64.whl (8.7 MB)
Collecting tqdm
Using cached tqdm-4.62.3-py2.py3-none-any.whl (76 kB)
Collecting matplotlib>=3.1.2
Using cached matplotlib-3.3.4-cp36-cp36m-win_amd64.whl (8.5 MB)
Collecting networkx>=2.3
Using cached networkx-2.5.1-py3-none-any.whl (1.6 MB)
Collecting sinfo
Using cached sinfo-0.3.4-py3-none-any.whl
Requirement already satisfied: importlib-metadata>=0.7 in c:\users\yuanjian.conda\envs\py363636\lib\site-packages (from scanpy[leiden]) (4.8.1)
Collecting scikit-learn>=0.21.2
Using cached scikit_learn-0.24.2-cp36-cp36m-win_amd64.whl (6.8 MB)
Collecting scipy>=1.4
Using cached scipy-1.5.4-cp36-cp36m-win_amd64.whl (31.2 MB)
Collecting numba>=0.41.0
Using cached numba-0.53.1-cp36-cp36m-win_amd64.whl (2.3 MB)
Collecting patsy
Using cached patsy-0.5.2-py2.py3-none-any.whl (233 kB)
Collecting natsort
Using cached natsort-8.0.0-py3-none-any.whl (37 kB)
Collecting seaborn
Using cached seaborn-0.11.2-py3-none-any.whl (292 kB)
Requirement already satisfied: packaging in c:\users\yuanjian.conda\envs\py363636\lib\site-packages (from scanpy[leiden]) (21.0)
Collecting statsmodels>=0.10.0rc2
Using cached statsmodels-0.12.2-cp36-none-win_amd64.whl (9.3 MB)
Collecting umap-learn>=0.3.10
Using cached umap_learn-0.5.2-py3-none-any.whl
Collecting anndata>=0.7.4
Using cached anndata-0.7.6-py3-none-any.whl (127 kB)
Collecting legacy-api-wrap
Using cached legacy_api_wrap-1.2-py3-none-any.whl (37 kB)
Collecting leidenalg
Using cached leidenalg-0.8.8-cp36-cp36m-win_amd64.whl (107 kB)
Collecting python-igraph
Using cached python_igraph-0.9.8-py3-none-any.whl
Collecting xlrd<2.0
Using cached xlrd-1.2.0-py2.py3-none-any.whl (103 kB)
Collecting cached-property
Using cached cached_property-1.5.2-py2.py3-none-any.whl (7.6 kB)
Requirement already satisfied: typing-extensions>=3.6.4 in c:\users\yuanjian.conda\envs\py363636\lib\site-packages (from importlib-metadata>=0.7->scanpy[leiden]) (3.10.0.2)
Requirement already satisfied: zipp>=0.5 in c:\users\yuanjian.conda\envs\py363636\lib\site-packages (from importlib-metadata>=0.7->scanpy[leiden]) (3.6.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in c:\users\yuanjian.conda\envs\py363636\lib\site-packages (from matplotlib>=3.1.2->scanpy[leiden]) (3.0.4)
Collecting kiwisolver>=1.0.1
Using cached kiwisolver-1.3.1-cp36-cp36m-win_amd64.whl (51 kB)
Requirement already satisfied: python-dateutil>=2.1 in c:\users\yuanjian.conda\envs\py363636\lib\site-packages (from matplotlib>=3.1.2->scanpy[leiden]) (2.8.2)
Collecting cycler>=0.10
Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting pillow>=6.2.0
Using cached Pillow-8.4.0-cp36-cp36m-win_amd64.whl (3.2 MB)
Collecting decorator<5,>=4.3
Using cached decorator-4.4.2-py2.py3-none-any.whl (9.2 kB)
Requirement already satisfied: setuptools in c:\users\yuanjian.conda\envs\py363636\lib\site-packages (from numba>=0.41.0->scanpy[leiden]) (58.0.4)
Collecting llvmlite<0.37,>=0.36.0rc1
Using cached llvmlite-0.36.0-cp36-cp36m-win_amd64.whl (16.0 MB)
Requirement already satisfied: pytz>=2017.2 in c:\users\yuanjian.conda\envs\py363636\lib\site-packages (from pandas>=0.21->scanpy[leiden]) (2021.3)
Requirement already satisfied: six>=1.5 in c:\users\yuanjian.conda\envs\py363636\lib\site-packages (from python-dateutil>=2.1->matplotlib>=3.1.2->scanpy[leiden]) (1.16.0)
Collecting threadpoolctl>=2.0.0
Using cached threadpoolctl-3.0.0-py3-none-any.whl (14 kB)
Collecting pynndescent>=0.5
Using cached pynndescent-0.5.5-py3-none-any.whl
Collecting get-version>=2.0.4
Using cached get_version-2.1-py3-none-any.whl (43 kB)
Collecting igraph==0.9.8
Using cached igraph-0.9.8-cp36-cp36m-win_amd64.whl (2.7 MB)
Collecting texttable>=1.6.2
Using cached texttable-1.6.4-py2.py3-none-any.whl (10 kB)
Collecting stdlib-list
Using cached stdlib_list-0.8.0-py3-none-any.whl (63 kB)
Collecting numexpr>=2.6.2
Using cached numexpr-2.7.3-cp36-cp36m-win_amd64.whl (93 kB)
Requirement already satisfied: colorama in c:\users\yuanjian.conda\envs\py363636\lib\site-packages (from tqdm->scanpy[leiden]) (0.4.4)
Installing collected packages: numpy, threadpoolctl, scipy, llvmlite, joblib, texttable, scikit-learn, pillow, numba, kiwisolver, cycler, cached-property, xlrd, tqdm, stdlib-list, pynndescent, patsy, pandas, numexpr, natsort, matplotlib, igraph, h5py, get-version, decorator, umap-learn, tables, statsmodels, sinfo, seaborn, python-igraph, networkx, legacy-api-wrap, anndata, scanpy, leidenalg
Attempting uninstall: decorator
Found existing installation: decorator 5.1.0
Uninstalling decorator-5.1.0:
Successfully uninstalled decorator-5.1.0
Successfully installed anndata-0.7.6 cached-property-1.5.2 cycler-0.11.0 decorator-4.4.2 get-version-2.1 h5py-3.1.0 igraph-0.9.8 joblib-1.1.0 kiwisolver-1.3.1 legacy-api-wrap-1.2 leidenalg-0.8.8 llvmlite-0.36.0 matplotlib-3.3.4 natsort-8.0.0 networkx-2.5.1 numba-0.53.1 numexpr-2.7.3 numpy-1.19.5 pandas-1.1.5 patsy-0.5.2 pillow-8.4.0 pynndescent-0.5.5 python-igraph-0.9.8 scanpy-1.7.2 scikit-learn-0.24.2 scipy-1.5.4 seaborn-0.11.2 sinfo-0.3.4 statsmodels-0.12.2 stdlib-list-0.8.0 tables-3.6.1 texttable-1.6.4 threadpoolctl-3.0.0 tqdm-4.62.3 umap-learn-0.5.2 xlrd-1.2.0

ivirshup

ivirshup commented on Nov 8, 2021

@ivirshup
Member

We recently made a release (1.8.2) which has a bug fix for an incompatibility with umap 0.5.2. The fix was actually contributed by the author of UMAP!

Upgrading should fix your issue.

hurleyLi

hurleyLi commented on Nov 8, 2021

@hurleyLi

It seems that upgrading from 1.8.1 to 1.8.2 introduce an error on umap version checking, mentioned by #1978 (and a potential solution)

Why are we using umap.version instead of importlib.metadata.version('umap-learn')?

hyjforesight

hyjforesight commented on Nov 8, 2021

@hyjforesight
Author

@ivirshup
Hello ivirshup, thanks for the solution. I upgrade to py 3.8 and install scanpy 1.8.2, problem solved.

hurleyLi

hurleyLi commented on Nov 8, 2021

@hurleyLi

Just figured it out. It is because I have both umap and umap-learn installed, but even if I do pip uninstall umap, it doesn't totally remove umap for whatever reason. I had to uninstall both umap and umap-learn first, and then re-install umap-learn to get it to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ivirshup@hurleyLi@hyjforesight

        Issue actions

          UMAP goes wrong on scanpy v1.7.2 · Issue #2045 · scverse/scanpy