How can I install DeSeq2 in Jupyter Notebook?
2
0
Entering edit mode
@davidwheeler7-19959
Last seen 5.1 years ago

Hello,

Can you please direct me towards the resources needed to install deseq2 in Jupyter Notebook with a R kernel on a Mac? I have tried to install Anaconda, an R kernel, then followed the code described here (https://bioconductor.org/packages/release/bioc/html/DESeq2.html), here (https://github.com/ljdursi/glbio-jupyter-workshop) and several other sites. I continuously receive errors that "'X' package had non-zero exit status".

After trying the last resource on github my R kernel did not work at all. I have since uninstalled anaconda to start fresh.

Can you please show/direct me towards the resources I need to install deseq2 in Jupyter Notebook with a R kernal for a Mac?

Thank you in advance for your time!

David

deseq2 • 5.9k views
ADD COMMENT
0
Entering edit mode

For example, when I run this installation code from: http://master.bioconductor.org/packages/release/workflows/html/rnaseqGene.html

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("rnaseqGene", version = "3.8")

I receive:

Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Bioconductor version 3.8 (BiocManager 1.30.4), R 3.5.1 (2018-07-02)
Installing package(s) 'BiocVersion', 'rnaseqGene'
also installing the dependencies ‘formatR’, ‘numDeriv’, ‘reshape’, ‘ProtGenerics’, ‘DelayedArray’, ‘GenomeInfoDbData’, ‘progress’, ‘lambda.r’, ‘futile.options’, ‘coda’, ‘bbmle’, ‘affyio’, ‘preprocessCore’, ‘graph’, ‘RBGL’, ‘GO.db’, ‘AnnotationForge’, ‘Rgraphviz’, ‘R.oo’, ‘R.methodsS3’, ‘VariantAnnotation’, ‘OrganismDbi’, ‘GGally’, ‘ensembldb’, ‘AnnotationFilter’, ‘ShortRead’, ‘DESeq’, ‘aroma.light’, ‘bookdown’, ‘SummarizedExperiment’, ‘GenomeInfoDb’, ‘GenomicRanges’, ‘Biostrings’, ‘BiocGenerics’, ‘S4Vectors’, ‘IRanges’, ‘XVector’, ‘zlibbioc’, ‘rtracklayer’, ‘biomaRt’, ‘Biobase’, ‘futile.logger’, ‘snow’, ‘locfit’, ‘geneplotter’, ‘emdbook’, ‘RcppEigen’, ‘RcppNumerical’, ‘affy’, ‘limma’, ‘beeswarm’, ‘vipor’, ‘annotate’, ‘hwriter’, ‘Category’, ‘GOstats’, ‘edgeR’, ‘PFAM.db’, ‘GSEABase’, ‘R.utils’, ‘ggbio’, ‘BSgenome’, ‘biovizBase’, ‘matrixStats’, ‘EDASeq’, ‘BiocStyle’, ‘airway’, ‘Rsamtools’, ‘GenomicFeatures’, ‘GenomicAlignments’, ‘BiocParallel’, ‘DESeq2’, ‘apeglm’, ‘vsn’, ‘pheatmap’, ‘PoiClaClu’, ‘ggbeeswarm’, ‘genefilter’, ‘AnnotationDbi’, ‘org.Hs.eg.db’, ‘ReportingTools’, ‘Gviz’, ‘sva’, ‘RUVSeq’, ‘fission’

Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘preprocessCore’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘affyio’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘Rgraphviz’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘affy’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘BiocParallel’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘vsn’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘DelayedArray’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘SummarizedExperiment’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘Rsamtools’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘airway’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘GenomicAlignments’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):

“installation of package ‘rnaseqGene’ had non-zero exit status”Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Update old packages: 'backports', 'BH', 'broom', 'checkmate', 'class', 'cli',
  'codetools', 'colorspace', 'curl', 'data.table', 'dbplyr', 'digest', 'dplyr',
  'evaluate', 'fansi', 'forcats', 'ggplot2', 'haven', 'Hmisc', 'htmlTable',
  'htmlwidgets', 'httpuv', 'httr', 'IRdisplay', 'jsonlite', 'knitr', 'later',
  'lattice', 'markdown', 'MASS', 'Matrix', 'mgcv', 'mime', 'mongolite', 'odbc',
  'openssl', 'packrat', 'pillar', 'pkgconfig', 'purrr', 'R6', 'Rcpp',
  'RcppArmadillo', 'readr', 'readxl', 'repr', 'RJSONIO', 'rlang', 'rmarkdown',
  'rsconnect', 'rstudioapi', 'rzmq', 'scales', 'shiny', 'sparklyr', 'stringi',
  'stringr', 'survival', 'tibble', 'tidyr', 'tidyselect', 'tinytex', 'xfun',
  'XML', 'xtable'

Thereafter, I try to update the packages but to no avail.

ADD REPLY
0
Entering edit mode

Start with the first problem

installation of package ‘preprocessCore’ had non-zero exit status

and debug that BiocManager::install("preprocessCore"); report what the specific problem is here on the mailing list. Consider formatting your code (select and press the little 101010 icon above the input window) to make it more readable.

ADD REPLY
0
Entering edit mode

Hello Martin,

I tried but run into the following cycle again:

I run:

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("rnaseqGene", version = "3.8")

I receive:

Bioconductor version 3.8 (BiocManager 1.30.4), R 3.5.1 (2018-07-02)
Installing package(s) 'rnaseqGene'
also installing the dependencies ‘affyio’, ‘preprocessCore’, ‘Rgraphviz’, ‘VariantAnnotation’, ‘OrganismDbi’, ‘ensembldb’, ‘ShortRead’, ‘rtracklayer’, ‘affy’, ‘GOstats’, ‘ggbio’, ‘BSgenome’, ‘biovizBase’, ‘EDASeq’, ‘airway’, ‘Rsamtools’, ‘GenomicFeatures’, ‘GenomicAlignments’, ‘apeglm’, ‘vsn’, ‘ReportingTools’, ‘Gviz’, ‘sva’, ‘RUVSeq’, ‘fission’

Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘affyio’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘preprocessCore’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘Rgraphviz’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘affy’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘GOstats’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘ShortRead’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘vsn’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘EDASeq’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘RUVSeq’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘ReportingTools’ had non-zero exit status”Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘rnaseqGene’ had non-zero exit status”Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Update old packages: 'BiocParallel', 'httpuv', 'mongolite', 'RcppArmadillo',
  'RJSONIO', 'stringi', 'XML'`

So I run:

BiocManager::install("preprocessCore")

But receive:

Bioconductor version 3.8 (BiocManager 1.30.4), R 3.5.1 (2018-07-02)
Installing package(s) 'preprocessCore'
Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘preprocessCore’ had non-zero exit status”Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Update old packages: 'BiocParallel', 'httpuv', 'mongolite', 'RcppArmadillo',
  'RJSONIO', 'stringi', 'XML'`

So I run:

update.packages('BiocParallel', 'httpuv', 'mongolite', 'RcppArmadillo',
  'RJSONIO', 'stringi', 'XML')

This returns no error. I try to test that I have DESeq2 with 'browseVignettes("rnaseqGene")`

But I receive: `Error in find.package(package, lib.loc): there is no package called ‘rnaseqGene’

Traceback:

1. browseVignettes("rnaseqGene")
2. tools::getVignetteInfo(package, lib.loc, all)
3. find.package(package, lib.loc)
4. stop(gettextf("there is no package called %s", sQuote(pkg)), 
 .     domain = NA)

What do you think? Am I missing something very simple?

Thank you for your time!

David

ADD REPLY
0
Entering edit mode

Please follow my instructions and try only to install preprocessCore. (ahh, I see you did, but only after I reformatted your post so that it was readable!)

ADD REPLY
0
Entering edit mode

Sorry Martin! I promised I used the formatting you described (and the proof below looked good) but as soon as a added the comment it reverted back.This is a test- look OK?

ADD REPLY
0
Entering edit mode

I think you installed other packages using conda, so install preprocessCore using conda.

Alternatively, since your R and R compilers are based on conda, you need to install R packages from 'source' rather than as pre-built binaries. So try

options(pkgType = "source")
BiocManager::install("preprocessCore")

Some versions of conda did not play well with mixed installations; I am unsure of the current situation.

Use single backticks for short, inline() code; use triple back ticks to surround longer code chunks.

ADD REPLY
0
Entering edit mode

Thanks for your time and help Martin! Unfortunately, this did not work either. I received this error:

Bioconductor version 3.8 (BiocManager 1.30.4), R 3.5.1 (2018-07-02)
Installing package(s) 'preprocessCore'
Warning message in install.packages(pkgs = doing, lib = lib, repos = repos, ...):
“installation of package ‘preprocessCore’ had non-zero exit status”Update old packages: 'BiocParallel', 'httpuv', 'mongolite', 'RcppArmadillo',
  'RJSONIO', 'sparklyr', 'stringi', 'XML'

do you think my R version: 3.5.1 is the problem?

ADD REPLY
1
Entering edit mode

We need a log. Where are you located? Would you want to do a google hangout to try to dig into your configuration?

ADD REPLY
0
Entering edit mode

Hello Vincent. Ok sure. Your tip below did help but I still having issues updating the packages.

I am in Bozeman, MT. Absolutely, whenever you have time. Please let me know. Thank you!

David

ADD REPLY
0
Entering edit mode

Hello Vincent. Ok sure. Your tip below did help but I still having issues updating the packages.

I am in Bozeman, MT. Absolutely, whenever you have time. Please let me know. Thank you!

David

ADD REPLY
0
Entering edit mode

Maybe this afternoon we can do a screenshare. I will be out for a couple of hours. Jupyter is just gobbling up the key information, you need to work outside of it and all will be well eventually. I don't think too many people administer R through jupyter ... once it is properly set up Jupyter is a great interactive environment for using R, but when there are sharp corners you don't want to have it intervening.

ADD REPLY
0
Entering edit mode

I think my version of R, 3.5.1 is too new. Can you please direct me towards a source of 3.5?

ADD REPLY
0
Entering edit mode

I think my version of R, 3.5.1 is too new. Can you please direct me towards a source of 3.5?

ADD REPLY
0
Entering edit mode
@mikelove
Last seen 1 hour ago
United States

I'm not sure as the DESeq2 maintainer I have much advice here. Usually the solution is to take a look through the installation log to see why 'X' could not be installed.

Also see this FAQ:

https://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#i-have-trouble-installing-deseq2-on-ubuntulinux

ADD COMMENT
0
Entering edit mode

Thanks Michael.

I cannot imagine that I am the first person to try to run DESeq2 on Jupyter Notebook via a Mac. I understand that there are some version control issues but these issues do not seem insurmountable. I will try installing Anaconda again, R, and DESeq2. I did look through the installation log but, when most of the packages were not installed, a bigger problem seemed to demand a different solution. I will keep trucking and report back.

Thank you!

David

ADD REPLY
0
Entering edit mode

Hi,

It's worth taking a look at Bioconda in this instance. I feel like once you launch a Jupyter notebook. If you have anaconda installed already, and you are trying to to install DESeq2, make sure the list of channels you have set are correct.

conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge 

Then try to install DESeq2 via

conda install bioconductor-deseq2

NOTE: this installs for R-3.5.2

Best

Nitesh

ADD REPLY
0
Entering edit mode

Hello Nitesh,

I really appreciate your help. Unfortunately I still have the same issues. I try to install the packages, they have non-zero exit status, I try to update the packages, they have non-zero exit status... it continues.

Do you have any other ideas?

David

ADD REPLY
0
Entering edit mode

Just to be clear Nitesh, is it correct that I should run this through the terminal right? If so that I what I did but to no avail.

ADD REPLY
0
Entering edit mode

In an R session (or in the notebook running an R kernel), have you tried

system("ls `R RHOME`/library | grep 00LOC", intern=TRUE)

You may have some abortive installation attempts that left lock files that inhibit installation. From the terminal you could do this as

ls `R RHOME`/library | grep 00LOC

and in the ideal situation there is no result printed. If you do see 00LOCK* files there, remove them and then try your installations again

ADD REPLY
0
Entering edit mode

Thank you Vincent! I found and deleted the 00LOCK file and that definitely helped but I still have an issue. I am using R 3.5.1 and it seems have if the remaining packages that continuously fail to update (BiocParallel', 'httpuv', 'mongolite', 'RcppArmadillo', 'RJSONIO', 'sparklyr', 'stringi', 'XML') will note update with:

BiocManager::install(c(
    "BiocParallel", "httpuv", "mongolite", "RcppArmadillo", "RJSONIO",
    "stringi", "XML"
  ), update = TRUE, ask = FALSE)

Do you know of another way to update these packages?

Thank you,

David

ADD REPLY
0
Entering edit mode

Are you sure all the 00LOCK* files are removed? We need a log. Can you run R in Terminal, issue BiocManager::install("BiocParallel") and capture and post the resulting textual messages which should include the failure? Command-A to select, Command-C to copy, Command-V to paste into the support site input box.

ADD REPLY
0
Entering edit mode

I can not find any more 00CLOCK* files with the search commands. Should I look via another approach? Ok Here is end the from: BiocManager::install("BiocParallel"). The whole log is too long to send.

> BiocManager::install("BiocParallel")

....

configure: error: in `/private/var/folders/8c/7fwkqlvd4ps_rj6zf9lr_xcw0000gn/T/RtmpIB05DG/R.INSTALL7224912aac/stringi':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘stringi’
* removing ‘/anaconda3/lib/R/library/stringi’
* restoring previous ‘/anaconda3/lib/R/library/stringi’
* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
checking for gcc... x86_64-apple-darwin13.4.0-clang
checking for C compiler default output file name... 
configure: error: C compiler cannot create executables
See `config.log' for more details.
ERROR: configuration failed for package ‘XML’
* removing ‘/anaconda3/lib/R/library/XML’
* restoring previous ‘/anaconda3/lib/R/library/XML’

The downloaded source packages are in
    ‘/private/var/folders/8c/7fwkqlvd4ps_rj6zf9lr_xcw0000gn/T/RtmpaYksj9/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages(pkgs = doing, lib = lib, repos = repos, ...) :
  installation of package ‘BiocParallel’ had non-zero exit status
2: In install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :
  installation of package ‘BiocParallel’ had non-zero exit status
3: In install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :
  installation of package ‘httpuv’ had non-zero exit status
4: In install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :
  installation of package ‘mongolite’ had non-zero exit status
5: In install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :
  installation of package ‘RcppArmadillo’ had non-zero exit status
6: In install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :
  installation of package ‘RJSONIO’ had non-zero exit status
7: In install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :
  installation of package ‘stringi’ had non-zero exit status
8: In install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :
  installation of package ‘XML’ had non-zero exit status
ADD REPLY
0
Entering edit mode

This message on the C compiler is news to me. Do you have xcode developer tools installed? Or gcc installed via anaconda, or homebrew? See

http://r.research.att.com/tools/

for much relevant information.

ADD REPLY
0
Entering edit mode

Sorry to lose the thread here. If the problem persists we could try a google hangout before 1pm ET today.

ADD REPLY
0
Entering edit mode

Hello Vincent. Sorry. I tried to respond yesterday but had already exceeded my limit (n=5). Great. I just installed xcode yesterday after your comment. Sounds good. Do you just want to email me @ dlinnard@berkeley.edu with a time (assuming EST) when you are ready? Thanks again!

ADD REPLY
0
Entering edit mode
Marc Saric ▴ 70
@marc-saric-1645
Last seen 4.5 years ago

If you don't mind adding another layer of complexity, you could give the pre-packaged Jupyter-notebook docker-images from https://github.com/jupyter/docker-stacks a try. I think docker is more or less easy to install on Mac, see https://docs.docker.com/docker-for-mac/

Just customize the datascience-notebook, which can also directly be pulled from docker hub, adding

# Add DESeq2 from Bioconductor
RUN R -e 'source("https://bioconductor.org/biocLite.R");\
                  biocLite("DESeq2")'

at the end of the Dockerfile and rebuild it.

Alternatively, you could start the container and run the above command interactively in a console from the Jupyter server.

As I said, this would require, that you are familiar with Docker on Mac, but may be a solution, in case your R on Mac installation is not working.

P.S: Never execute commands on the console if you don't understand what they are doing. :-)

ADD COMMENT

Login before adding your answer.

Traffic: 911 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6