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

pbmc <- RunUMAP(pbmc, dims = 1:10) doesn't work #1754

Closed
YungChihLai opened this issue Jun 27, 2019 · 2 comments
Closed

pbmc <- RunUMAP(pbmc, dims = 1:10) doesn't work #1754

YungChihLai opened this issue Jun 27, 2019 · 2 comments

Comments

@YungChihLai
Copy link

The error message is below, and four methods I have tried don't work (the detail below). I use a MacBook Pro (Retina, 15-inch, Mid 2015) with macOS Sierra Version 10.12.6. Could you help me? Many thanks.

Best,

Gary

  • Error message in Rstudio
> pbmc <- RunUMAP(pbmc, dims = 1:10)
Error in RunUMAP(pbmc, dims = 1:10) : could not find function "RunUMAP"
> library(reticulate)
> py_install("umap-learn")
Error in conda_python(envname = envname, conda = conda) : 
  conda environment r-reticulate not found
> reticulate::py_config()
python:         /usr/bin/python
libpython:      /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib
pythonhome:     /System/Library/Frameworks/Python.framework/Versions/2.7:/System/Library/Frameworks/Python.framework/Versions/2.7
version:        2.7.10 (default, Feb  7 2017, 00:08:15)  [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
numpy:          /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy
numpy_version:  1.8.0

python versions found: 
 /usr/bin/python
 /Users/gary/anaconda/bin/python
 /anaconda3/envs/Renv/bin/python
> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] reticulate_1.12

loaded via a namespace (and not attached):
 [1] httr_1.4.0          tidyr_0.8.3         jsonlite_1.6        viridisLite_0.3.0   splines_3.5.0       lsei_1.2-0         
 [7] R.utils_2.8.0       gtools_3.8.1        Rdpack_0.11-0       assertthat_0.2.0    ggrepel_0.8.0       globals_0.12.4     
[13] pillar_1.3.1        lattice_0.20-38     glue_1.3.0          digest_0.6.18       RColorBrewer_1.1-2  SDMTools_1.1-221.1 
[19] colorspace_1.4-0    cowplot_0.9.4       htmltools_0.3.6     Matrix_1.2-16       R.oo_1.22.0         plyr_1.8.4         
[25] pkgconfig_2.0.2     bibtex_0.4.2        tsne_0.1-3          listenv_0.7.0       purrr_0.3.1         scales_1.0.0       
[31] RANN_2.6.1          gdata_2.18.0        Rtsne_0.15          tibble_2.0.1        ggplot2_3.1.0       ROCR_1.0-7         
[37] pbapply_1.4-0       lazyeval_0.2.1      survival_2.43-3     magrittr_1.5        crayon_1.3.4        R.methodsS3_1.7.1  
[43] future_1.13.0       nlme_3.1-137        MASS_7.3-51.1       gplots_3.0.1.1      ica_1.0-2           tools_3.5.0        
[49] fitdistrplus_1.0-14 data.table_1.12.0   gbRd_0.4-11         stringr_1.4.0       plotly_4.8.0        munsell_0.5.0      
[55] cluster_2.0.7-1     irlba_2.3.3         compiler_3.5.0      rsvd_1.0.1          caTools_1.17.1.2    rlang_0.3.1        
[61] grid_3.5.0          ggridges_0.5.1      rstudioapi_0.9.0    htmlwidgets_1.3     igraph_1.2.4        bitops_1.0-6       
[67] Seurat_3.0.2        npsurv_0.4-0        gtable_0.2.0        codetools_0.2-16    reshape2_1.4.3      R6_2.4.0           
[73] gridExtra_2.3       zoo_1.8-4           dplyr_0.8.0.1       future.apply_1.3.0  KernSmooth_2.23-15  metap_1.1          
[79] ape_5.3             stringi_1.3.1       parallel_3.5.0      Rcpp_1.0.0          sctransform_0.2.0   png_0.1-7          
[85] tidyselect_0.2.5    lmtest_0.9-37      

The methods I have tried

  • Method I. using pip
gary > pip install umap-learn
Collecting umap-learn
  Downloading https://files.pythonhosted.org/packages/d9/15/ced881a7af6184c5556dbffbfc82750904a18c6fdafb248ca84873d0be06/umap-learn-0.3.9.tar.gz (40kB)
    100% |████████████████████████████████| 40kB 201kB/s 
