OOMPAinstallRepos <- function() { ## OOMPA CRAN-style repositories. ## The software repo (OOMPA) _must_ be the first element. repos <- c( "2.13" ) setRepositories(graphics=FALSE, ind=c(1,4)) myRepos <- c(getOption("repos"), OOMPA=paste("http://bioinformatics.mdanderson.org/OOMPA", repos, sep="/")) myRepos[length(myRepos)] } OOMPAinstallPkgGroups <- function(groupName="default") { groupName <- match.arg(groupName, c("default", "lite", "genalg", "prediction", "supercurve", "all", "arraycube")) supercurve.group <- c("tclish", "SuperCurve", "SuperCurveGUI", "SlideDesignerGUI") if (groupName == "supercurve") return(supercurve.group) lite.group <- c("oompaBase", "PreProcess", "ClassDiscovery", "ClassComparison") if (groupName == "lite") return(lite.group) genalg.group <- c(lite.group, "GenAlg") if (groupName == "genalg") return(genalg.group) prediction.group <- c(genalg.group, "TailRank", "CrossVal", "ClassPrediction") if (groupName == "prediction") return(prediction.group) default.group <- c(prediction.group, supercurve.group, "TailRank") if (groupName == "default") return(default.group) arraycube.group <- c("oompaBase", "PreProcess", "ArrayCube", "MINiML") if (groupName == "arraycube") return(arraycube.group) OOMPA.url <- OOMPAinstallRepos()[[1]] contriburl <- paste(OOMPA.url, "src/contrib", sep="/") all.group <- available.packages(contriburl)[, "Package"] names(all.group) <- NULL if (groupName == "all") return(all.group) ## Should never happen stop("unknown groupName ", sQuote(groupName)) } ### OOMPAinstall() version 2.13.0 ### Called by OOMPALite() when R version 2.13 is detected. ### ### Install OOMPA packages using CRAN-style repositories. ### Arguments: ### ### pkgs: character vector of OOMPAonductor packages to install. ### The groupName argument will be ignored if pkgs is specified. ### ### groupName: character matching one of "default", "affy", "graph", "lite", ### "monograph", "all". ### ### repos: the user should not try to pass this argument. It's in the argument list ### of OOMPAinstall() only because we want to raise an error when ### the user tries to pass it. ### ### dependencies: passed to install.packages (see install.packages documentation). ### ### type: passed to install.packages (see install.packages documentation). ### ### ...: extra arguments passed to install.packages (see install.packages documentation). oompainstall <- function(pkgs, groupName="default", repos, dependencies=c("Depends", "Imports"), type=getOption("pkgType"), ...) { ## !!! Always change version number when updating this file !!! VERSION <- "2.13.0" ## R version 2.13 should have been detected by OOMPALite() thisRVer <- paste(R.Version()[c("major", "minor")], collapse=".") cat(paste("Running OOMPAinstall version", VERSION, "with R version", thisRVer, "\n")) stopifnot(require("utils")) cat("Your version of R requires version 2.13 of OOMPA.\n") if (missing(pkgs)) { pkgs <- OOMPAinstallPkgGroups(groupName) cat("Will install the following packages:\n") print(pkgs) cat("Please wait...\n\n") } if (!missing(repos)) stop("You can't pass a 'repos' argument to the 'OOMPAinstall' function\n") repos <- OOMPAinstallRepos() install.packages(pkgs=pkgs, repos=repos, dependencies=dependencies, type=type, ...) }