This notebook extracts, from a given R package, all dependencies and the correct order of installation.


In [1]:
%load_ext rmagic

In [2]:
%R source("http://bioconductor.org/biocLite.R")
%R biocLite(c("pkgDepTools", "Biobase", 'Rgraphviz', "BiocInstaller"))


Bioconductor version 2.13 (BiocInstaller 1.12.1), ?biocLite for help
A newer version of Bioconductor is available after installing a new version of
  R, ?BiocUpgrade for help
BioC_mirror: http://bioconductor.org
Using Bioconductor version 2.13 (BiocInstaller 1.12.1), R version 3.0.2.
Installing package(s) 'pkgDepTools' 'Biobase' 'Rgraphviz' 'BiocInstaller'
versuche URL 'http://bioconductor.org/packages/2.13/bioc/src/contrib/pkgDepTools_1.28.0.tar.gz'
Content type 'application/x-gzip' length 165306 bytes (161 Kb)
URL geöffnet
==================================================
downloaded 161 Kb

versuche URL 'http://bioconductor.org/packages/2.13/bioc/src/contrib/Biobase_2.22.0.tar.gz'
Content type 'application/x-gzip' length 1848944 bytes (1.8 Mb)
URL geöffnet
==================================================
downloaded 1.8 Mb

versuche URL 'http://bioconductor.org/packages/2.13/bioc/src/contrib/Rgraphviz_2.6.0.tar.gz'
Content type 'application/x-gzip' length 7451849 bytes (7.1 Mb)
URL geöffnet
==================================================
downloaded 7.1 Mb

versuche URL 'http://bioconductor.org/packages/2.13/bioc/src/contrib/BiocInstaller_1.12.1.tar.gz'
Content type 'application/x-gzip' length 13520 bytes (13 Kb)
URL geöffnet
==================================================
downloaded 13 Kb


The downloaded source packages are in
	‘/tmp/Rtmp9nbasC/downloaded_packages’

In [4]:
%%R 
library("pkgDepTools")
library("Biobase")
library("Rgraphviz")
library("BiocInstaller")

Creating a tree of all dependencies of a given package


In [5]:
%%R
dependencies <- makeDepGraph(biocinstallRepos(), type="source", keep.builtin=TRUE, dosize=FALSE)
contrib_url <- contrib.url(biocinstallRepos(), type = "source")
available_packages <- available.packages( contrib_url )
package_names <- as.vector( available_packages[,"Package"] )
package_versions <- as.vector( available_packages[,"Version"] )
package_urls <- as.vector(available_packages[,"Repository"])

In [6]:
%%R

getPackageDependencies <- function( package )
{
    packages <- getInstallOrder( package, dependencies, needed.only=FALSE )$packages

    graph <- c(package, names(acc(dependencies, package)[[1]]))
    plot( subGraph(graph, dependencies) )
    print(packages)
    intersect <- match(packages, available_packages )
    intersect <- intersect[ !is.na(intersect) ]
    
    paste( package_urls[intersect], paste(paste( package_names[intersect], package_versions[intersect], sep="_"), "tar.gz", sep="."), sep="/" )
}

In [7]:
%%R
getPackageDependencies("DESeq2")


 [1] "methods"       "graphics"      "stats"         "parallel"     
 [5] "BiocGenerics"  "utils"         "stats4"        "IRanges"      
 [9] "XVector"       "GenomicRanges" "Rcpp"          "RcppArmadillo"
[13] "grid"          "grDevices"     "lattice"       "locfit"       
[17] "Biobase"       "DBI"           "RSQLite"       "AnnotationDbi"
[21] "xtable"        "XML"           "annotate"      "splines"      
[25] "survival"      "genefilter"    "RColorBrewer"  "DESeq2"       
 [1] "NA/NA_NA.tar.gz"                                                                   
 [2] "NA/NA_NA.tar.gz"                                                                   
 [3] "NA/NA_NA.tar.gz"                                                                   
 [4] "NA/NA_NA.tar.gz"                                                                   
 [5] "http://bioconductor.org/packages/2.13/bioc/src/contrib/BiocGenerics_0.8.0.tar.gz"  
 [6] "NA/NA_NA.tar.gz"                                                                   
 [7] "NA/NA_NA.tar.gz"                                                                   
 [8] "http://bioconductor.org/packages/2.13/bioc/src/contrib/IRanges_1.20.7.tar.gz"      
 [9] "http://bioconductor.org/packages/2.13/bioc/src/contrib/XVector_0.2.0.tar.gz"       
[10] "http://bioconductor.org/packages/2.13/bioc/src/contrib/GenomicRanges_1.14.4.tar.gz"
[11] "http://cran.fhcrc.org/src/contrib/Rcpp_0.11.3.tar.gz"                              
[12] "http://cran.fhcrc.org/src/contrib/RcppArmadillo_0.4.500.0.tar.gz"                  
[13] "NA/NA_NA.tar.gz"                                                                   
[14] "NA/NA_NA.tar.gz"                                                                   
[15] "http://cran.fhcrc.org/src/contrib/lattice_0.20-29.tar.gz"                          
[16] "http://cran.fhcrc.org/src/contrib/locfit_1.5-9.1.tar.gz"                           
[17] "http://bioconductor.org/packages/2.13/bioc/src/contrib/Biobase_2.22.0.tar.gz"      
[18] "http://cran.fhcrc.org/src/contrib/DBI_0.3.1.tar.gz"                                
[19] "http://cran.fhcrc.org/src/contrib/RSQLite_1.0.0.tar.gz"                            
[20] "http://bioconductor.org/packages/2.13/bioc/src/contrib/AnnotationDbi_1.24.0.tar.gz"
[21] "http://cran.fhcrc.org/src/contrib/xtable_1.7-4.tar.gz"                             
[22] "http://cran.fhcrc.org/src/contrib/XML_3.98-1.1.tar.gz"                             
[23] "http://bioconductor.org/packages/2.13/bioc/src/contrib/annotate_1.40.1.tar.gz"     
[24] "NA/NA_NA.tar.gz"                                                                   
[25] "http://cran.fhcrc.org/src/contrib/survival_2.37-7.tar.gz"                          
[26] "http://bioconductor.org/packages/2.13/bioc/src/contrib/genefilter_1.44.0.tar.gz"   
[27] "http://cran.fhcrc.org/src/contrib/RColorBrewer_1.0-5.tar.gz"                       
[28] "http://bioconductor.org/packages/2.13/bioc/src/contrib/DESeq2_1.2.10.tar.gz"       

In [ ]: