BiocInstaller/DESCRIPTION0000644000175100017510000000075112607332627016045 0ustar00biocbuildbiocbuildPackage: BiocInstaller Title: Install/Update Bioconductor and CRAN Packages Description: This package is used to install and update Bioconductor, CRAN, and (some) github packages. Version: 1.20.0 Author: Dan Tenenbaum and Biocore Team Maintainer: Bioconductor Package Maintainer biocViews: Infrastructure Depends: R (>= 3.2.0) Suggests: devtools, RUnit, BiocGenerics License: Artistic-2.0 NeedsCompilation: no Packaged: 2015-10-14 01:53:27 UTC; biocbuild BiocInstaller/NAMESPACE0000644000175100017510000000025512607265133015552 0ustar00biocbuildbiocbuildimport("utils") export(biocLite, biocVersion, biocUpdatePackages, biocinstallRepos, useDevel, biocValid, monograph_group, RBioinf_group, biocases_group, all_group) BiocInstaller/NEWS0000644000175100017510000000157112607265133015034 0ustar00biocbuildbiocbuildCHANGES IN VERSION 1.20.0 ------------------------- BUG FIXES o biocLite() uses lib.loc when calling update.packages CHANGES IN VERSION 1.18.0 ------------------------- NEW FEATURES o biocLite() supports github repositories (implicitly, 'packages' following the 'maintainer/package' convention) CHANGES IN VERSION 1.14.0 ------------------------- NEW FEATURES o biocUpdatePackages updates installed packages and their dependencies. CHANGES IN VERSION 1.10.0 ------------------------- NEW FEATURES o biocValid() checks that installed packages are consistent with those available via biocLite(). o biocVersion() returns the version of Bioconductor expected with this version of the BiocInstaller package. USER-VISIBLE CHANGES o biocLite() invoked with no arguments updates currently installed packages to their most-recent version. BiocInstaller/R/0000755000175100017510000000000012607311261014524 5ustar00biocbuildbiocbuildBiocInstaller/R/biocLite.R0000644000175100017510000001156112607265133016413 0ustar00biocbuildbiocbuild.mbniFilter <- function(pkgs, ..., type=getOption("pkgType")) { repos <- getOption("repos") ## MBNI packages not always available doing <- character() if ((type %in% c("mac.binary", "mac.binary.leopard")) && ("MBNI" %in% names(repos))) { url <- contrib.url(repos[["MBNI"]]) doing <- intersect(pkgs, row.names(available.packages(url))) if (length(doing)) { pkgNames <- paste(sQuote(doing), collapse=", ") .message("MBNI Brain Array packages %s are not available as Mac binaries, use biocLite with type='source'", pkgNames) } } setdiff(pkgs, doing) } .reposInstall <- function(pkgs, lib, ...) { ## non-'github' packages doing <- grep("/", pkgs, invert=TRUE, value=TRUE) if (length(doing)) { pkgNames <- paste(sQuote(doing), collapse=", ") .message("Installing package(s) %s", pkgNames) install.packages(pkgs=doing, lib=lib, ...) } setdiff(pkgs, doing) } .githubInstall <- function(pkgs, ...) { doing <- grep("/", pkgs, value=TRUE) if (length(doing)) { pkgNames <- paste(sQuote(doing), collapse=", ") if (!requireNamespace("devtools", quietly=TRUE)) .stop("github installation of %s only available after biocLite(\"devtools\")", pkgNames) .message("Installing github package(s) %s", pkgNames) devtools::install_github(doing, ...) } setdiff(pkgs, doing) } .biocLiteInstall <- function(pkgs, repos, ask, suppressUpdates, siteRepos=character(), lib.loc=NULL, lib=.libPaths()[1], instlib=NULL, ...) { if (!missing(repos)) .stop("'repos' argument to 'biocLite' not allowed") if (!(is.character(suppressUpdates) || is.logical(suppressUpdates)) || (is.logical(suppressUpdates) && 1L != length(suppressUpdates))) .stop("'suppressUpdates' must be character() or logical(1)") biocMirror <- getOption("BioC_mirror", sprintf("%s//bioconductor.org", .protocol())) .message("BioC_mirror: %s", biocMirror) .message("Using Bioconductor %s (BiocInstaller %s), %s.", biocVersion(), packageVersion("BiocInstaller"), sub(" version", "", R.version.string)) if (!suppressPackageStartupMessages(require("utils", quietly=TRUE))) .stop("failed to load package 'utils'") orepos <- options(repos=biocinstallRepos(siteRepos)) on.exit(options(orepos)) if (length(pkgs)) { todo <- .mbniFilter(pkgs, ...) todo <- .reposInstall(todo, lib=lib, ...) todo <- .githubInstall(todo, ...) } ## early exit if suppressUpdates if (is.logical(suppressUpdates) && suppressUpdates) return(invisible(pkgs)) pkgsToUpdate <- old.packages(lib.loc) if (is.null(pkgsToUpdate)) return(invisible(pkgs)) if (!is.logical(suppressUpdates)) { pkgsToUpdate <- filterPackagesToUpdate(suppressUpdates, pkgsToUpdate) suppressUpdates <- FALSE } oldPkgs <- pkgsToUpdate if (nrow(oldPkgs)) { pkgList <- paste(oldPkgs[,"Package"], collapse="', '") if (ask) { .message("Old packages: '%s'", pkgList) answer <- .getAnswer("Update all/some/none? [a/s/n]: ", allowed = c("a", "A", "s", "S", "n", "N")) switch(answer, a = update.packages(lib.loc, oldPkgs=oldPkgs, ask=FALSE, instlib=instlib), s = update.packages(lib.loc, oldPkgs=oldPkgs, ask=TRUE, instlib=instlib), n = invisible(pkgs)) } else { .message("Updating packages '%s'", pkgList) update.packages(lib.loc, oldPkgs=oldPkgs, ask=ask) } } invisible(pkgs) } .getAnswer <- function(msg, allowed) { if (interactive()) { repeat { cat(msg) answer <- readLines(n = 1) if (answer %in% allowed) break } tolower(answer) } else { "n" } } biocLite <- function(pkgs=c("Biobase","IRanges","AnnotationDbi"), suppressUpdates=FALSE, suppressAutoUpdate=FALSE, siteRepos=character(), ask=TRUE, ...) { if (missing(pkgs)) # biocLite() update w/out installing defaults pkgs <- pkgs[!pkgs %in% rownames(installed.packages())] if (!suppressAutoUpdate && !.isCurrentBiocInstaller()) { on.exit(.updateBiocInstaller(pkgs, ask=ask, suppressUpdates=suppressUpdates, siteRepos=siteRepos, ...)) } else if ("BiocUpgrade" %in% pkgs) { .biocUpgrade() } else { .biocLiteInstall(pkgs, ask=ask, siteRepos=siteRepos, suppressUpdates=suppressUpdates, ...) } } BiocInstaller/R/biocUpdatePackages.R0000644000175100017510000000077212607265134020402 0ustar00biocbuildbiocbuildbiocUpdatePackages <- function(pkgs, dependencies = NA, repos = biocinstallRepos(), ...) { if (identical(dependencies, NA)) dependencies <- c("Depends", "Imports", "LinkingTo") avail <- available.packages(contriburl=contrib.url(repos)) deps <- avail[pkgs, dependencies, drop=FALSE] deps <- unlist(apply(deps, 1, utils:::.clean_up_dependencies)) deps <- unique(c(pkgs, deps)) deps <- deps[deps %in% rownames(avail)] update.packages(oldPkgs=deps, repos=repos, ...) } BiocInstaller/R/biocValid.R0000644000175100017510000000524612607265133016560 0ustar00biocbuildbiocbuild.tooNewPkgs <- function(instPkgs, availPkgs) { idx <- rownames(availPkgs) %in% rownames(instPkgs) vers <- availPkgs[idx, "Version"] idx <- package_version(vers) < package_version(instPkgs[names(vers), "Version"]) tooNew <- names(vers)[idx] instPkgs[tooNew, c("Version", "LibPath"), drop=FALSE] } biocValid <- function(pkgs = installed.packages(lib.loc, priority=priority), lib.loc=NULL, priority="NA", type=getOption("pkgType"), filters=NULL, silent=FALSE, ..., fix=FALSE) { if (!is.matrix(pkgs)) { if (is.character(pkgs)) pkgs <- installed.packages(pkgs, lib.loc=lib.loc) else .stop("'pkgs' must be a character vector of package names, or a matrix like that returned by 'installed.packages()'") } repos <- biocinstallRepos() contribUrl <- contrib.url(repos, type=type) availPkgs <- available.packages(contribUrl, type=type, filters=filters) oldPkgs <- old.packages(lib.loc, repos=biocinstallRepos(), instPkgs=pkgs, available=availPkgs, checkBuilt=TRUE, type=type) tooNewPkgs <- .tooNewPkgs(pkgs, availPkgs) valid <- (NROW(oldPkgs) == 0) && (NROW(tooNewPkgs) == 0) if (valid) return(valid) if (!silent) { result <- structure(list(oldPkgs=oldPkgs, tooNewPkgs = tooNewPkgs), class="biocValid") print(result) } if (fix) { pkgs <- c(rownames(oldPkgs), rownames(tooNewPkgs)) biocLite(pkgs, lib.loc=lib.loc, ...) .warning("updated or downgraded package(s) %s", paste(.sQuote(pkgs), collapse=" ")) } else { msg <- character() if (NROW(oldPkgs)) msg <- c(msg, sprintf("%d package(s) out of date", NROW(oldPkgs))) if (NROW(tooNewPkgs)) msg <- c(msg, sprintf("%d package(s) too new", NROW(tooNewPkgs))) .stop(paste(msg, collapse="; ")) } invisible(valid) } print.biocValid <- function(x, ...) { cat("\n* sessionInfo()\n\n") print(sessionInfo()) cat("\n") if (NROW(x$oldPkgs)) { cat("* Out-of-date packages\n") print(x$oldPkgs) cat("\nupdate with biocLite()\n\n") } if (NROW(x$tooNewPkgs)) { cat("* Packages too new for Bioconductor version ", .sQuote(as.character(biocVersion())), "\n\n", sep="") print(x$tooNewPkgs) pkgs <- paste(.dQuote(rownames(x$tooNewPkgs)), collapse=", ") msg <- .msg(ifelse(NROW(x$tooNewPkgs) == 1L, "biocLite(%s)", "biocLite(c(%s))"), pkgs) cat("\ndowngrade with ", msg, "\n\n", sep="") } } BiocInstaller/R/biocVersion.R0000644000175100017510000000004712607265133017140 0ustar00biocbuildbiocbuildbiocVersion <- function() BIOC_VERSION BiocInstaller/R/biocinstallRepos.R0000644000175100017510000000527212607265134020200 0ustar00biocbuildbiocbuild## TODO: should probably print out a message about how to use mirrors, ## the way sourcing biocLite.R does now. biocinstallRepos <- function(siteRepos=character(), version=biocVersion()) { biocVersion <- as.package_version(version) old.opts <- options("repos") on.exit(options(old.opts)) ## Starting at some point in R-2.14, Omegahat is included in ## the list of available repositories, on windows only, it seems. ## on mac and linux: ## 1: + CRAN ## 2: + CRAN (extras) ## 3: + BioC software ## 4: + BioC annotation ## 5: + BioC experiment ## 6: + BioC extra ## 7: R-Forge ## 8: rforge.net ## on windows: ## 1: + CRAN ## 2: + CRAN (extras) ## 3: Omegahat ## 4: BioC software ## 5: BioC annotation ## 6: BioC experiment ## 7: BioC extra ## 8: R-Forge ## 9: rforge.net ## So it's probably better not to rely on the numbers. setRepositories(ind=1:20) # in case more repos are added repos <- getOption("repos") biocMirror <- getOption("BioC_mirror", sprintf("%s//bioconductor.org", .protocol())) biocPaths <- c(BioCsoft="bioc", BioCann="data/annotation", BioCexp="data/experiment", BioCextra="extra") biocRepos <- paste(biocMirror, "packages", biocVersion, biocPaths, sep="/") repos[names(biocPaths)] <- biocRepos keepRepos <- if (.Platform$OS.type %in% "windows") { c(names(biocPaths), "CRAN", "CRANextra") } else { c(names(biocPaths), "CRAN") } repos <- repos[keepRepos] ## This needs to be commented out a few months (3? 4?) after the ## next development cycle has started, when we are confident that ## no developper is still using an early R devel with a ## tools:::.BioC_version_associated_with_R_version still pointing ## to the release repository. if (!IS_USER) { ## comment repos here as they become available. inactive <- c( ## "BioCsoft" ## , "BioCextra" ## , "BioCann" ## , "BioCexp" ) ## No need to touch below. tmpRepos <- paste(biocMirror, "packages", DOWNGRADE_VERSION, biocPaths[inactive], sep="/") repos[inactive] <- tmpRepos } repos <- subset(repos, !is.na(repos)) if ("@CRAN@" %in% repos) repos["CRAN"] <- sprintf("%s//cran.rstudio.com", .protocol()) if (includeMBNI && (getOption("pkgType") %in% c("source", "win.binary"))) repos[["MBNI"]] <- mbniUrl c(siteRepos=siteRepos, repos) } BiocInstaller/R/getUpdateablePackages.R0000644000175100017510000000027012607265133021061 0ustar00biocbuildbiocbuildfilterPackagesToUpdate <- function(regexes, pkgs) { regex = paste(regexes, collapse="|") hits <- grep(regex, pkgs[,"Package"], invert=TRUE) pkgs[hits, , drop=FALSE] } BiocInstaller/R/package_groups.R0000644000175100017510000000461212607265133017652 0ustar00biocbuildbiocbuildmonograph_group <- function() { warning("'arrayMagic' package is no longer available") c("affycomp", "affydata", "affypdnn", "affyPLM", "ALL", "ALLMLL", "AmpAffyExample", "annaffy", "AnnBuilder", "annotate", "arrayQuality", "beta7", "Biobase", "bioDist", "Biostrings", "cMAP", "CoCiteStats", "convert", "e1071", "edd", "estrogen", "exactRankTests", "facsDorit", "factDesign", "gbm", "gcrma", "geneplotter", "golubEsets", "GOstats", "gpls", "graph", "hexbin", "hgu133a", "hgu133atagcdf", "hgu133acdf", "hgu133bcdf", "hgu2beta7", "hgu95av2", "hgu95av2cdf", "hgu95av2probe", "hopach", "hsahomology", "hu6800cdf", "hu6800probe", "humanLLMappings", "ipred", "KEGG", "KEGGSOAP", "kidpack", "limma", "locfit", "LogitBoost", "matchprobes", "mclust", "mlbench", "MLInterfaces", "multtest", "pamr", "prada", "PROcess", "ProData", "randomForest", "rat2302", "RbcBook1", "RBGL", "RColorBrewer", "RCurl", "Rgraphviz", "rrcov", "simpleaffy", "sma", "SpikeInSubset", "SSOAP", "statmod", "vsn", "XML", "xtable", "YEAST", "yeastExpData") } lite_group <- function() { c("affy", "affydata", "affyPLM", "annaffy", "annotate", "Biobase", "biomaRt", "Biostrings", "DynDoc", "gcrma", "genefilter", "geneplotter", "hgu95av2.db", "limma", "marray", "multtest", "vsn", "xtable", "affyQCReport") } graph_group <- function() { c("graph", "Rgraphviz", "RBGL") } all_group <- function() { contribUrl <- paste(biocinstallRepos()['BioCsoft'], "src/contrib", sep="/") pkglist = available.packages(contribUrl) pkgs = rownames(pkglist) } RBioinf_group <- function() { c(lite_group(), graph_group(), "RBioinf", "BiocCaseStudies", "XML", "RCurl", "biomaRt", "GEOquery", "KEGG", "KEGGSOAP", "hgu95av2", "hgu95av2probe", "hgu95av2cdf", "human.db0", "BSgenome.Hsapiens.UCSC.hg18") } biocases_group <- function() { c(lite_group(), graph_group(), "ALL", "apComplex", "bioDist", "BiocCaseStudies", "biocGraph", "biomaRt", "CCl4", "CLL", "Category", "class", "convert", "GO.db", "GOstats", "GSEABase", "hgu133a.db", "hgu95av2cdf", "hgu95av2probe", "hopach", "KEGG.db", "kohonen", "lattice", "latticeExtra", "MASS", "matchprobes", "MLInterfaces", "org.Hs.eg.db", "ppiStats", "randomForest", "RColorBrewer", "Rintact", "sma", "weaver", "yeastExpData") } BiocInstaller/R/updateBiocInstaller.R0000644000175100017510000000754212607265133020622 0ustar00biocbuildbiocbuild.getContribUrl <- function(biocVersion) { .contribUrl <- function(repos) { contribUrl <- contrib.url(repos) pkgs <- available.packages(contribUrl) if (nrow(pkgs) == 0L) .stop("no packages in repository (no internet connection?)", call.=FALSE) else if (!"BiocInstaller" %in% rownames(pkgs)) .stop("'BiocInstaller' package not in repository", call.=FALSE) contribUrl } repos <- biocinstallRepos(version=biocVersion)["BioCsoft"] suppressWarnings(tryCatch({ .contribUrl(repos) }, error=function(err) { version <- getRversion() currentVersion <- sprintf("%d.%d", version$major, version$minor) lowerVersion <- .lowerRVersionString(version) oldRepos <- sub(currentVersion, lowerVersion, repos) if (oldRepos == repos) .stop("'%s' while trying %s", conditionMessage(err), repos, call.=FALSE) .message("'%s' while trying %s, trying %s", conditionMessage(err), repos, oldRepos) .contribUrl(oldRepos) })) } .isCurrentBiocInstaller <- function() { installedSentinel <- availableSentinel <- package_version("0.0.0") installedVersion <- tryCatch(packageVersion("BiocInstaller"), error = function(err) installedSentinel) contribUrl <- .getContribUrl(biocVersion()) ap <- available.packages(contribUrl) availableVersion <- if ("BiocInstaller" %in% rownames(ap)) package_version(ap["BiocInstaller", "Version"]) else availableSentinel if ((installedVersion == availableVersion) && (installedVersion == installedSentinel)) .stop("'BiocInstaller' package not installed, and not available") availableVersion <= installedVersion } .updateBiocInstaller <- function(pkgs, ask, suppressUpdates, lib.loc=NULL, ...) { .dbg("before, version is %s", packageVersion("BiocInstaller")) bootstrap <- function() { if ("package:BiocInstaller" %in% search()) detach("package:BiocInstaller", unload=TRUE, force=TRUE) ## repos will be in bootstrap's environment suppressWarnings(tryCatch({ update.packages(lib.loc, repos=repos, ask=FALSE, checkBuilt=TRUE, oldPkgs="BiocInstaller") }, error=function(err) { assign("failed", TRUE, "biocBootstrapEnv") NULL })) library(BiocInstaller) BiocInstaller:::.updateBiocInstallerFinish() } biocBootstrapEnv <- new.env() biocBootstrapEnv[["pkgs"]] <- pkgs[pkgs != "BiocInstaller"] biocBootstrapEnv[["ask"]] <- ask biocBootstrapEnv[["suppressUpdates"]] <- suppressUpdates biocBootstrapEnv[["repos"]] <- biocinstallRepos(version=biocVersion()) biocBootstrapEnv[["dotArgs"]] <- list(...) .stepAside(biocBootstrapEnv, bootstrap) } .updateBiocInstallerFinish <- function() { args <- c(list(pkgs=get("pkgs", "biocBootstrapEnv"), ask=get("ask", "biocBootstrapEnv"), suppressUpdates=get("suppressUpdates", "biocBootstrapEnv")), get("dotArgs", "biocBootstrapEnv")) failed <- exists("failed", "biocBootstrapEnv") detach("biocBootstrapEnv") .dbg("after, version is %s", packageVersion("BiocInstaller")) vers <- packageVersion("BiocInstaller") if (!failed) .message("'BiocInstaller' updated to version %s", vers) else .warning("'BiocInstaller' update failed, using version %s", vers, call.=FALSE) if ("BiocUpgrade" %in% args$pkgs) { .biocUpgrade() } else { do.call(.biocLiteInstall, args) } } ## FIXME: DEFUNCT after BiocInstaller version 1.18.0 .updateBioconductorPackageFinish <- .updateBiocInstallerFinish biocLiteInstall <- .biocLiteInstall BiocInstaller/R/useDevel.R0000644000175100017510000000543512607265133016440 0ustar00biocbuildbiocbuild.biocUpgrade <- function() { if (!IS_UPGRADEABLE) { .stop("Bioconductor version %s cannot be upgraded with R version %s", biocVersion(), getRversion()) } if (IS_UPGRADEABLE && UPGRADE_IS_DEVEL) .stop("Bioconductor version %s can be upgraded, but only to 'devel'; see ?useDevel. Use biocLite() without any arguments to update installed packages", biocVersion()) txt <- sprintf("Upgrade all packages to Bioconductor version %s? [y/n]: ", UPGRADE_VERSION) answer <- .getAnswer(txt, allowed = c("y", "Y", "n", "N")) if ("y" == answer) .update(UPGRADE_VERSION, TRUE) } useDevel <- function(devel=TRUE) { if (devel) { if (!IS_USER) .stop("'devel' version already in use") if (IS_END_OF_LIFE) .stop("'devel' version not available") if (!IS_UPGRADEABLE) .stop("'devel' version requires a more recent R") biocVers <- UPGRADE_VERSION } else { if (IS_USER) .stop("'devel' version not in use") if (!IS_DOWNGRADEABLE) .stop("'devel' version cannot be down-graded with this version of R") biocVers <- DOWNGRADE_VERSION } .update(biocVers, FALSE) } .update <- function(biocVersion, biocLiteAfterUpdate = FALSE) { .dbg("before, version is %s", packageVersion("BiocInstaller")) bootstrap <- function() { if (nchar(Sys.getenv("BIOCINSTALLER_TEST_REPOS"))) repos = Sys.getenv("BIOCINSTALLER_TEST_REPOS") if ("package:BiocInstaller" %in% search()) detach("package:BiocInstaller", unload=TRUE, force=TRUE) ## repos will be in bootstrap's environment suppressWarnings(tryCatch({ install.packages("BiocInstaller", repos=repos) }, error=function(err) { assign("failed", TRUE, "biocBootstrapEnv") NULL })) library(BiocInstaller) BiocInstaller:::.updateFinish() } biocBootstrapEnv <- new.env() biocBootstrapEnv[["repos"]] <- biocinstallRepos(version=biocVersion) biocBootstrapEnv[["biocLiteAfterUpdate"]] <- biocLiteAfterUpdate .stepAside(biocBootstrapEnv, bootstrap) } .updateFinish <- function() { failed <- exists("failed", "biocBootstrapEnv") biocLiteAfterUpdate <- get("biocLiteAfterUpdate", "biocBootstrapEnv") detach("biocBootstrapEnv") .dbg("after, version is %s", packageVersion("BiocInstaller")) vers <- packageVersion("BiocInstaller") if (!failed) { .message("'BiocInstaller' changed to version %s", vers) if (biocLiteAfterUpdate) biocLite(character(), ask=FALSE) } else .warning("update failed, using BiocInstaller version %s", vers, call.=FALSE) } BiocInstaller/R/utilities.R0000644000175100017510000000277312607265133016701 0ustar00biocbuildbiocbuild.dQuote <- function(x) sprintf('"%s"', as.character(x)) .sQuote <- function(x) sprintf("'%s'", as.character(x)) .msg <- function(fmt, ..., width=getOption("width")) ## Use this helper to format all error / warning / message text { txt <- strwrap(sprintf(fmt, ...), width=width, exdent=2) paste(txt, collapse="\n") } # use as BiocInstaller:::.opts$get() BiocInstaller:::.opts$set(TRUE) .opts = local({ debug <- FALSE list(get=function() debug, set=function(x) { old <- debug debug <<- x old }) }) .dbg <- function(...) { if (.opts$get()) { .msg(...) } } .message <- function(..., appendLF=TRUE) { message(.msg(...), appendLF=appendLF) } .stop <- function(..., call.=FALSE) { stop(.msg(...), call.=call.) } .warning <- function(..., call.=FALSE, immediate.=FALSE) { warning(.msg(...), call.=call., immediate.=immediate.) } .lowerRVersionString <- function(version=getRversion()) { if (0L == version$minor) { major <- version$major - 1L minor <- version$minor } else { major <- version$major minor <- version$minor - 1L } paste(major, minor, sep=".") } # bootstrap() should take care of unloading BiocInstaller # and reloading it. .stepAside <- function(biocBootstrapEnv, bootstrap) { environment(bootstrap) <- biocBootstrapEnv biocBootstrapEnv[["bootstrap"]] <- bootstrap attach(biocBootstrapEnv) on.exit(eval(bootstrap(), biocBootstrapEnv)) } BiocInstaller/R/zzz.R0000644000175100017510000001014512607311261015505 0ustar00biocbuildbiocbuild## The following values are updated with each Bioc release; see .onLoad BIOC_VERSION <- package_version("3.2") # Bioc version for this package R_VERSION_MAX <- package_version("3.3.0") # Maximum version of R for # this version of BiocInstaller IS_USER <- TRUE # TRUE if this version of # Bioconductor is the # current release version IS_END_OF_LIFE <- FALSE # TRUE if this version of # Bioconductor is no longer # the release version IS_UPGRADEABLE <- FALSE # TRUE if a more recent # version (release or # devel) of Bioconductor is # available for this # version of R UPGRADE_IS_DEVEL <- TRUE # TRUE if UPGRADE_VERSION # is for devel use only IS_DOWNGRADEABLE <- TRUE # TRUE if an older version # (release or devel) of # Bioconductor is available # for this version of R UPGRADE_VERSION <- package_version("3.2") # Bioconductor version for # upgrade, if # IS_UPGRADEABLE == TRUE DOWNGRADE_VERSION <- package_version("3.1") # Bioconductor version for # downgrade, if # IS_DOWNGRADEABLE == # TRUE NEXT_R_DEVEL_VERSION <- "3.3.0" # next (not-yet-supported) version of R ## Change when the status of MBNI changes. ## Make sure this change is propagated to users, even ## if builds have stopped for a particular version of BioC. ## See biocLite.R:biocinstallRepos to include / exclude package types includeMBNI <- FALSE mbniUrl <- "http://brainarray.mbni.med.umich.edu/bioc" .protocol <- local({ PROTOCOL <- NULL function() { useHTTPS <- getOption("useHTTPS") if (!is.null(useHTTPS)) { PROTOCOL <<- if (useHTTPS) "https:" else "http:" } else if (is.null(PROTOCOL)) { con <- file(fl <- tempfile(), "a") on.exit(close(con)) ## use 'sink' to catch 3.2.1 output sink(con, type="message") tryCatch({ close(file("https://bioconductor.org")) }, error=function(e) { ## divert errors to message stream message(conditionMessage(e)) }) sink(type="message") flush(con) useHTTPS <- length(readLines(fl)) == 0L PROTOCOL <<- if (useHTTPS) "https:" else "http:" } PROTOCOL } }) globalVariables("repos") # used in 'bootstrap' functions .onAttach <- function(libname, pkgname) { Rversion <- getRversion() .message("Bioconductor version %s (BiocInstaller %s), ?biocLite for help", biocVersion(), packageVersion("BiocInstaller")) if (IS_END_OF_LIFE) { if (IS_UPGRADEABLE) .message("A newer version of Bioconductor is available for this version of R, ?BiocUpgrade for help") else .message("A new version of Bioconductor is available after installing the most recent version of R; see http://bioconductor.org/install") } else if (Rversion >= R_VERSION_MAX) { if (Rversion >= NEXT_R_DEVEL_VERSION) .message("Bioconductor does not yet support R version %s", Rversion) else .warning("BiocInstaller version %s is too old for R version %s; remove.packages(\"BiocInstaller\"), re-start R, then source(\"%s//bioconductor.org/biocLite.R\")", BIOC_VERSION, Rversion, .protocol()) } } BiocInstaller/inst/0000755000175100017510000000000012607265133015306 5ustar00biocbuildbiocbuildBiocInstaller/inst/scripts/0000755000175100017510000000000012607265133016775 5ustar00biocbuildbiocbuildBiocInstaller/inst/scripts/biocLite.R0000644000175100017510000001667112607265133020665 0ustar00biocbuildbiocbuild## Mirrors: uncomment the following and change to your favorite CRAN mirror ## if you don't want to use the default (cran.rstudio.com). ## options("repos" = c(CRAN="https://cran.rstudio.com")) ## Mirrors: uncomment the following and change to your favorite Bioconductor ## mirror, if you don't want to use the default (bioconductor.org) ## options("BioC_mirror" = "https://bioconductor.org") local({ vers <- getRversion() biocVers <- tryCatch({ BiocInstaller::biocVersion() # recent BiocInstaller }, error=function(...) { # no / older BiocInstaller BioC_version_associated_with_R_version <- get(".BioC_version_associated_with_R_version", envir=asNamespace("tools"), inherits=FALSE) if (is.function(BioC_version_associated_with_R_version)) BioC_version_associated_with_R_version() else # numeric_version BioC_version_associated_with_R_version }) if (vers < "3.0") { ## legacy; no need to change "3.0" ever ## coordinate this message with .onAttach txt <- strwrap("A new version of Bioconductor is available after installing the most recent version of R; see http://bioconductor.org/install", exdent=2) message(paste(txt, collapse="\n")) } else if ("package:BiocInstaller" %in% search()) { ## messages even if already attached tryCatch(BiocInstaller:::.onAttach(), error=function(...) NULL) } if (vers > "2.13" && biocVers > "2.8") { if (exists("biocLite", .GlobalEnv, inherits=FALSE)) { txt <- strwrap("There is an outdated biocLite() function in the global environment; run 'rm(biocLite)' and try again.") stop("\n", paste(txt, collapse="\n")) } if (!suppressWarnings(require("BiocInstaller", quietly=TRUE))) { a <- NULL p <- file.path(Sys.getenv("HOME"), ".R", "repositories") if (file.exists(p)) { a <- tools:::.read_repositories(p) if (!"BioCsoft" %in% rownames(a)) a <- NULL } if (is.null(a)) { p <- file.path(R.home("etc"), "repositories") a <- tools:::.read_repositories(p) } if (!"package:utils" %in% search()) { path <- "//bioconductor.org/biocLite.R" txt <- sprintf("use 'source(\"https:%s\")' or 'source(\"http:%s\")' to update 'BiocInstaller' after library(\"utils\")", path, path) message(paste(strwrap(txt), collapse="\n ")) } else { ## add a conditional for Bioc releases occuring WITHIN ## a single R minor version. This is so that a user with a ## version of R (whose etc/repositories file references the ## no-longer-latest URL) and without BiocInstaller ## will be pointed to the most recent repository suitable ## for their version of R if (vers >= "3.2.2" && vers < "3.3.0") { ## transitioning to https support; check availability con <- file(fl <- tempfile(), "w") sink(con, type="message") tryCatch({ xx <- close(file("https://bioconductor.org")) }, error=function(e) { message(conditionMessage(e)) }) sink(type="message") close(con) if (!length(readLines(fl))) a["BioCsoft", "URL"] <- sub("^http:", "https:", a["BioCsoft", "URL"]) } else if (vers == "3.2.0") { a["BioCsoft", "URL"] <- sub(as.character(biocVers), "3.1", a["BioCsoft", "URL"]) } else if (vers == "3.1.1") { ## R-3.1.1's etc/repositories file at the time of the release ## of Bioc 3.0 pointed to the 2.14 repository, but we want ## new installations to access the 3.0 repository a["BioCsoft", "URL"] <- sub(as.character(biocVers), "3.0", a["BioCsoft", "URL"]) } else if (vers == "3.1.0") { ## R-devel points to 2.14 repository a["BioCsoft", "URL"] <- sub(as.character(biocVers), "2.14", a["BioCsoft", "URL"]) } else if (vers >= "2.15" && vers < "2.16") { a["BioCsoft", "URL"] <- sub(as.character(biocVers), "2.11", a["BioCsoft", "URL"]) biocVers <- numeric_version("2.11") } install.packages("BiocInstaller", repos=a["BioCsoft", "URL"]) if (!suppressWarnings(require("BiocInstaller", quietly=TRUE))) { path0 <- "//bioconductor.org/packages" path <- sprintf("%s/%s/bioc", path0, as.character(biocVers)) txt0 <- "'biocLite.R' failed to install 'BiocInstaller', use 'install.packages(\"BiocInstaller\", repos=\"https:%s\")' or 'install.packages(\"BiocInstaller\", repos=\"http:%s\")'" txt <- sprintf(txt0, path, path) message(paste(strwrap(txt), collapse="\n ")) } } } else { ## BiocInstaller version 1.16.0-1.18.1 do not ## automatically update when type=="source"; notify users ## when they have updated R over their old libraries installerVersion <- utils::packageVersion("BiocInstaller") test0 <- (vers > "3.1.2") && !identical(getOption("pkgType"), "source") && (installerVersion >= "1.16.0") && (installerVersion <= "1.16.4") if (test0) { if (installerVersion < "1.16.4") { txt <- "Update BiocInstaller with oldPkgType=options(pkgType=\"source\"); biocLite(\"BiocInstaller\"); options(oldPkgType)" message(paste(strwrap(txt, exdent=2), collapse="\n")) } if (vers >= "3.2") { path <- "//bioconductor.org/biocLite.R" txt <- sprintf("BiocInstaller version %s is too old for R version %s; remove.packages(\"BiocInstaller\"), re-start R, then source(\"https:%s\") or source(\"http:%s\")", biocVers, vers, path, path) warning(paste(strwrap(txt, exdent=2), collapse="\n")) } } } } else { tryCatch({ source("https://bioconductor.org/getBioC.R") }, error=function(e) { warning("https: failed (", conditionMessage(e), "), trying http", immediate.=TRUE) source("http://bioconductor.org/getBioC.R") }) biocLite <<- function(pkgs, groupName="lite", ...) { if (missing(pkgs)) biocinstall(groupName=groupName, ...) else biocinstall(pkgs=pkgs, groupName=groupName, ...) } } }) BiocInstaller/inst/unitTests/0000755000175100017510000000000012607265133017310 5ustar00biocbuildbiocbuildBiocInstaller/inst/unitTests/test_BiocUpgrade.R0000644000175100017510000000141312607265133022655 0ustar00biocbuildbiocbuildtest_useDevel <- function() { if (!BiocInstaller:::IS_DOWNGRADEABLE) checkException(useDevel(FALSE), silent=TRUE) if (!BiocInstaller:::IS_UPGRADEABLE) { checkException(useDevel(), silent=TRUE) opts <- options(warn=2); on.exit(options(opts)) checkException(biocLite("BiocUpgrade")) } } test_getContribUrl_exist <- function() { fun <- BiocInstaller:::.getContribUrl vers <- BiocInstaller:::BIOC_VERSION checkTrue(grepl(vers, fun(vers))) if (BiocInstaller:::IS_UPGRADEABLE) { vers <- BiocInstaller:::UPGRADE_VERSION checkTrue(grepl(vers, fun(vers))) } if (BiocInstaller:::IS_DOWNGRADEABLE) { vers <- BiocInstaller:::DOWNGRADE_VERSION checkTrue(grepl(vers, fun(vers))) } } BiocInstaller/inst/unitTests/test_biocinstallRepos.R0000644000175100017510000000112112607265133024001 0ustar00biocbuildbiocbuildrepos <- biocinstallRepos() test_biocinstallRepos_named_repositories <- function() { allOS <- c("BioCsoft", "CRAN", "BioCann", "BioCexp", "BioCextra") windowsOnly <- "CRANextra" checkTrue(all(allOS %in% names(repos))) if (.Platform$OS.type == "windows") { checkTrue(windowsOnly %in% names(repos)) } else { checkTrue(!windowsOnly %in% names(repos)) } } test_biocinstallRepos_noNA_repositories <- function() { checkTrue(!any(is.na(repos))) } test_biocinstallRepos_order <- function() { checkIdentical("BioCsoft", names(repos)[[1]]) } BiocInstaller/man/0000755000175100017510000000000012607265133015104 5ustar00biocbuildbiocbuildBiocInstaller/man/BiocUpgrade.Rd0000644000175100017510000000203012607265133017552 0ustar00biocbuildbiocbuild\name{BiocUpgrade} \alias{BiocUpgrade} \title{ Upgrade Bioconductor to the latest version available for this version of R } \description{ Downloads the latest version of the BiocInstaller package, and upgrades all currently installed packages to the latest repositories \strong{for this version of R}. To upgrade, use: \preformatted{ ## 'http' if 'https' unavailable source("https://bioconductor.org/biocLite.R") biocLite("BiocUpgrade") } } \seealso{ \code{\link{biocLite}} Installs/updates Bioconductor/CRAN packages. \code{\link{chooseBioCmirror}} lets you choose from a list of all public Bioconductor mirror URLs. \code{\link{chooseCRANmirror}} lets you choose from a list of all public CRAN mirror URLs. \code{\link{biocinstallRepos}} returns the Bioconductor and CRAN repositories used by \code{biocLite}. \code{\link{install.packages}} installs the packages themselves. } \examples{ \dontrun{ source("https://bioconductor.org/biocLite.R") biocLite("BiocUpgrade") } } \keyword{environment} BiocInstaller/man/biocLite.Rd0000644000175100017510000001136412607265133017132 0ustar00biocbuildbiocbuild\name{biocLite} \alias{biocLite} \title{ Install or update Bioconductor and CRAN packages } \description{ \code{biocLite} installs or updates Bioconductor and CRAN packages in a Bioconductor release. Upgrading to a new Bioconductor release requires additional steps; see \url{https://bioconductor.org/install}. } \usage{ biocLite(pkgs=c("Biobase", "IRanges", "AnnotationDbi"), suppressUpdates=FALSE, suppressAutoUpdate=FALSE, siteRepos=character(), ask=TRUE, ...) } \arguments{ \item{pkgs}{\code{character()} of package names to install or update. A missing value and \code{suppressUpdates=FALSE} updates installed packages, perhaps also installing \code{Biobase}, \code{IRanges}, and \code{AnnotationDbi} if they are not already installed. Package names containing a \sQuote{/} are treated as github repositories and installed using the \code{install_github()} function of the \code{devtools} package.} \item{suppressUpdates}{\code{logical(1)} indicating whether to suppress automatic updating of all installed packages, or \code{character()} of regular expressions specifying which packages to NOT automatically update.} \item{suppressAutoUpdate}{\code{logical(1)} indicating whether the \code{BiocInstaller} package updates itself.} \item{siteRepos}{\code{character()} representing an additional repository in which to look for packages to install. This repository will be prepended to the default repositories (which you can see with \code{\link{biocinstallRepos}}).} \item{ask}{\code{logical(1)} indicating whether to prompt user before installed packages are updated, or the character string 'graphics', which brings up a widget for choosing which packages to update. If TRUE, user can choose whether to update all outdated packages without further prompting, to pick and choose packages to update, or to cancel updating (in a non-interactive session, no packages will be updated). Otherwise, the value is passed to \code{\link{update.packages}}.} \item{...}{Additional arguments. \code{lib.loc} is passed to \code{\link{old.packages}} (used to determine the library location of installed packages to be updated). \code{lib} is passed to \code{\link{install.packages}} (used to determine the library location where \code{pkgs} are to be installed).} } \details{ Installation of Bioconductor and CRAN packages use R's standard functions for library management -- \code{install.packages()}, \code{available.packages()}, \code{update.packages()}. Installation of github packages uses the \code{install_github()} function from the \code{devtools} package. For this reason it usually makes sense, when complicated installation options are needed, to invoke \code{biocLite()} separately for Bioconductor / CRAN packages and for github packages. } \value{ \code{biocLite()} returns the \code{pkgs} argument, invisibly. } \seealso{ \code{\link{biocinstallRepos}} returns the Bioconductor and CRAN repositories used by \code{biocLite}. \code{\link{install.packages}} installs the packages themselves. \code{\link{update.packages}} updates all installed packages. \code{\link{chooseBioCmirror}} lets you choose from a list of all public Bioconductor mirror URLs. \code{\link{chooseCRANmirror}} lets you choose from a list of all public CRAN mirror URLs. \code{\link{monograph_group}}, \code{\link{RBioinf_group}} and \code{\link{biocases_group}} return package names associated with Bioconductor publications. \code{\link{all_group}} returns the names of all Bioconductor software packages. } \examples{ \dontrun{ ## Change default Bioconductor and CRAN mirrors chooseBioCmirror() chooseCRANmirror() ## If you don't have the BiocInstaller package installed, you can ## quickly install and load it as follows: source("https://bioconductor.org/biocLite.R") # 'http' if 'https' unavailable ## The most recent version of the BiocInstaller package is now loaded. ## No need to load it with library(). # installs default packages (if not already installed) and updates # previously installed packages biocLite() ## Now install a CRAN package: biocLite("survival") ## install a Bioconductor package, but don't update all installed ## packages as well: biocLite("GenomicRanges", suppressUpdates=TRUE) ## Install default packages, but do not update any package whose name ## starts with "org." or "BSgenome." biocLite(suppressUpdates=c("^org\\.", "^BSgenome\\.")) ## install a package from source: biocLite("IRanges", type="source") ## install all Bioconductor software packages biocLite(all_group()) } ## Show the Bioconductor and CRAN repositories that will be used to ## install/update packages. biocinstallRepos() } \keyword{environment} BiocInstaller/man/biocUpdatePackages.Rd0000644000175100017510000000271212607265133021113 0ustar00biocbuildbiocbuild\name{biocUpdatePackages} \alias{biocUpdatePackages} \title{ Update previously installed Bioconductor or CRAN packages and their dependencies. } \description{ Update previously installed Bioconductor and CRAN packages and their dependencies. Use \code{\link{biocLite}} to install new packages or to update all out-of-date packages. Upgrading to a new Bioconductor release requires additional steps; see \url{https://bioconductor.org/install}. } \usage{ biocUpdatePackages(pkgs, dependencies = NA, repos=biocinstallRepos(), ...) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{pkgs}{\code{character()} of package names to install or update.} \item{dependencies}{\code{character()} describing out-of-date dependencies that are also updated. Defaults to \code{c("Depends", "Imports", "LinkingTo")} but can be a subset of \code{c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances")}.} \item{repos}{\code{character()} of named repositories in which to look for package updates, in the style of \code{biocinstallRepos()}.} \item{\dots}{Additional arguments, passed to \code{\link{update.packages}}. For example, \code{ask=FALSE} to avoid prompts to update individual packages.} } \value{\sQuote{NULL}, invisibly.} \author{Martin Morgan \url{mtmorgan@fhcrc.org}} \seealso{\code{\link{biocLite}}} \examples{ \dontrun{ biocUpdatePackages("GenomicRanges", ask=FALSE) } } \keyword{environment} BiocInstaller/man/biocValid.Rd0000644000175100017510000000520412607265133017270 0ustar00biocbuildbiocbuild\name{biocValid} \alias{biocValid} \title{Validate installed package versions against biocLite versions.} \description{ Check that installed packages are consistent (neither out-of-date nor too new) with the version of R and Bioconductor in use, using \code{biocLite} for validation. } \usage{ biocValid(pkgs = installed.packages(lib.loc, priority = priority), lib.loc = NULL, priority = "NA", type = getOption("pkgType"), filters = NULL, silent = FALSE, ..., fix=FALSE) } \arguments{ \item{pkgs}{A character list of package names for checking, or a matrix as returned by \code{\link{installed.packages}}.} \item{lib.loc}{The library location(s) of packages to be validated; see \code{\link{installed.packages}}.} \item{priority}{check validity of all, \dQuote{base}, or \dQuote{recommended} packages; see \code{\link{installed.packages}}.} \item{type}{The type of available package (e.g., binary, source) to check validity against; see \code{\link{available.packages}}.} \item{filters}{Filter available packages to check validity against; see \code{\link{available.packages}}.} \item{silent}{Report how packages are invalid (\code{silent=FALSE}, default) and abort execution, or return a logical(1) (\code{silent=TRUE}) indicating the overall validity of installed packages.} \item{\dots}{Additional arguments, passed to \code{\link{biocLite}} when \code{fix=TRUE}.} \item{fix}{When \code{TRUE}, invoke \code{biocLite} to reinstall (update or downgrade, as appropriate) invalid packages.} } \details{ This function compares the version of installed packages to the version of packages associated with the version of R and Bioconductor appropriate for the BiocInstaller package currently in use. Packages are reported as \sQuote{out-of-date} if a more recent version is available at the repositories specified by \code{biocinstallRepos()}. Usually, \code{biocLite()} is sufficient to update packages to their most recent version. Packages are reported as \sQuote{too new} if the installed version is more recent than the most recent available in the \code{biocinstallRepos()} repositories. It is possible to down-grade by re-installing a too new package \dQuote{PkgA} with \code{biocLite("PkgA")}. It is important for the user to understand how their installation became too new, and to avoid this in the future. } \value{ \code{logical(1)} indicating overall validity of installed packages. } \author{Martin Morgan \url{mtmorgan@fhcrc.org}} \seealso{\code{\link{biocLite}} to update installed packages.} \examples{try(biocValid())} \keyword{ environment } BiocInstaller/man/biocVersion.Rd0000644000175100017510000000074312607265133017661 0ustar00biocbuildbiocbuild\name{biocVersion} \alias{biocVersion} \title{Bioconductor version} \description{ This function reports the Bioconductor version in use, as determined by the BiocInstaller package. } \usage{ biocVersion() } \value{ \code{package_version} representing the Bioconductor version in use. } \seealso{ \code{\link{biocLite}} Installs/updates Bioconductor/CRAN packages. \code{\link{BiocUpgrade}} Upgrading to new versions. } \examples{ biocVersion() } \keyword{environment} BiocInstaller/man/biocinstallRepos.Rd0000644000175100017510000000250512607265133020711 0ustar00biocbuildbiocbuild\name{biocinstallRepos} \alias{biocinstallRepos} \title{ Display current Bioconductor and CRAN repositories. } \description{ Displays the URLs of the repositories used by \code{\link{biocLite}} to install Bioconductor and CRAN packages. } \usage{ biocinstallRepos(siteRepos=character(), version=biocVersion()) } \arguments{ \item{siteRepos}{(Optional) \code{character(1)} representing an additional repository (e.g., a URL to an organization's internally maintained repository) in which to look for packages to install. This repository will be prepended to the default repositories returned by the function.} \item{version}{(Optional) \code{character(1)} or \code{package_version} indicating the Bioconductor version (e.g., \dQuote{3.1}) for which repositories are required.} } \value{ Named \code{character()} of repositories. } \seealso{ \code{\link{biocLite}} Installs/updates Bioconductor/CRAN packages. \code{\link{install.packages}} installs the packages themselves. \code{\link{chooseBioCmirror}} lets you choose from a list of all public Bioconductor mirror URLs. \code{\link{chooseCRANmirror}} lets you choose from a list of all public CRAN mirror URLs. } \examples{ biocinstallRepos() ## Choose mirrors \dontrun{ chooseCRANmirror() chooseBioCmirror() } } \keyword{environment} BiocInstaller/man/packageGroups.Rd0000644000175100017510000000257412607265133020176 0ustar00biocbuildbiocbuild\name{Package Groups} \alias{biocases_group} \alias{RBioinf_group} \alias{monograph_group} \alias{all_group} \title{ Convenience functions to return package names associated with Bioconductor publications. } \description{ Returns character vectors of packages associated with Bioconductor publications, which can then be passed to \code{\link{biocLite}()} } \usage{ monograph_group() RBioinf_group() biocases_group() all_group() } \value{ \code{character()} of package names. } \seealso{ \code{\link{biocLite}} Installs/updates Bioconductor/CRAN packages. \code{\link{biocinstallRepos}} returns the Bioconductor and CRAN repositories used by \code{biocLite}. \code{\link{install.packages}} installs the packages themselves. \code{\link{chooseBioCmirror}} lets you choose from a list of all public Bioconductor mirror URLs. \code{\link{chooseCRANmirror}} lets you choose from a list of all public CRAN mirror URLs. } \examples{ ## Get the names of packages used in the book ## "Bioconductor Case Studies": biocases_group() ## Get the names of packages used in the book ## "R Programming for Bioinformatics": RBioinf_group() ## Get the names of packages used in the monograph ## "Bioinformatics and Computational Biology Solutions ## Using R and Bioconductor": monograph_group() ## Get the names of all Bioconductor software packages all_group() } \keyword{environment} BiocInstaller/man/useDevel.Rd0000644000175100017510000001300212607265133017143 0ustar00biocbuildbiocbuild\name{useDevel} \alias{useDevel} \title{ Get the 'devel' version of the BiocInstaller package. } \description{ Downloads the 'devel' version of the BiocInstaller package so that all subsequent invocations of \code{\link{biocLite}} and \code{\link{biocinstallRepos}} use the devel repositories. Displays the URLs of the repositories used by \code{\link{biocLite}} to install Bioconductor and CRAN packages. Should only be used with a release (or patched) version of R, freshly installed. } \usage{ useDevel(devel=TRUE) } \arguments{ \item{devel}{Whether to look in the devel (TRUE) or release (FALSE) repositories in subsequent invocations of \code{\link{biocLite}} and \code{\link{biocinstallRepos}}.} } \details{ With R going to a yearly release schedule and Bioconductor keeping its twice-yearly release schedule, the same version of R (3.2) can be used with two different versions of Bioconductor (3.1, release, and 3.2, devel). The version number of the BiocInstaller package is what is used to determine whether to download packages from the BioC 3.1 or 3.2 repositories. In keeping with Bioconductor versioning conventions, if the middle number (y in x.y.z) is even, the package is part of a release version; if odd, it's part of a devel version. By default, when BiocInstaller is first installed on R-3.2, it will be set up to download BioC 3.1 packages. If you want to change this, you can run the \code{\link{useDevel}} function. With argument \code{TRUE} (the default), it will download the devel version of BiocInstaller and subsequently all packages downloaded with \code{\link{biocLite}} will be from the BioC 3.2 (devel) repository. You should run \code{\link{useDevel}} only once. It is possible to keep BioC 3.1 and 3.2 libraries separate, within the same installation of R. The trick is to use the \code{R_LIBS_USER} environment variable. First, create two separate directories for your BioC release and devel packages. Suggested directory names are as follows: Linux: ~/R/x86_64-unknown-linux-gnu-library/3.2-bioc-release ~/R/x86_64-unknown-linux-gnu-library/3.2-bioc-devel Mac OS: ~/Library/R/3.2-bioc-release/library ~/Library/R/3.2-bioc-devel/library Windows: C:\\Users\\YOUR_USER_NAME\\Documents\\R\\win-library\\3.2-bioc-release C:\\Users\\YOUR_USER_NAME\\Documents\\R\\win-library\\3.2-bioc-devel (change YOUR_USER_NAME to your user name) You can then invoke "R for bioc-devel" or "R for bioc-release" from the command line as follows: Linux: R_LIBS_USER=~/R/x86_64-unknown-linux-gnu-library/3.2-bioc-release R R_LIBS_USER=~/R/x86_64-unknown-linux-gnu-library/3.2-bioc-devel R Mac OS X: R_LIBS_USER=~~/Library/R/3.2-bioc-release/library R R_LIBS_USER=~~/Library/R/3.2-bioc-devel/library R Windows: cmd /C "set R_LIBS_USER=C:\\Users\\YOUR_USER_NAME\\Documents\\R\\win-library\\3.2-bioc-release && R" cmd /C "set R_LIBS_USER=C:\\Users\\YOUR_USER_NAME\\Documents\\R\\win-library\\3.2-bioc-devel && R" (Note: this assumes that R.exe is in your PATH.) If you launch R in this way and then invoke \code{\link{.libPaths}}, you'll see that the first item is your special release or devel directory. Packages will be installed to that directory and that is the first place that \code{\link{library}} will look for them. \code{\link{biocLite}}, \code{\link{install.packages}}, \code{\link{update.packages}} and friends all respect this setting. On Linux and Mac OS X, you can create a bash alias to save typing. Add the following to your ~/bash_profile: Linux alias Rdevel='R_LIBS_USER=~/R/x86_64-unknown-linux-gnu-library/3.2-bioc-devel R' alias Rrelease='R_LIBS_USER=~/R/x86_64-unknown-linux-gnu-library/3.2-bioc-release R' Mac OS X alias Rdevel='R_LIBS_USER=~/Library/R/3.2-bioc-devel/library R' alias Rrelease='R_LIBS_USER=~/Library/R/3.2-bioc-release/library R' You can then invoke these from the command line as Rdevel ...and... Rrelease On Windows, you can create two shortcuts, one for devel and one for release. Go to My Computer and navigate to a directory that is in your PATH. Then right-click and choose New->Shortcut. in the "type the location of the item" box, put: cmd /C "set R_LIBS_USER=C:\\Users\\YOUR_USER_NAME\\Documents\\R\\win-library\\3.2-bioc-release && R" ...for release and cmd /C "set R_LIBS_USER=C:\\Users\\YOUR_USER_NAME\\Documents\\R\\win-library\\3.0-bioc-devel && R" ...for devel. (again, it's assumed R.exe is in your PATH) Click "Next". In the "Type a name for this shortcut" box, type Rdevel or Rrelease You can invoke these from the command line as Rdevel.lnk ...and... Rrelease.lnk (You must type in the .lnk extension.) Because \code{R_LIBS_USER} is an environment variable, its value should be inherited by any subprocesses started by R, so they should do the right thing as well. } \value{ Invisible NULL. } \seealso{ \code{\link{biocinstallRepos}} returns the Bioconductor and CRAN repositories used by \code{biocLite}. \code{\link{biocLite}} Installs/updates Bioconductor/CRAN packages. \code{\link{install.packages}} installs the packages themselves. \code{\link{chooseBioCmirror}} lets you choose from a list of all public Bioconductor mirror URLs. \code{\link{chooseCRANmirror}} lets you choose from a list of all public CRAN mirror URLs. } \examples{ \dontrun{ useDevel() } } \keyword{environment} BiocInstaller/tests/0000755000175100017510000000000012607265133015473 5ustar00biocbuildbiocbuildBiocInstaller/tests/BiocInstaller_unit_tests.R0000644000175100017510000000005312607265133022627 0ustar00biocbuildbiocbuildBiocGenerics:::testPackage("BiocInstaller")