UMAP is unreproducible between 3 Windows PCs
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 779
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 27
Description
- [✔] I have checked that this issue has not already been reported.
- [✔] I have confirmed this bug exists on the latest version of scanpy.
- [✔] (optional) I have confirmed this bug exists on the master branch of scanpy.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Hello Scanpy,
This BUG is quite weird. It starts since we installed Anaconda3-v2021.11 on 3 individual Windows PCs. We run the same dataset by the same coding. However, it generates 3 different UMAPs. The coding is as below.
UMAP of Windows PC2 is consistent with our previous UMAPs done on PC1 and PC2 in November with Anaconda3-v2021.05.
Could you please help us with this issue?
Thanks!
Best,
YJ
Minimal code sample (that we can copy&paste without having any data)
import numpy as np
import pandas as pd
import scanpy as sc
import scanpy.external as sce
import scipy
sc.settings.verbosity = 3
sc.logging.print_header()
sc.set_figure_params(dpi=100, dpi_save=600)
adata = sc.read_loom(filename='C:/Users/Park_Lab/Documents/Tumor.loom')
adata.var_names_make_unique()
adata
sc.pl.highest_expr_genes(adata, n_top=20)
sc.pp.filter_cells(adata, min_genes=100)
sc.pp.filter_genes(adata, min_cells=25)
adata.var['mt'] = adata.var_names.str.startswith('mt-')
adata.var['rpl'] = adata.var_names.str.startswith('Rpl')
adata.var['rps'] = adata.var_names.str.startswith('Rps')
adata
sc.pp.calculate_qc_metrics(adata, qc_vars=['mt','rpl','rps'], percent_top=None, log1p=False, inplace=True)
sc.pl.violin(adata, keys=['n_genes_by_counts', 'total_counts', 'pct_counts_mt','pct_counts_rpl','pct_counts_rps'], jitter=0.4, multi_panel=True)
adata
sc.pl.scatter(adata, x='total_counts', y='pct_counts_mt')
sc.pl.scatter(adata, x='total_counts', y='pct_counts_rpl')
sc.pl.scatter(adata, x='total_counts', y='pct_counts_rps')
sc.pl.scatter(adata, x='total_counts', y='n_genes_by_counts')
adata = adata[adata.obs.n_genes_by_counts < 6000, :]
adata = adata[adata.obs.pct_counts_mt < 50, :]
adata = adata[adata.obs.pct_counts_rpl < 50, :]
adata = adata[adata.obs.pct_counts_rps < 50, :]
adata
sc.pp.normalize_total(adata)
sc.pp.log1p(adata)
adata
sc.pp.highly_variable_genes(adata, n_top_genes=5000)
sc.pl.highly_variable_genes(adata)
print(sum(adata.var.highly_variable))
adata
adata.raw=adata
adata = adata[:, adata.var.highly_variable]
adata
sc.pp.regress_out(adata, keys=['pct_counts_mt','pct_counts_rpl','pct_counts_rps'], n_jobs=16)
sc.pp.scale(adata, max_value=10)
adata
sc.tl.pca(adata, svd_solver='arpack')
sc.pp.neighbors(adata, n_pcs=50, knn=True)
sc.tl.leiden(adata, resolution=1)
sc.tl.umap(adata)
adata
sc.pl.umap(adata, color=['leiden'], legend_loc='on data', frameon=False, title='', use_raw=False)
sc.pl.umap(adata, color=['leiden'], legend_loc='', frameon=False, title='', save='ACT.pdf', use_raw=False)
UMAP of Windows PC1 (i7-1065G7, Windows 11 x64 21H2)

UMAP of Windows PC2 (i7-10700, Windows 10 x64 1809)

UMAP of Windows PC3 (Xeon Silver 4210, Windows 10 x64 1809)

Versions
| Windows PC1 | Windows PC2 | Windows PC3 | |||
|---|---|---|---|---|---|
| adjustText | 0.7.3 | adjustText | 0.7.3 | adjustText | 0.7.3 |
| aiohttp | 3.8.1 | aiohttp | 3.8.1 | aiohttp | 3.8.1 |
| aiosignal | 1.2.0 | aiosignal | 1.2.0 | aiosignal | 1.2.0 |
| anndata | 0.7.8 | anndata | 0.7.8 | anndata | 0.7.8 |
| anyio | 2.2.0 | anyio | 2.2.0 | anyio | 2.2.0 |
| arboreto | 0.1.6 | arboreto | 0.1.6 | arboreto | 0.1.6 |
| argon2-cffi | 20.1.0 | argon2-cffi | 20.1.0 | argon2-cffi | 20.1.0 |
| async-generator | 1.1 | async-generator | 1.1 | async-generator | 1.1 |
| async-timeout | 4.0.2 | async-timeout | 4.0.2 | async-timeout | 4.0.2 |
| attrs | 21.4.0 | attrs | 21.2.0 | attrs | 21.4.0 |
| Babel | 2.9.1 | Babel | 2.9.1 | Babel | 2.9.1 |
| backcall | 0.2.0 | backcall | 0.2.0 | backcall | 0.2.0 |
| bleach | 4.1.0 | bleach | 4.1.0 | bleach | 4.1.0 |
| bokeh | 2.4.2 | bokeh | 2.4.2 | bokeh | 2.4.2 |
| boltons | 21.0.0 | boltons | 21.0.0 | boltons | 21.0.0 |
| brotlipy | 0.7.0 | brotlipy | 0.7.0 | brotlipy | 0.7.0 |
| cellrank | 1.5.1 | cellrank | 1.5.1 | cellrank | 1.5.1 |
| certifi | 2020.6.20 | certifi | 2020.6.20 | certifi | 2020.6.20 |
| cffi | 1.15.0 | cffi | 1.15.0 | cffi | 1.15.0 |
| charset-normalizer | 2.0.4 | charset-normalizer | 2.0.4 | charset-normalizer | 2.0.4 |
| click | 8.0.3 | click | 8.0.3 | click | 8.0.3 |
| cloudpickle | 2.0.0 | cloudpickle | 2.0.0 | cloudpickle | 2.0.0 |
| colorama | 0.4.4 | colorama | 0.4.4 | colorama | 0.4.4 |
| cryptography | 36.0.0 | cryptography | 36.0.0 | cryptography | 36.0.0 |
| ctxcore | 0.1.1 | ctxcore | 0.1.1 | ctxcore | 0.1.1 |
| cycler | 0.11.0 | cycler | 0.11.0 | cycler | 0.11.0 |
| cytoolz | 0.11.0 | cytoolz | 0.11.0 | cytoolz | 0.11.0 |
| dask | 2022.1.0 | dask | 2022.1.0 | dask | 2022.1.0 |
| debugpy | 1.5.1 | debugpy | 1.5.1 | debugpy | 1.5.1 |
| decorator | 5.1.0 | decorator | 5.1.0 | decorator | 5.1.0 |
| defusedxml | 0.7.1 | defusedxml | 0.7.1 | defusedxml | 0.7.1 |
| dill | 0.3.4 | dill | 0.3.4 | dill | 0.3.4 |
| distributed | 2022.1.0 | distributed | 2022.1.0 | distributed | 2022.1.0 |
| docrep | 0.3.2 | docrep | 0.3.2 | docrep | 0.3.2 |
| entrypoints | 0.3 | entrypoints | 0.3 | entrypoints | 0.3 |
| et-xmlfile | 1.1.0 | et-xmlfile | 1.1.0 | et-xmlfile | 1.1.0 |
| fonttools | 4.28.5 | fonttools | 4.28.5 | fonttools | 4.28.5 |
| frozendict | 2.2.0 | frozendict | 2.1.3 | frozendict | 2.2.0 |
| frozenlist | 1.3.0 | frozenlist | 1.2.0 | frozenlist | 1.3.0 |
| fsspec | 2022.1.0 | fsspec | 2022.1.0 | fsspec | 2022.1.0 |
| future | 0.18.2 | future | 0.18.2 | future | 0.18.2 |
| gtfparse | 1.2.1 | ||||
| h5py | 3.6.0 | h5py | 3.6.0 | h5py | 3.6.0 |
| HeapDict | 1.0.1 | HeapDict | 1.0.1 | HeapDict | 1.0.1 |
| idna | 3.3 | idna | 3.3 | idna | 3.3 |
| igraph | 0.9.9 | igraph | 0.9.9 | igraph | 0.9.9 |
| importlib-metadata | 4.8.2 | importlib-metadata | 4.8.2 | importlib-metadata | 4.8.2 |
| infercnvpy | 0.2.0 | ||||
| interlap | 0.2.7 | interlap | 0.2.7 | interlap | 0.2.7 |
| ipykernel | 6.4.1 | ipykernel | 6.4.1 | ipykernel | 6.4.1 |
| ipython | 7.29.0 | ipython | 7.29.0 | ipython | 7.29.0 |
| ipython-genutils | 0.2.0 | ipython-genutils | 0.2.0 | ipython-genutils | 0.2.0 |
| ipywidgets | 7.6.5 | ipywidgets | 7.6.5 | ipywidgets | 7.6.5 |
| jedi | 0.18.0 | jedi | 0.18.0 | jedi | 0.18.0 |
| Jinja2 | 3.0.2 | Jinja2 | 3.0.2 | Jinja2 | 3.0.2 |
| joblib | 1.1.0 | joblib | 1.1.0 | joblib | 1.1.0 |
| json5 | 0.9.6 | json5 | 0.9.6 | json5 | 0.9.6 |
| jsonschema | 3.2.0 | jsonschema | 3.2.0 | jsonschema | 3.2.0 |
| jupyter-client | 7.1.0 | jupyter-client | 7.1.0 | jupyter-client | 7.1.0 |
| jupyter-core | 4.9.1 | jupyter-core | 4.9.1 | jupyter-core | 4.9.1 |
| jupyter-server | 1.4.1 | jupyter-server | 1.4.1 | jupyter-server | 1.4.1 |
| jupyterlab | 3.2.1 | jupyterlab | 3.2.1 | jupyterlab | 3.2.1 |
| jupyterlab-pygments | 0.1.2 | jupyterlab-pygments | 0.1.2 | jupyterlab-pygments | 0.1.2 |
| jupyterlab-server | 2.10.2 | jupyterlab-server | 2.10.2 | jupyterlab-server | 2.10.2 |
| jupyterlab-widgets | 1.0.2 | jupyterlab-widgets | 1.0.2 | jupyterlab-widgets | 1.0.2 |
| kiwisolver | 1.3.2 | kiwisolver | 1.3.2 | kiwisolver | 1.3.2 |
| leidenalg | 0.8.8 | leidenalg | 0.8.8 | leidenalg | 0.8.8 |
| llvmlite | 0.38.0 | llvmlite | 0.38.0 | llvmlite | 0.38.0 |
| locket | 0.2.1 | locket | 0.2.1 | locket | 0.2.1 |
| loompy | 3.0.6 | loompy | 3.0.6 | loompy | 3.0.6 |
| MarkupSafe | 2.0.1 | MarkupSafe | 2.0.1 | MarkupSafe | 2.0.1 |
| matplotlib | 3.5.1 | matplotlib | 3.5.1 | matplotlib | 3.5.1 |
| matplotlib-inline | 0.1.2 | matplotlib-inline | 0.1.2 | matplotlib-inline | 0.1.2 |
| mistune | 0.8.4 | mistune | 0.8.4 | mistune | 0.8.4 |
| msgpack | 1.0.3 | msgpack | 1.0.3 | msgpack | 1.0.3 |
| multidict | 5.2.0 | multidict | 5.2.0 | multidict | 5.2.0 |
| multiprocessing-on-dill | 3.5.0a4 | multiprocessing-on-dill | 3.5.0a4 | multiprocessing-on-dill | 3.5.0a4 |
| natsort | 8.0.2 | natsort | 8.0.2 | natsort | 8.0.2 |
| nbclassic | 0.2.6 | nbclassic | 0.2.6 | nbclassic | 0.2.6 |
| nbclient | 0.5.3 | nbclient | 0.5.3 | nbclient | 0.5.3 |
| nbconvert | 6.1.0 | nbconvert | 6.1.0 | nbconvert | 6.1.0 |
| nbformat | 5.1.3 | nbformat | 5.1.3 | nbformat | 5.1.3 |
| nest-asyncio | 1.5.1 | nest-asyncio | 1.5.1 | nest-asyncio | 1.5.1 |
| networkx | 2.6.3 | networkx | 2.6.3 | networkx | 2.6.3 |
| notebook | 6.4.6 | notebook | 6.4.6 | notebook | 6.4.6 |
| numba | 0.55.0 | numba | 0.55.0 | numba | 0.55.0 |
| numexpr | 2.8.1 | numexpr | 2.8.1 | numexpr | 2.8.1 |
| numpy | 1.21.5 | numpy | 1.21.5 | numpy | 1.21.5 |
| numpy-groupies | 0.9.14 | numpy-groupies | 0.9.14 | numpy-groupies | 0.9.14 |
| openpyxl | 3.0.9 | openpyxl | 3.0.9 | openpyxl | 3.0.9 |
| packaging | 21.3 | packaging | 21.3 | packaging | 21.3 |
| pandas | 1.3.5 | pandas | 1.3.5 | pandas | 1.3.5 |
| pandocfilters | 1.4.3 | pandocfilters | 1.4.3 | pandocfilters | 1.4.3 |
| parso | 0.8.3 | parso | 0.8.3 | parso | 0.8.3 |
| partd | 1.2.0 | partd | 1.2.0 | partd | 1.2.0 |
| patsy | 0.5.2 | patsy | 0.5.2 | patsy | 0.5.2 |
| pickleshare | 0.7.5 | pickleshare | 0.7.5 | pickleshare | 0.7.5 |
| Pillow | 9.0.0 | Pillow | 9.0.0 | Pillow | 9.0.0 |
| pip | 21.2.2 | pip | 21.2.2 | pip | 21.2.2 |
| progressbar2 | 4.0.0 | progressbar2 | 4.0.0 | progressbar2 | 4.0.0 |
| prometheus-client | 0.12.0 | prometheus-client | 0.12.0 | prometheus-client | 0.12.0 |
| prompt-toolkit | 3.0.20 | prompt-toolkit | 3.0.20 | prompt-toolkit | 3.0.20 |
| psutil | 5.9.0 | psutil | 5.9.0 | psutil | 5.9.0 |
| pyarrow | 0.16.0 | pyarrow | 0.16.0 | pyarrow | 0.16.0 |
| pycairo | 1.20.1 | ||||
| pycparser | 2.21 | pycparser | 2.21 | pycparser | 2.21 |
| pygam | 0.8.0 | pygam | 0.8.0 | pygam | 0.8.0 |
| Pygments | 2.10.0 | Pygments | 2.10.0 | Pygments | 2.10.0 |
| pygpcca | 1.0.3 | pygpcca | 1.0.3 | pygpcca | 1.0.3 |
| pynndescent | 0.5.5 | pynndescent | 0.5.5 | pynndescent | 0.5.5 |
| pyOpenSSL | 21.0.0 | pyOpenSSL | 21.0.0 | pyOpenSSL | 21.0.0 |
| pyparsing | 3.0.4 | pyparsing | 3.0.4 | pyparsing | 3.0.4 |
| pyrsistent | 0.18.0 | pyrsistent | 0.18.0 | pyrsistent | 0.18.0 |
| pyscenic | 0.11.2 | pyscenic | 0.11.2 | pyscenic | 0.11.2 |
| PySocks | 1.7.1 | PySocks | 1.7.1 | PySocks | 1.7.1 |
| python-dateutil | 2.8.2 | python-dateutil | 2.8.2 | python-dateutil | 2.8.2 |
| python-igraph | 0.9.9 | python-igraph | 0.9.9 | python-igraph | 0.9.9 |
| python-utils | 3.1.0 | python-utils | 3.1.0 | python-utils | 3.1.0 |
| pytoml | 0.1.21 | ||||
| pytz | 2021.3 | pytz | 2021.3 | pytz | 2021.3 |
| pywin32 | 302 | pywin32 | 302 | pywin32 | 302 |
| pywinpty | 0.5.7 | pywinpty | 0.5.7 | pywinpty | 0.5.7 |
| PyYAML | 6 | PyYAML | 6 | PyYAML | 6 |
| pyzmq | 22.3.0 | pyzmq | 22.3.0 | pyzmq | 22.3.0 |
| requests | 2.27.1 | requests | 2.27.1 | requests | 2.27.1 |
| scanpy | 1.8.2 | scanpy | 1.8.2 | scanpy | 1.8.2 |
| scikit-learn | 1.0.2 | scikit-learn | 1.0.2 | scikit-learn | 1.0.2 |
| scikit-misc | 0.1.4 | ||||
| scipy | 1.7.3 | scipy | 1.7.3 | scipy | 1.7.3 |
| scvelo | 0.2.4 | scvelo | 0.2.4 | scvelo | 0.2.4 |
| seaborn | 0.11.2 | seaborn | 0.11.2 | seaborn | 0.11.2 |
| Send2Trash | 1.8.0 | Send2Trash | 1.8.0 | Send2Trash | 1.8.0 |
| setuptools | 58.0.4 | setuptools | 58.0.4 | setuptools | 58.0.4 |
| setuptools-scm | 6.3.2 | ||||
| sinfo | 0.3.4 | sinfo | 0.3.4 | sinfo | 0.3.4 |
| six | 1.16.0 | six | 1.16.0 | six | 1.16.0 |
| sniffio | 1.2.0 | sniffio | 1.2.0 | sniffio | 1.2.0 |
| sortedcontainers | 2.4.0 | sortedcontainers | 2.4.0 | sortedcontainers | 2.4.0 |
| statsmodels | 0.13.1 | statsmodels | 0.13.1 | statsmodels | 0.13.1 |
| stdlib-list | 0.8.0 | stdlib-list | 0.8.0 | stdlib-list | 0.8.0 |
| tables | 3.6.1 | tables | 3.6.1 | tables | 3.6.1 |
| tblib | 1.7.0 | tblib | 1.7.0 | tblib | 1.7.0 |
| terminado | 0.9.4 | terminado | 0.9.4 | terminado | 0.9.4 |
| testpath | 0.5.0 | testpath | 0.5.0 | testpath | 0.5.0 |
| texttable | 1.6.4 | texttable | 1.6.4 | texttable | 1.6.4 |
| threadpoolctl | 3.0.0 | threadpoolctl | 3.0.0 | threadpoolctl | 3.0.0 |
| tomli | 2.0.0 | ||||
| toolz | 0.11.1 | toolz | 0.11.1 | toolz | 0.11.1 |
| tornado | 6.1 | tornado | 6.1 | tornado | 6.1 |
| tqdm | 4.62.3 | tqdm | 4.62.3 | tqdm | 4.62.3 |
| traitlets | 5.1.1 | traitlets | 5.1.1 | traitlets | 5.1.1 |
| typing_extensions | 4.0.1 | typing_extensions | 4.0.1 | typing_extensions | 4.0.1 |
| umap-learn | 0.5.2 | umap-learn | 0.5.2 | umap-learn | 0.5.2 |
| urllib3 | 1.26.7 | urllib3 | 1.26.7 | urllib3 | 1.26.7 |
| wcwidth | 0.2.5 | wcwidth | 0.2.5 | wcwidth | 0.2.5 |
| webencodings | 0.5.1 | webencodings | 0.5.1 | webencodings | 0.5.1 |
| wheel | 0.37.1 | wheel | 0.37.1 | wheel | 0.37.1 |
| widgetsnbextension | 3.5.2 | widgetsnbextension | 3.5.2 | widgetsnbextension | 3.5.2 |
| win-inet-pton | 1.1.0 | win-inet-pton | 1.1.0 | win-inet-pton | 1.1.0 |
| wincertstore | 0.2 | wincertstore | 0.2 | wincertstore | 0.2 |
| wrapt | 1.13.3 | wrapt | 1.13.3 | wrapt | 1.13.3 |
| xlrd | 1.2.0 | xlrd | 1.2.0 | xlrd | 1.2.0 |
| yarl | 1.7.2 | yarl | 1.7.2 | yarl | 1.7.2 |
| zict | 2.0.0 | zict | 2.0.0 | zict | 2.0.0 |
| zipp | 3.7.0 | zipp | 3.7.0 | zipp | 3.7.0 |
These packages are different among these 3 PCs :
<style> </style>| attrs | 21.2.0 |
|---|---|
| frozendict | 2.1.3 |
| frozenlist | 1.2.0 |
| gtfparse | 1.2.1 |
| infercnvpy | 0.2.0 |
| pycairo | 1.20.1 |
| pytoml | 0.1.21 |
| scikit-misc | 0.1.4 |
| setuptools-scm | 6.3.2 |
| tomli | 2.0.0 |
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the supplied Python pipeline from data loading through sc.tl.umap on the three Windows environments described. Compare the listed package versions and operating-system details, then isolate which preprocessing or UMAP step first diverges. Done means identifying a reproducible cause or documenting the missing information needed to reproduce the discrepancy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, pandas, python
- Domain
- bioinformatics, data-visualization, machine-learning
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100