I recently tried this, and ended up with a huge mess. My conda R was on version 3.3.2, while my global R was on version 3.3.0. Despite having activated my conda R, R still installed the packages to my global R's library directory, overwriting my 3.3.0 packages with 3.3.2 packages. I did not realize the problem until I later ran some pipelines which utilized the global R 3.3.0, and all my Bioconductor packages were broken. Still trying to find a solution, I think it might require running export R_LIBS_USER="/path/to/miniconda2/envs/r.3.3/lib/R/library" in the terminal after activating conda & the conda environment, and before loading R to start the Bioconductor installation. Using biocLite(..., loc = "/path/to/miniconda2/envs/r.3.3/lib/R/library") did not work.
I tried to install DESeq2, edgeR and others wilth Anaconda in ubuntu machine with the code:
conda install wget samtools r-essentials bioconductor-deseq2 bioconductor-edger
as suggested here. It gave the error
Error: Packages missing in current linux-64 channels:
- samtools
- r-essentials
- bioconductor-deseq2
- bioconductor-edger
Did you mean one of these?
apptools
You can search for this package on anaconda.org with
anaconda search -t conda bioconductor-edger
(and similarly for the other packages)
I used the version 4.4.0 of Anaconda and then downgraded to 4.0.0 to solve the issue as suggested somewhere else.
Also tried the command
conda install wget samtools r-essentials bioconductor-deseq2 bioconductor-edger --unknown
It didn't work. What is missing here?
Note: I don't have sudo privileges.
3 answers
At least samtools is in the bioconda repo. Google the instructions for activation of bioconda. See the instructions here: https://bioconda.github.io/ or just run the cited commands, should be sufficient.
conda config --add channels conda-forge
conda config --add channels defaults
conda config --add channels r
conda config --add channels bioconda
or if it is just for one tool, you can simply do conda install -c bioconda samtools
You don't need superuser privileges, that is the idea behind conda.
The Bioconductor project does not support bioconda directly, so your mileage may vary when using bioconda. The recommended way to install Bioconductor packages is from within R using:
source("https://bioconductor.org/biocLite.R")
biocLite("DESeq2")
biocLite("edgeR")
Adding this for completeness sake:
Sometimes Bioconductor packages will not be in the bioconda repo and when I tried Sean's solution, my computer yelled at me (I also don't have sudo privaleges). I ended up downloading the source code into the anaconda R library directory and installing it from the command line. My general scheme is shown below:
~$ cd anaconda2/lib/R/library/ # This line will change if you are using a specific env in Conda
~/anaconda2/lib/R/library$ wget *URL to "source package" from package's web page*
~/anaconda2/lib/R/library$ R CMD INSTALL source_package.tar.gz
If it required dependencies, I went down the rabbit hole and either repeated the above method to download the Bioconductor packages or I just used install.packages(package, repos = https://cran.r-project.org/) within R to install dependencies that were already on CRAN.
Log in to answer this question.
if you don't have sudo create an environment first