I'm working through the Bioconductor book and am currently int he RNA-Seq statistics: R and Bioconductor section. I've actually used both R and Bioconductor before, but in Windows, not Linux.
I have R installed. If I try to run conda install r again, everything freezes up and I have to open up another window and sudo kill the process.
I did the following:
$ conda install -y bioconductor-deseq bioconductor-deseq2 bioconductor-edger r-gplots
Fetching package metadata .................
Solving package specifications: .
# All requested packages already installed.
# packages in environment at /home/moltres/miniconda3/envs/bioinfo:
#
bioconductor-deseq 1.24.0 r3.3.2_0 bioconda
bioconductor-deseq2 1.16.1 r3.3.2_0 bioconda
bioconductor-edger 3.16.5 r3.3.2_0 bioconda
r-gplots 2.17.0 r3.3.2_0 bioconda
(bioinfo)
$ curl -O http://data.biostarhandbook.com/rnaseq/code/deseq1.r
$ curl -O http://data.biostarhandbook.com/rnaseq/code/counts.txt
$ cat counts.txt | Rscript deseq1.r 3x3 > results_deseq1.txt
Error in library(DESeq) : there is no package called 'DESeq'
Execution halted
So even though I just downloaded DESeq, it says I don't have the DESeq package. I did check my R version, and it's 3.4.3. I suspect that could be a problem, but I don't know how to change it in Linux. When I try doing everything in RStudio, I get a bunch of errors in dependencies and configuration upon using biocLite("DESeq").
Any ideas what's going wrong? I would appreciate any help.
What is the output of
which Rscript
? I have a hunch that the Rscript you're using there is not the Rscript from anacondaOkay. How do I know if it's from anaconda? Is it in the wrong directory? Thanks for the response. Still trying to figure this out.
Also, if it counts for anything I tried to uninstall everything. I did...
I also went into /home/moltres/miniconda3/envs/bioinfo/bin/Rscript and deleted the R and RScript files. I tried to re-download R using
conda install r
.It's still getting stuck and not downloading. I'm not really sure what else to do at this point...
Hm that's the correct Rscript -
By 'it's still getting stuck and not downloading', what do you mean? Anaconda is not doing anything? The R installation is big and may take a long while to resolve dependencies in ananonda
Edit: An idea: Have you tried installing DESeq and DESeq the non-Anaconda way?
Start R using 'R', then copy paste:
That will install DESeq, DESeq2 into your anaconda-installed R, maybe that'll do it?
I tried to reproduce your error but I'm not even getting that far :D I'm getting heaps of segmentation faults haha
So, it turns out that I'm just impatient, and R did download. I have good and bad news.
When I try to run the Rscript in command line, it still fails.
However, when I open RStudio, I can now install DESeq, and do library(DESeq) without getting error telling me that the directory is wrong. However, when I try to open the deseq1.r script, it tells me "No such file or directory." However, I checked the working directory, and the file is in the same folder as my working directory. I tried to look up this error, and it told me to save it with encoding UTF-8 encoding and re-open it. Tried it. Didn't work. I can't even open a new script window--it won't let me type anything. Do you know of any way to troubleshoot this?
Just for future reference if anyone ever has this issue, I've mostly fixed it now. For some reason, bash thinks R is in one place, even though it also knows it's in another. I don't really get it.
ANYWAY.
If I run the command where it specifies Rscript in the correct place:
Then this works perfectly. I get the output file.
I've also uninstalled Rstudio, and then reinstalled it using
The same way I did when I re-downloaded R.
If I want to run rstudio, just typing rstudio in command line doesn't work. I had to type in the full location again.
HOWEVER...if I closed my terminal, then opened a new terminal and ran
again, it started working if I just typed rstudio.
So now R seems to be cooperating with everyone else, and they're all a big happy family trying to teach me bioinformatics. And also patience. Unfortunately, I'm not great at either.
Thanks for the help, everyone!
bash looks at the environment variable PATH, whichever comes first in PATH is used first, so if you have
then bash will use the system R. You can check this using
echo $PATH
.A workaround is to flip the order, or to put the anaconda one first:
Either:
or:
Ah. Thanks! I'll try to keep this in mind. I struggle looking for solutions to some easy issues since I don't have the right language yet to properly say what's going wrong.