Requirement already satisfied: numpy>=1.13 in /anaconda3/lib/python3.7/site-packages (from umap-learn) (1.15.4)
Requirement already satisfied: scikit-learn>=0.16 in /anaconda3/lib/python3.7/site-packages (from umap-learn) (0.20.1)
Requirement already satisfied: scipy>=0.19 in /anaconda3/lib/python3.7/site-packages (from umap-learn) (1.1.0)
Requirement already satisfied: numba>=0.37 in /anaconda3/lib/python3.7/site-packages (from umap-learn) (0.41.0)
Requirement already satisfied: llvmlite>=0.26.0dev0 in /anaconda3/lib/python3.7/site-packages (from numba>=0.37->umap-learn) (0.26.0)
Building wheels for collected packages: umap-learn
  Running setup.py bdist_wheel for umap-learn ... done
  Stored in directory: /Users/gary/Library/Caches/pip/wheels/05/95/2d/455530badd10afd9f49c47c6ab1b3e0072eef5c68eb0c52012
Successfully built umap-learn
Installing collected packages: umap-learn
Successfully installed umap-learn-0.3.9
  • Method II. using conda
gary > conda install -c conda-forge umap-learn
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.12
  latest version: 4.7.5

Please update conda by running

    $ conda update -n base -c defaults conda



## Package Plan ##

  environment location: /anaconda3

  added / updated specs: 
    - umap-learn


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    umap-learn-0.3.9           |           py37_0          62 KB  conda-forge
    conda-package-handling-1.3.10|           py37_0         257 KB  conda-forge
    conda-4.7.5                |           py37_0         3.0 MB  conda-forge
    ------------------------------------------------------------
                                           Total:         3.3 MB

The following NEW packages will be INSTALLED:

    conda-package-handling: 1.3.10-py37_0 conda-forge
    umap-learn:             0.3.9-py37_0  conda-forge

The following packages will be UPDATED:

    conda:                  4.5.12-py37_0             --> 4.7.5-py37_0 conda-forge

Proceed ([y]/n)? y


Downloading and Extracting Packages
umap-learn-0.3.9     | 62 KB     | ########################################################## | 100% 
conda-package-handli | 257 KB    | ########################################################## | 100% 
conda-4.7.5          | 3.0 MB    | ########################################################## | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(base) gary > conda create -n Renv python=3.7
WARNING conda.base.context:use_only_tar_bz2(632): Conda is constrained to only using the old .tar.bz2 file format because you have conda-build installed, and it is <3.18.3.  Update or remove conda-build to get smaller downloads and faster extractions.
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /anaconda3/envs/Renv

  added / updated specs:
    - python=3.7


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ca-certificates-2019.5.15  |                0         133 KB
    certifi-2019.6.16          |           py37_0         154 KB
    libedit-3.1.20181209       |       hb402a30_0         159 KB
    libffi-3.2.1               |                1          41 KB  bioconda
    openssl-1.1.1c             |       h1de35cc_1         3.4 MB
    pip-19.1.1                 |           py37_0         1.8 MB
    python-3.7.3               |       h359304d_0        21.7 MB
    setuptools-41.0.1          |           py37_0         635 KB
    sqlite-3.28.0              |       ha441bb4_0         2.3 MB
    wheel-0.33.4               |           py37_0          39 KB
    ------------------------------------------------------------
                                           Total:        30.4 MB

The following NEW packages will be INSTALLED:

  ca-certificates    pkgs/main/osx-64::ca-certificates-2019.5.15-0
  certifi            pkgs/main/osx-64::certifi-2019.6.16-py37_0
  libcxx             pkgs/main/osx-64::libcxx-4.0.1-hcfea43d_1
  libcxxabi          pkgs/main/osx-64::libcxxabi-4.0.1-hcfea43d_1
  libedit            pkgs/main/osx-64::libedit-3.1.20181209-hb402a30_0
  libffi             bioconda/osx-64::libffi-3.2.1-1
  ncurses            pkgs/main/osx-64::ncurses-6.1-h0a44026_1
  openssl            pkgs/main/osx-64::openssl-1.1.1c-h1de35cc_1
  pip                pkgs/main/osx-64::pip-19.1.1-py37_0
  python             pkgs/main/osx-64::python-3.7.3-h359304d_0
  readline           pkgs/main/osx-64::readline-7.0-h1de35cc_5
  setuptools         pkgs/main/osx-64::setuptools-41.0.1-py37_0
  sqlite             pkgs/main/osx-64::sqlite-3.28.0-ha441bb4_0
  tk                 pkgs/main/osx-64::tk-8.6.8-ha441bb4_0
  wheel              pkgs/main/osx-64::wheel-0.33.4-py37_0
  xz                 pkgs/main/osx-64::xz-5.2.4-h1de35cc_4
  zlib               pkgs/main/osx-64::zlib-1.2.11-h1de35cc_3


Proceed ([y]/n)? y


Downloading and Extracting Packages
sqlite-3.28.0        | 2.3 MB    | ############################################################################################################################### | 100% 
libedit-3.1.20181209 | 159 KB    | ############################################################################################################################### | 100% 
openssl-1.1.1c       | 3.4 MB    | ############################################################################################################################### | 100% 
ca-certificates-2019 | 133 KB    | ############################################################################################################################### | 100% 
python-3.7.3         | 21.7 MB   | ############################################################################################################################### | 100% 
pip-19.1.1           | 1.8 MB    | ############################################################################################################################### | 100% 
setuptools-41.0.1    | 635 KB    | ############################################################################################################################### | 100% 
certifi-2019.6.16    | 154 KB    | ############################################################################################################################### | 100% 
wheel-0.33.4         | 39 KB     | ############################################################################################################################### | 100% 
libffi-3.2.1         | 41 KB     | ############################################################################################################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate Renv
#
# To deactivate an active environment, use
#
#     $ conda deactivate

(base) gary > conda activate Renv
(Renv) gary > pip install umap-learn
Collecting umap-learn
Collecting scikit-learn>=0.16 (from umap-learn)
  Downloading https://files.pythonhosted.org/packages/aa/7d/6c71c35c201f6d5cec318c7ed7841317adbf291513742865ed8904ae4ea9/scikit_learn-0.21.2-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (10.5MB)
     |████████████████████████████████| 10.5MB 2.1MB/s 
Collecting scipy>=0.19 (from umap-learn)
  Downloading https://files.pythonhosted.org/packages/04/66/ec5f1283d6a290a9153881a896837487338c44639c1305cc59e1c7b69cc9/scipy-1.3.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (27.7MB)
     |████████████████████████████████| 27.7MB 1.1MB/s 
Collecting numba>=0.37 (from umap-learn)
  Downloading https://files.pythonhosted.org/packages/08/c2/6edd03208c812ce3d96491d447703dfe31c372f3c0c6eb2373960625ab09/numba-0.44.1-cp37-cp37m-macosx_10_9_x86_64.whl (1.8MB)
     |████████████████████████████████| 1.8MB 13.2MB/s 
Collecting numpy>=1.13 (from umap-learn)
  Downloading https://files.pythonhosted.org/packages/6b/be/608b7f72b851472388eafc010a5d46dae5d41610d0ac5df4c98c2ed1b865/numpy-1.16.4-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (13.9MB)
     |████████████████████████████████| 13.9MB 51.3MB/s 
Collecting joblib>=0.11 (from scikit-learn>=0.16->umap-learn)
  Downloading https://files.pythonhosted.org/packages/cd/c1/50a758e8247561e58cb87305b1e90b171b8c767b15b12a1734001f41d356/joblib-0.13.2-py2.py3-none-any.whl (278kB)
     |████████████████████████████████| 286kB 14.8MB/s 
Collecting llvmlite>=0.29.0 (from numba>=0.37->umap-learn)
  Downloading https://files.pythonhosted.org/packages/d7/45/9216cdbf71b94ae8eefe24cfbdf4c1b9045a58f297c6e2eab5cb8d05faf3/llvmlite-0.29.0-cp37-cp37m-macosx_10_9_x86_64.whl (15.9MB)
     |████████████████████████████████| 15.9MB 8.7MB/s 
