Skip to content
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

Error in sc.tl.umap #1579

Closed
3 tasks
OnlyBelter opened this issue Jan 12, 2021 · 15 comments
Closed
3 tasks

Error in sc.tl.umap #1579

OnlyBelter opened this issue Jan 12, 2021 · 15 comments
Labels

Comments

@OnlyBelter
Copy link

OnlyBelter commented Jan 12, 2021

  • 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.

Minimal code sample (that we can copy&paste without having any data)

I am learning the example of Integrating data using ingest and BBKNN. When I run code

sc.tl.umap(adata_ref)

I get

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-13-0e548e19df3a> in <module>
      1 sc.pp.pca(adata_ref)
      2 sc.pp.neighbors(adata_ref)
----> 3 sc.tl.umap(adata_ref)

~/miniconda3/envs/tf/lib/python3.6/site-packages/scanpy/tools/_umap.py in umap(adata, min_dist, spread, n_components, maxiter, alpha, gamma, negative_sample_rate, init_pos, random_state, a, b, copy, method, neighbors_key)
    171             neigh_params.get('metric', 'euclidean'),
    172             neigh_params.get('metric_kwds', {}),
--> 173             verbose=settings.verbosity > 3,
    174         )
    175     elif method == 'rapids':

TypeError: simplicial_set_embedding() missing 3 required positional arguments: 'densmap', 'densmap_kwds', and 'output_dens'

Versions

scanpy==1.6.0 anndata==0.7.5 umap==0.5.0 numpy==1.19.5 scipy==1.5.4 pandas==1.1.5 scikit-learn==0.24.0 statsmodels==0.12.1 python-igraph==0.8.3 leidenalg==0.8.3

@OnlyBelter
Copy link
Author

Since umap-learn updated to version 0.5.0 from 0.4.6, the interface may have changed.

@scottgigante
Copy link
Contributor

+1. Seems like pinning the version to <0.5 for now would solve the problem.

@scottgigante
Copy link
Contributor

Looks like this was solved on master last month. Any chance we could get a bugfix release?

scottgigante added a commit to openproblems-bio/openproblems that referenced this issue Jan 12, 2021
BiocondaBot pushed a commit to bioconda/bioconda-recipes that referenced this issue Jan 13, 2021
Merge PR #26180, commits were: 
 * Fix space in requirements
 * Update requirements from git

Esspecially umap-learn hast to be restircted to version <0.5

see issue scverse/scanpy#1579
@ivirshup
Copy link
Member

ivirshup commented Jan 14, 2021

So we've just put out a release of 1.7.0rc1, and will be releasing it proper soon.
I'm looking at making a 1.6.1 release where the only change is pinning umap, but there are some CI issues (largely tests failing due to Matplotlib outputs changing slightly).

@ndrsfel
Copy link

ndrsfel commented Jan 14, 2021

Thank you for the release update! I just had to
pip install git+https://github.com/theislab/scanpy.git@1.7.0rc1

@ivirshup
Copy link
Member

I've just pushed 1.6.1 (pinning umap), but you can get the release candidate for 1.7.0 with pip install "scanpy==1.7.0rc1"

odavalos added a commit to odavalos/ACTINN-PyTorch that referenced this issue Mar 30, 2021
changing scanpy version to avoid bug due to issue with umap-learn scverse/scanpy#1579
WeilerP referenced this issue in theislab/scvelo Apr 19, 2021
Use umap-learn version priot to `0.5`.
@savitaj
Copy link

savitaj commented Jul 8, 2021

Has this error been fixed? Facing the same issue for scanpy version 1.7.2

@OnlyBelter
Copy link
Author

Version 1.8.0 works well.

@brianpenghe
Copy link

I tried downgrading umap-learn to 0.4.6 but then sc.pp.neighbors won't work. I've been using scanpy 1.5.0

@brianpenghe
Copy link

brianpenghe commented Aug 31, 2021

OK I computed the neighbors using umap-learn 0.5.1 and then downgraded to 0.4.6 for UMAP. Not elegant but so far so good.

@brianpenghe
Copy link

Updating to Scanpy 1.8.2 worked!

@dajsfiles
Copy link

Sorry for opening this thread again, but I think I've run into the same problem. Here's my code and error:

mat_all = sc.read_loom(filename="RSV.loom")
sc.pp.pca(mat_all)
sc.pp.neighbors(mat_all)
sc.tl.umap(mat_all)

The error message:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/tmp/31048.tmpdir/ipykernel_3245/2128514342.py in <module>
      3 sc.pp.pca(mat_all)
      4 sc.pp.neighbors(mat_all)
----> 5 sc.tl.umap(mat_all)
      6 sc.pl.tsne(mat_all, color="cluster",legend_loc="on data",
      7            size=20, save=True)

/storage1/fs1/leyao.wang/Active/conda/envs/velocyto3.9/lib/python3.9/site-packages/scanpy/tools/_umap.py in umap(adata, min_dist, spread, n_components, maxiter, alpha, gamma, negative_sample_rate, init_pos, random_state, a, b, copy, method, neighbors_key)
    192         default_epochs = 500 if neighbors['connectivities'].shape[0] <= 10000 else 200
    193         n_epochs = default_epochs if maxiter is None else maxiter
--> 194         X_umap = simplicial_set_embedding(
    195             X,
    196             neighbors['connectivities'].tocoo(),

TypeError: simplicial_set_embedding() missing 3 required positional arguments: 'densmap', 'densmap_kwds', and 'output_dens'

And the versions I've been running:
anndata 0.7.8
asttokens 2.0.5
bcrypt 3.2.0
Bottleneck 1.3.2
brotlipy 0.7.0
cached-property 1.5.2
certifi 2021.10.8
cffi 1.15.0
charset-normalizer 2.0.12
chart-studio 1.1.0
click 8.0.4
cmake 3.22.2
colorama 0.4.4
conda 4.11.0
conda-package-handling 1.7.3
cryptography 36.0.1
cycler 0.11.0
Cython 0.29.20
devtools 0.8.0
dunamai 1.9.0
executing 0.8.2
fa2 0.3.5
Fabric 1.6.1
fonttools 4.29.1
get_version 3.5.4
h5py 3.6.0
idna 3.3
igraph 0.9.9
install 1.3.5
joblib 1.1.0
kiwisolver 1.3.2
legacy-api-wrap 1.2
llvmlite 0.38.0
loom 0.0.18
loompy 3.0.6
mamba 0.15.3
matplotlib 3.5.1
mkl-fft 1.3.1
mkl-random 1.2.2
mkl-service 2.4.0
MulticoreTSNE 0.1
natsort 8.1.0
networkx 2.6.3
numba 0.55.1
numexpr 2.8.1
numpy 1.21.2
numpy-groupies 0.9.14
opt-einsum 3.3.0
packaging 21.3
pandas 1.4.1
paramiko 2.9.2
patsy 0.5.2
Pillow 9.0.1
pip 21.2.4
plotly 5.6.0
pycosat 0.6.3
pycparser 2.21
PyNaCl 1.5.0
pynndescent 0.5.6
pyOpenSSL 22.0.0
pyparsing 3.0.7
PyQt5 5.12.3
PyQt5_sip 4.19.18
PyQtChart 5.12
PyQtWebEngine 5.12.1
pyro-api 0.1.2
pyro-ppl 1.8.0
pysam 0.18.0
PySocks 1.7.1
python-dateutil 2.8.2
pytz 2021.3
requests 2.27.1
retrying 1.3.3
ruamel-yaml-conda 0.15.80
scanpy 1.7.0rc1
scikit-learn 1.0.2
scipy 1.7.3
seaborn 0.11.2
setuptools 58.0.4
sinfo 0.3.4
six 1.16.0
statsmodels 0.13.2
stdlib-list 0.8.0
tables 3.7.0
tenacity 8.0.1
texttable 1.6.4
threadpoolctl 3.1.0
torch 1.10.2
tornado 6.1
tqdm 4.62.3
umap-learn 0.4.6
unicodedata2 14.0.0
urllib3 1.26.8
velocyto 0.17.17
wheel 0.37.1
xlrd 1.2.0

If anyone can help me resolve this that would be great. Thanks!

@dajsfiles
Copy link

Just updated to scanpy 1.8.2, but the problem persists.

@YubinXie
Copy link

scanpy 1.9.1 has this issue too.

@tdefa
Copy link

tdefa commented Aug 3, 2023

udpating umap-learn work for me

pip install umap-learn==0.5.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants