Bioconductor as a source for the dependencies of an R package?
2
2
Entering edit mode
8.8 years ago

Hello,

I am writing an R package and my dependencies are almost all bioconductor packages. It works on my computer because I already have all of them installed but it does skip them for being unavailable when loading my package. Anybody have a fix?

Thanks!

R bioconductor • 6.0k views
ADD COMMENT
0
Entering edit mode

Can you please explain a bit more?

Please make sure the following commands complete without ERROR or WARNING. This ERROR or WARNING most of the times solve lot of problem.

R CMD build [Package_name]
R CMD check [Package_name.tar.gz]
R CMD BiocCheck [Package_name.tar.gz]
ADD REPLY
0
Entering edit mode

Well I have the packages on my github and I load them through the devtools packages. In the Description I have my packages stated as such

Depends:
    R (>= 3.2.3),
    limma (<= 3.26.8),
    oligo (<= 1.34.2),
    pd.hugene.2.0.st (<= 3.14.1),
    genefilter (<= 1.52.1),
    annotate (<= 1.48.0),
    hugene20sttranscriptcluster.db(<= 8.4.0),
    affycoretools(<= 1.42.0)
License: GNU GENERAL PUBLIC LICENSE V3.0
LazyData: true
RoxygenNote: 5.0.1.9000

But I believe when you do that it looks for CRAN repo packages. I need it to get them from bioconductor.

ADD REPLY
1
Entering edit mode

Add a BiocViews entry to your package DESCRIPTION. Devtools will then detect your package as a Bioconductor package and add the proper Bioconductor repositories needed to install the dependencies.

ADD REPLY
2
Entering edit mode
8.8 years ago

The biocLite() function is the recommended way to access and install Bioconductor and Bioconductor-related packages. Take a look at the siteRepos argument to add the repository for your package and biocLite() will do the rest.

ADD COMMENT
0
Entering edit mode

Ah yes I know how to install the packages for my own use. As you can see above I am writing a package that uses bioconductor packages. Are you saying I should instruct people who use my package to install it using biocLite() and then add my repo to that function?

Thanks!

ADD REPLY
0
Entering edit mode

Instruct them how to install biocLite() and then give them a command-line to install your package. It will look something like:

source('http://bioconductor.org/biocLite.R')
biocLite('MySuperSoftwareWithBioc',siteRepos=YOURREPOSITORY)
ADD REPLY
0
Entering edit mode

Dear Sean

I have a similar issue, and when I try to install my package using biocLite() it threw this error

Error: Line starting '<!DOCTYPE html> ...' is malformed!

for comparison I also tried installing Gviz from bioconductor github mirror. Got the same error.

biocLite("Gviz", siteRepos = "https://github.com/Bioconductor-mirror/Gviz")

BioC_mirror: https://bioconductor.org
Using Bioconductor 3.2 (BiocInstaller 1.20.1), R 3.2.2 (2015-08-14).

Installing package(s) ‘Gviz’

Error: Line starting '<!.DOCTYPE html>...' is malformed!

What would be the solution to that?

Thanks, Vivek

ADD REPLY
0
Entering edit mode

Well, in order to use biocLite(), a formal R repository must be in place. The biocLite() approach will not work directly from github. Yes, I agree that this is less than ideal....

ADD REPLY
0
Entering edit mode

I see.. So how are the bioconductor developers working with github dealing with this situation (or are there any)? I think it would be helpful to either add github url support to biocLite(), or get the devtools::install_github to support bioconductor urls, whichever is easier ..

ADD REPLY
0
Entering edit mode
8.7 years ago
vivekbhr ▴ 700

UPDATE : after @jimhester 's reply to the post I found that devtools already supports bioconductor packages while installing. I just had to populate biocViews in my package DESCRIPTION. So that install_github can pick up from that.

Apparantly biocLite would also work after this, if you use it like this: biocLite("Bioconductor-mirror/Gviz")

I guess this solves the issue.

ADD COMMENT
2
Entering edit mode

biocLite("your/amazing") works too (via devtools), without requiring you to label your package with the biocViews term. It does this by setting the argument repos to a value that includes Bioconductor repositories, BiocInstaller::biocinstallRepos(), so you can do that, too install_github("your/amazing", repos=BiocInstaller::biocinstallRepos())

ADD REPLY
0
Entering edit mode

Could you please specify how you changed DESCRIPTION? I add a line "biocViews:", but installation of bioconductor packages still failed...

ADD REPLY
0
Entering edit mode

@Vivian you need to add a term to biocViews. Eg :

biocViews : rnaseq

ADD REPLY
0
Entering edit mode

Update: This is not the recommended way of installing packages. Please use BiocManager::install("username/pkgrepo") to install a package from GitHub. We strongly recommend that you only do this in the devel version of Bioconductor (for developers); otherwise, simply install the package from either Bioconductor or CRAN using BiocManager::install("package").

ADD REPLY

Login before adding your answer.

Traffic: 2373 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