Installing collected packages: numpy, joblib, scipy, scikit-learn, llvmlite, numba, umap-learn
Successfully installed joblib-0.13.2 llvmlite-0.29.0 numba-0.44.1 numpy-1.16.4 scikit-learn-0.21.2 scipy-1.3.0 umap-learn-0.3.9
(Renv) gary > 
(base) gary > pwd
/Users/gary/.local/lib/python2.7/site-packages
(base) gary > ll
total 8
drwxr-xr-x  15 gary  staff   510B Mar 11  2017 iced/
-rw-r--r--   1 gary  staff   681B Mar 11  2017 iced-0.4.0_git-py2.7.egg-info
(base) gary > pip install -t /Users/gary/.local/lib/python2.7/site-packages umap-learn
Collecting umap-learn
Collecting numpy>=1.13 (from umap-learn)
  Using cached https://files.pythonhosted.org/packages/6b/be/608b7f72b851472388eafc010a5d46dae5d41610d0ac5df4c98c2ed1b865/numpy-1.16.4-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting scipy>=0.19 (from umap-learn)
  Using cached https://files.pythonhosted.org/packages/04/66/ec5f1283d6a290a9153881a896837487338c44639c1305cc59e1c7b69cc9/scipy-1.3.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting scikit-learn>=0.16 (from umap-learn)
  Using cached https://files.pythonhosted.org/packages/aa/7d/6c71c35c201f6d5cec318c7ed7841317adbf291513742865ed8904ae4ea9/scikit_learn-0.21.2-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting numba>=0.37 (from umap-learn)
  Using cached https://files.pythonhosted.org/packages/08/c2/6edd03208c812ce3d96491d447703dfe31c372f3c0c6eb2373960625ab09/numba-0.44.1-cp37-cp37m-macosx_10_9_x86_64.whl
Collecting joblib>=0.11 (from scikit-learn>=0.16->umap-learn)
  Using cached https://files.pythonhosted.org/packages/cd/c1/50a758e8247561e58cb87305b1e90b171b8c767b15b12a1734001f41d356/joblib-0.13.2-py2.py3-none-any.whl
Collecting llvmlite>=0.29.0 (from numba>=0.37->umap-learn)
  Using cached https://files.pythonhosted.org/packages/d7/45/9216cdbf71b94ae8eefe24cfbdf4c1b9045a58f297c6e2eab5cb8d05faf3/llvmlite-0.29.0-cp37-cp37m-macosx_10_9_x86_64.whl
Installing collected packages: numpy, scipy, joblib, scikit-learn, llvmlite, numba, umap-learn
Successfully installed joblib-0.13.2 llvmlite-0.29.0 numba-0.44.1 numpy-1.16.4 scikit-learn-0.21.2 scipy-1.3.0 umap-learn-0.3.9

In RStudio
> library(reticulate)
> use_condaenv(condaenv = "Renv", conda = "/anaconda3/bin/conda")
> py_install("umap-learn")
Error in conda_python(envname = envname, conda = conda) : 
  conda environment r-reticulate not found
@mojaveazure
Copy link
Member

Hi Gary,

First, could you post the exact R error message from each of these methods? Or at least the time when you removed Conda from your computer and used your Mac's provided Pip/Python installation to install UMAP?

Second, the error message Error in RunUMAP(pbmc, dims = 1:10) : could not find function "RunUMAP" indicates that you don't have Seurat loaded (also seen in your session info). What happens if you completely remove Conda, install UMAP through your Mac's provided Pip/Python installation, then load Seurat and try running RunUMAP?

@mojaveazure mojaveazure added the more-information-needed We need more information before this can be addressed label Jun 27, 2019
@YungChihLai
Copy link
Author

Hi mojaveazure,

Thank you so much for your key information. You are right, the "pbmc <- RunUMAP(pbmc, dims = 1:10)" works after just the library(Seurat). It is my mistake because I tried too many methods, and many times for each method. Finally, I forget the most import and basic step after restarting the Rstudio (i.e., library(Seurat)). Because of my carelessness, I don't know which method works in my condition. Anyway, very thanks for your great tool: Seurat. It really helps us a lot.

Best,

Gary

@no-response no-response bot removed the more-information-needed We need more information before this can be addressed label Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants