-
Notifications
You must be signed in to change notification settings - Fork 927
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
Using RunUMAP with Anaconda Python [duplicate] #631
Comments
fyi, I am running this on an HPC, I don't have access to write to the source python environment, but I cloned it locally, activated it, installed umap-learn, and in that same instance of the command prompt, while that local environment is activated, I run rtudio to try RunUMAP. |
I uninstalled all the dependencies installed by
and reinstalled them with
and it seemed to work... thanks for the help :) |
Same problem here, but reinstalling R and Rstudio did not solve it. umap-learn installed via pip. I can run umap via python from Jupiter. Running on the local machine. > object <- RunUMAP(object, reduction.use = "pca", dims.use = 1:10)
Error in RunUMAP(object, reduction.use = "pca", dims.use = 1:10) :
Cannot find UMAP, please install through pip (e.g. pip install umap-learn).
> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.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] umap_0.1.0.3 bindrcpp_0.2.2 Seurat_2.3.4 Matrix_1.2-14 cowplot_0.9.3 ggplot2_3.0.0
[7] reticulate_1.9
loaded via a namespace (and not attached):
[1] tsne_0.1-3 segmented_0.5-3.0 nlme_3.1-137 bitops_1.0-6
[5] bit64_0.9-7 RColorBrewer_1.1-2 httr_1.3.1 prabclus_2.2-6
[9] tools_3.5.1 backports_1.1.2 R6_2.2.2 irlba_2.3.2
[13] rpart_4.1-13 KernSmooth_2.23-15 Hmisc_4.1-1 lazyeval_0.2.1
[17] colorspace_1.3-2 trimcluster_0.1-2 nnet_7.3-12 withr_2.1.2
[21] tidyselect_0.2.4 gridExtra_2.3 bit_1.1-14 compiler_3.5.1
[25] htmlTable_1.12 hdf5r_1.0.0 labeling_0.3 diptest_0.75-7
[29] caTools_1.17.1 scales_0.5.0 checkmate_1.8.5 lmtest_0.9-36
[33] DEoptimR_1.0-8 mvtnorm_1.0-8 robustbase_0.93-1 ggridges_0.5.0
[37] pbapply_1.3-4 dtw_1.20-1 proxy_0.4-22 stringr_1.3.1
[41] digest_0.6.15 mixtools_1.1.0 foreign_0.8-70 R.utils_2.6.0
[45] base64enc_0.1-3 pkgconfig_2.0.1 htmltools_0.3.6 htmlwidgets_1.2
[49] rlang_0.2.1 rstudioapi_0.7 bindr_0.1.1 zoo_1.8-3
[53] jsonlite_1.5 ica_1.0-2 mclust_5.4.1 gtools_3.8.1
[57] acepack_1.4.1 dplyr_0.7.6 R.oo_1.22.0 magrittr_1.5
[61] modeltools_0.2-22 Formula_1.2-3 lars_1.2 Rcpp_0.12.17
[65] munsell_0.5.0 ape_5.1 R.methodsS3_1.7.1 stringi_1.2.3
[69] MASS_7.3-50 flexmix_2.3-14 gplots_3.0.1 Rtsne_0.13
[73] plyr_1.8.4 grid_3.5.1 parallel_3.5.1 gdata_2.18.0
[77] crayon_1.3.4 doSNOW_1.0.16 lattice_0.20-35 splines_3.5.1
[81] SDMTools_1.1-221 knitr_1.20 pillar_1.3.0 igraph_1.2.1
[85] fpc_2.1-11 reshape2_1.4.3 codetools_0.2-15 stats4_3.5.1
[89] glue_1.3.0 metap_0.9 latticeExtra_0.6-28 data.table_1.11.4
[93] png_0.1-7 foreach_1.4.4 tidyr_0.8.1 gtable_0.2.0
[97] RANN_2.6 purrr_0.2.5 kernlab_0.9-26 assertthat_0.2.0
[101] class_7.3-14 survival_2.42-6 tibble_1.4.2 snow_0.4-2
[105] iterators_1.0.10 cluster_2.0.7-1 fitdistrplus_1.0-9 ROCR_1.0-7 |
Hi Gervaise, could you, please, reopen the issue, it'd be nice to have some feedback from Seurat team. |
you could open your own issue, but ok... I removed all the dependencies:
then reinstalled with:
then it ran perfectly in R. Probably not the same problem for you though if it works in jupyter-notebook |
Please see #486 for dealing with UMAP, Seurat/reticulate, and Anaconda. The short answer is that you can't. Reticulate appears to not recognize Anaconda installations, so if you're planning on using UMAP with Seurat, always use your system's Python (or CPython from the folks bring you Python for Windows users) rather than using Anaconda. |
@mojaveazure I know this is an old question. But I was able to get RunUMAP running with anaconda python. I run of course I installed umap-learn into the Renv conda environment. I used pip to install umap-learn. |
@danielruss Could you please outline a sequence of events, from installing anaconda to installing umap-learn, so that the code you have outlined will work? Much Appreciated! |
To whom it may be worth: I also had issues with installing UMAP and Leiden algorithm using conda installation, and at least in the local situation (MBP Mojave OSX), I could make it work on conda environment. Although it is tricky Anaconda installation can be recognized by reticulate (I forced it, and the use_condaenv above might work as well, I tried it but failed in my particular case):
should show you at the end the list of packages and python directory to miniconda3.
P.S. The above method does not work well in an HPC environment (with RStudio server) where some of the package installation require specific libraries that are not available and root installation/update is impossible. I did not do it but the manager succeeded in installing everything (including RStudio etc.) again inside the conda environment and got it work as well. |
@Dragonmasterx87 I installed conda quite awhile ago, so I don't remember all the details. However, I just followed the instructions from docs.conda.io . I installed Anaconda3, so the default is python3. @chlee-tabin installed miniconda, which comes with a smaller set of packages, so I am not surprised that chlee-tabin had to install numpy. After installing Anaconda3, I created a conda environment
Then in R
The conda = argument has to be set appropriately. I installed conda in my home directory, if you have a central conda command (it is a bash function) you need to know where conda is installed. You can get a clue where the file is by looking in your startup files ( -'umap <- reticulate::import("umap")'
Hope it helps.. |
Hi, This comment is directed to Daniel Russ or the admin. I am new to programming, and trying to get UMAP to run in R studio. I had installed Anaconda distribution of Python, and made use of the directions you posted just above. However, when it came to R part, I only made it to this part After this, I tried this command: use_condaenv(condaenv="Renv",conda="/home/druss/anaconda3/bin/conda") |
Hi,
First of all a few disclaimers. 1) I am not a member of the Satija lab, just a happy Seurat user, so don’t hold them responsible for anything I say that is incorrect 2) these are my comments and not that of my employer.
If you installed anaconda, there should be an “Anaconda” directory in your home directory. When you log in a bash function is created that calls the appropriate conda subcommand. That function is named “conda”. If you are interested, you could type “type conda” and you can see the function definition. When the function is defined, an environment variable _CONDA_EXE is also defined. So you can type “echo $_CONDA_EXE” to see the actual commands conda uses. When I log in, this is what I see:
echo $_CONDA_EXE
/Users/druss/anaconda3/bin/conda
This is what goes into that “conda=” param.
The condaenv parameter is which of you conda environments have the umap-learn package installed. When you type conda activate “xxx” the “xxx” is the condaenv.
When I type “conda env list” I get
# conda environments:
#
base * /home/druss/anaconda3
Renv /home/druss/anaconda3/envs/Renv
gpu-tf /home/druss/anaconda3/envs/gpu-tf
I installed umap-learn in the Renv conda environment.
Hope it helps and a big thank you to the Satija lab,
Daniel
From: shwetak01 <notifications@github.com>
Reply-To: satijalab/seurat <reply@reply.github.com>
Date: Wednesday, June 12, 2019 at 5:59 PM
To: satijalab/seurat <seurat@noreply.github.com>
Cc: "Russ, Daniel (NIH/CIT) [E]" <druss@mail.nih.gov>, Mention <mention@noreply.github.com>
Subject: Re: [satijalab/seurat] Using RunUMAP with Anaconda Python [duplicate] (#631)
Hi,
This comment is directed to Daniel Russ or the admin. I am new to programming, and trying to get UMAP to run in R studio. I had installed Anaconda distribution of Python, and made use of the directions you posted just above. However, when it came to R part, I only made it to this part
library(reticulate)
I did get this error message: Warning message: package ‘reticulate’ was built under R version 3.5.3
After this, I tried this command: use_condaenv(condaenv="Renv",conda="/home/druss/anaconda3/bin/conda")
Obviously, I need to create the filepath as per where my conda (Anaconda?) is installed. Of course this is where I am flummoxed, as I didn't understand your instructions. Can you please elaborate?
Thanks in advance!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#631?email_source=notifications&email_token=AA4X26ZJ5Y4DLLW7EBCMVTDP2FWPDA5CNFSM4FK2XLIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXR5IFA#issuecomment-501470228>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AA4X262QMPK4GNUCJSYH45DP2FWPDANCNFSM4FK2XLIA>.
|
Thank you very much Daniel Russ! I was able to figure out the issue. |
Daniel Russ, thank you! Nothing seemed to be working for me but your April 8 comment got it done. |
@danielruss sorry for the late reply....I somehow forgot about this, but back then I circumvented this by creating a py3.7 env, and then just running Rstudio in that env. UMAP ran fine in R after that. Just came here for the thumbs up! |
Fix `ncol` behavior in SpatialPlot
Hi,
I can't get RunUMAP working in RStudio.
I get:
I have installed UMAP, I:
and that worked, I even tried:
and it just said that all requirements are already satisfied.
Seurat 2.3.1
The text was updated successfully, but these errors were encountered: