This is a test version of Biostars. For the public version, visit https://www.biostars.org.
install Bioconductor package and its dependencies

Hi! I am trying to install package "motifbreakR" from Bioconductor, but it seems it has too many dependencies that are not available on my computer. Is there a way to install a Bioconductor package and all its dependencies at once? Thanks!

bioconductor r

How are you installing this package? Dependencies are installed automatically, normally.

I am installing this package from R:

biocLite("motifbreakR")

It seems there is a problem with "libcurl": "Package libcurl was not found in the pkg-config search path. Perhaps you should add the directory containing `libcurl.pc' to the PKG_CONFIG_PATH environment variable". Then configurations of all other packages fail.

On trying to install motifbreakerR, I get the following errors and warnings :

*** Could not run GSL test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GSL was incorrectly installed
*** or that you have moved GSL since it was installed. In the latter case, you
*** may want to edit the gsl-config script: /usr/bin/gsl-config
configure: error: Cannot find Gnu Scientific Library >=1.6
ERROR: configuration failed for package ‘MotIV’
* removing ‘/home/uday/R/x86_64-pc-linux-gnu-library/3.5/MotIV’
ERROR: dependency ‘MotIV’ is not available for package ‘motifStack’
* removing ‘/home/uday/R/x86_64-pc-linux-gnu-library/3.5/motifStack’
ERROR: dependency ‘motifStack’ is not available for package ‘motifbreakR’
* removing ‘/home/uday/R/x86_64-pc-linux-gnu-library/3.5/motifbreakR’

The downloaded source packages are in
    ‘/tmp/RtmpMtZoRJ/downloaded_packages’
Warning messages:
1: In install.packages(pkgs = doing, lib = lib, repos = repos, ...) :
  installation of package ‘MotIV’ had non-zero exit status
2: In install.packages(pkgs = doing, lib = lib, repos = repos, ...) :
  installation of package ‘motifStack’ had non-zero exit status
3: In install.packages(pkgs = doing, lib = lib, repos = repos, ...) :
  installation of package ‘motifbreakR’ had non-zero exit status

On installing gsl package, it exits as following :

ERROR: configuration failed for package ‘gsl’
* removing ‘/home/uday/R/x86_64-pc-linux-gnu-library/3.5/gsl’
* restoring previous ‘/home/uday/R/x86_64-pc-linux-gnu-library/3.5/gsl’
Warning in install.packages :
  installation of package ‘gsl’ had non-zero exit status

Please help.

On doing so, there was slight progress and then it stopped at :

RandPSSMGen.cpp:32:10: fatal error: gsl/gsl_histogram.h: No such file or directory
 #include <gsl/gsl_histogram.h>
          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/home/uday/anaconda3/envs/rstudio/lib/R/etc/Makeconf:167: RandPSSMGen.o] Error 1
ERROR: compilation failed for package ‘MotIV’
* removing ‘/home/uday/R/x86_64-pc-linux-gnu-library/3.5/MotIV’
ERROR: dependency ‘MotIV’ is not available for package ‘motifStack’
* removing ‘/home/uday/R/x86_64-pc-linux-gnu-library/3.5/motifStack’
ERROR: dependency ‘motifStack’ is not available for package ‘motifbreakR’
* removing ‘/home/uday/R/x86_64-pc-linux-gnu-library/3.5/motifbreakR’

This is also the case when I try to install the MotIV package explicitly.

conda install bioconductor-motifbreakr

Still not working in R.

Define "not working".

RandPSSMGen.cpp:32:10: fatal error: gsl/gsl_histogram.h: No such file or directory
 #include <gsl/gsl_histogram.h>
          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/home/uday/anaconda3/envs/rstudio/lib/R/etc/Makeconf:167: RandPSSMGen.o] Error 1
ERROR: compilation failed for package ‘MotIV’
* removing ‘/home/uday/R/x86_64-pc-linux-gnu-library/3.5/MotIV’

Which command did you use to get that?

On running the following on R studio :

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

Stop trying to compile things, use conda for EVERYTHING.

I need it to work in R studio.

You mean to say install r and r studio using conda commands and then trying the same?

You can point rstudio to any R you want, so point it to the one from conda.

Done! Like you said, few of the dependencies such as rtracklayer, libiconv and gsl belonged to different versions or not present at all, for which I had to (re)install using conda and start a new R instance at the end of each installation, to check if it's properly installed or not. Thanks for your time.

2 answers

Maybe there is... for example, the github page has these instructions:

Getting prerequisite packages from Bioconductor

source("http://bioconductor.org/biocLite.R")
biocLite(c("BiocParallel", "motifStack", "BSgenome", "BiocGenerics",
           "Biostrings", "GenomeInfoDb", "GenomicRanges", "Gviz", "S4Vectors",
           "rtracklayer", "IRanges", "MotifDb", "BSgenome.Hsapiens.UCSC.hg19",
           "SNPlocs.Hsapiens.dbSNP.20120608", "SNPlocs.Hsapiens.dbSNP142.GRCh37",
           "VariantAnnotation", "matrixStats", "BiocStyle"))
install.packages(c("TFMPvalue", "knitr", "rmarkdown"))

Here is how it works for me:

conda create -n your_env
conda activate your_env
conda config --add channels bioconda
conda install bioconductor-motifbreakr

Log in to answer this question.