biocViews/DESCRIPTION0000644000175200017520000000307614710271426015246 0ustar00biocbuildbiocbuildPackage: biocViews Title: Categorized views of R package repositories Description: Infrastructure to support 'views' used to classify Bioconductor packages. 'biocViews' are directed acyclic graphs of terms from a controlled vocabulary. There are three major classifications, corresponding to 'software', 'annotation', and 'experiment data' packages. biocViews: Infrastructure URL: http://bioconductor.org/packages/biocViews BugReports: https://github.com/Bioconductor/biocViews/issues Version: 1.74.0 License: Artistic-2.0 Author: VJ Carey , BJ Harshfield , S Falcon , Sonali Arora, Lori Shepherd Maintainer: Bioconductor Package Maintainer Depends: R (>= 3.6.0) Imports: Biobase, graph (>= 1.9.26), methods, RBGL (>= 1.13.5), tools, utils, XML, RCurl, RUnit, BiocManager Suggests: BiocGenerics, knitr, commonmark, BiocStyle Collate: AllClasses.R AllGenerics.R as-methods.R htmlDoc-methods.R htmlFilename-methods.R htmlValue-methods.R show-methods.R getPackNames.R packageDetails.R pump.R repository.R showvoc.R getPackageNEWS.R validation_tests.R recommendBiocViews.R dump_concept.R VignetteBuilder: knitr git_url: https://git.bioconductor.org/packages/biocViews git_branch: RELEASE_3_20 git_last_commit: d2e3148 git_last_commit_date: 2024-10-29 Repository: Bioconductor 3.20 Date/Publication: 2024-10-29 NeedsCompilation: no Packaged: 2024-10-29 23:43:18 UTC; biocbuild biocViews/MD50000644000175200017520000001070214710271426014042 0ustar00biocbuildbiocbuildb816f328b9ff83e7b3ccfa73f2a9138e *DESCRIPTION 3ed55a65ec9137ca39af3102d45ee251 *NAMESPACE 4f6d9f9d32f6364aff144682f9939143 *NEWS eeb24b530b762096c772b8757fab1f53 *R/AllClasses.R acad5f18cb186a5963853c9ae76417c0 *R/AllGenerics.R 2210a24f37db4560915286fef03d96bc *R/as-methods.R 896899a5d6aa1a2c179f34b041ec9272 *R/dump_concept.R 803c4632eab6b4024d76ca38e2b9b1fd *R/getPackNames.R d2023113a4b81bf3f3dfbd1c08015f06 *R/getPackageNEWS.R a515af99b9ce22e0f0e2022befc25c5d *R/htmlDoc-methods.R fa42f250f450aff5acba2ecd53f4806b *R/htmlFilename-methods.R 9ca8e36f1c72d160410951a68af8d994 *R/htmlValue-methods.R 911a4b43d838678ccf111732c8f26e73 *R/packageDetails.R f55b9e0b12967f6a07892b3154815bd0 *R/pump.R 89194e7bdc2a6553fd755bd95fa80856 *R/recommendBiocViews.R 8062081bbaab86e10677b79c029f0aab *R/repository.R a75ee37b4533544bd7d05094928f3aa1 *R/show-methods.R addc6bc87ad30b3610efd3fdc3022922 *R/showvoc.R fc525d939272c03e161915f26507170b *R/validation_tests.R 6788d731c5e502f8bbf843955ba4111c *README.md ccb9caf8ebe822cff15d695c29f2df70 *build/vignette.rds 79b6b4e4c3f20927c41e8b0878eae2ce *data/biocViewsVocab.rda ce454a2b71efd429137082cb975f79bf *inst/css/package-detail.css.in c0f08c77eb79f3df52e5a5a782a4577d *inst/css/repository-detail.css.in 68333ba900ce8ac4a2247609ee625d9b *inst/doc/HOWTO-BCV.R 7484bcce9169a5d772b6a4a48d38ddbb *inst/doc/HOWTO-BCV.Rmd 0bcbd1d855c7c8cee9fafd12e2bcccc0 *inst/doc/HOWTO-BCV.html 1b311e6ff9dc2958a08e6e239071aa75 *inst/doc/VIEWS 1da56e123fa7796a746a52b1aca4cf4e *inst/doc/createReposHtml.R 4d884b7bcd842f538c379396c6ba0cda *inst/doc/createReposHtml.Rmd b9cc931d0fa0064b001b07a6f7c4489d *inst/doc/createReposHtml.html 3f5d4df7bdbdc68e7e1b9c40c75fdfef *inst/dot/biocViewsVocab.dot 9cc0790080f1005b06433f315001fda4 *inst/extdata/biocViewsVocab.sqlite 04c67de6c0d3d980649f63b3224186b7 *inst/htmlfrags/topfrag.html cb98a881e1ab1e0054860b3f70e2e29f *inst/script/recommend_biocViews_rpacks.R 8ef211cd1c6b8988bae48a67169fdfd7 *inst/script/reviseBiocViews.R 87c819ccaccc710d69a6c03e61efea6b *inst/script/revise_expt_biocViews.R 96bfff8db7096281789c0e513c221e20 *inst/script/revisebiocViews2014.R fd26e82c31efb7605ff0e59fd6222f7c *inst/unitTests/CITATION-tmpl 926af68cdfadc2de74f00d70f1f438ce *inst/unitTests/test_biocViews.R 3c906ac6f0930969355cbbc6adc92d39 *inst/unitTests/test_citations.R 23d3b497013bd29d1868610fe21a326a *man/BiocView-class.Rd 00249aa2a9c226685b458a44e6d6d748 *man/Htmlized-class.Rd 9c381157988420f8b9b61f61b212dfe3 *man/PackageDetail-class.Rd e953ddbea8f6dd98ed41f2346bb55668 *man/RepositoryDetail-class.Rd 09c3baf8d58cb33f43acb946e3eb6e85 *man/biocViews-package.Rd 2102fc80f751533b1d79ff1042146f3b *man/biocViewsVocab.Rd 6eb798204cbec346033d583e2ddb4fda *man/dump_concept.Rd 8ca5946b9b091a2ae43dd63cbf083086 *man/extractManuals.Rd 4dcafa6d30be3e892bc5ceede2b4af29 *man/extractNEWS.Rd 784cff6e5f1d76a35b70671e4fb30e17 *man/extractTopLevelFiles.Rd 9c0603ed639129540b250a54c4754e77 *man/extractVignettes.Rd 2282c548dea798335f518a16985a3989 *man/genReposControlFiles.Rd e41c0cf1271a5a442ab2f05fcf41ebf8 *man/getBiocSubViews.Rd 88e40be747f28a53af1ef239aa082c58 *man/getBiocViews.Rd 3d94982ba9865adb837b966d31c93231 *man/getCurrentbiocViews.Rd 55a0c63adc5702a2f540813265b01913 *man/getPackageNEWS.Rd 97e17524b33baa7d2adf913fdccd50ba *man/getPackageTitles.Rd 61d6a6374f0f4e453c3d19164e13b85b *man/getPacksAndViews.Rd 6a056229231a2395f9cca91c423a987a *man/getSubTerms.Rd fd8217653357321e3fc25bd7b543f559 *man/guessPackageType.Rd 60496441b7c2e121c83a94b76cafff20 *man/htmlDoc.Rd 70a39dc4cff41837aa89cbd7bf980066 *man/htmlFilename.Rd 2f814b51651cda649ae659e75f4077e9 *man/htmlValue.Rd 88f213602126116d0b31fd77f4701ef3 *man/recommendBiocViews.Rd dcd122de8c95cf813bce5790ed9f0b80 *man/recommendPackages.Rd 88ae7f68fa42b31a0b3fbfb2ed6e1715 *man/validation_tests.Rd d1067ceaf00c6e5b0c27e17e9102ba56 *man/writeBiocViews.Rd 7d756dc09b511201d3e4e0e3ae2c778d *man/writeHtmlDoc.Rd 36e76dd4c5bdd12d9da1baabf0b42aab *man/writePackageDetailHtml.Rd 91472adc33911f74862d13782c2f9ddb *man/writeRFilesFromVignettes.Rd 612cf36021b26a86cbf8a0345615d54e *man/writeRepositoryHtml.Rd 476182365dc3bf55bf9c03c106b95b61 *man/writeTopLevelView.Rd 3e0a594419154901077cdd316e3654ec *man/write_REPOSITORY.Rd ea60d27a3e7ea8a30ed95b18595822dc *man/write_SYMBOLS.Rd affa043abedd11633dde784ae1952043 *man/write_VIEWS.Rd d773e20202acd3444b44760289e02a41 *tests/runTests.R 87276cfd72a0f8e6080110bac86422a4 *updateVocab.sh 7484bcce9169a5d772b6a4a48d38ddbb *vignettes/HOWTO-BCV.Rmd 4d884b7bcd842f538c379396c6ba0cda *vignettes/createReposHtml.Rmd biocViews/NAMESPACE0000644000175200017520000000330114710217211014736 0ustar00biocbuildbiocbuildimport(methods) importMethodsFrom(graph, acc, adj, edges, inEdges, nodes, subGraph) importFrom(Biobase, copySubstitute) importFrom(RBGL, sp.between) importFrom(tools, write_PACKAGES, package_dependencies) importFrom(BiocManager, repositories) importFrom(stats, complete.cases, setNames) importFrom(utils, download.file, Stangle, available.packages, capture.output, contrib.url, data, file_test, head, packageDescription, readCitationFile, untar) importMethodsFrom(XML, saveXML) importFrom(XML, xmlNode, xmlOutputDOM, xmlTree, htmlParse, xpathApply, xmlValue) importFrom(RCurl, getURL) importFrom(RUnit, checkTrue) exportClasses("Htmlized", "PackageDetail", "pdAuthorMaintainerInfo", "pdVignetteInfo", "pdDownloadInfo", "pdDetailsInfo", "pdDescriptionInfo", "pdVigsAndDownloads", "RepositoryDetail", "rdPackageTable", "BiocView", "bvTitle", "bvPackageTable", "bvSubViews", "bvParentViews") exportMethods("coerce", "show", "htmlDoc", "htmlValue", "htmlFilename") export("writeBiocViews", "getBiocViews", "write_VIEWS", "write_REPOSITORY", "genReposControlFiles", "extractVignettes", "extractManuals", "extractCitations", "getCurrentbiocViews", "extractNEWS", "extractHTMLDocuments", "extractTopLevelFiles", "writeRepositoryHtml", "writePackageDetailHtml", "getSubTerms", "getBiocSubViews", "validate_bioc_views", "writeTopLevelView", "writeHtmlDoc", "write_SYMBOLS", "writeRFilesFromVignettes", "getPackageNEWS", "printNEWS","recommendBiocViews", "recommendPackages", "guessPackageType", "dump_concept") biocViews/NEWS0000644000175200017520000000502514710217211014223 0ustar00biocbuildbiocbuildCHANGES IN VERSION 1.67.0 ------------------------- ENHANCEMENT o (1.67.1) Add biocViews term WorkflowManagement o (1.67.3) Add biocViews term LongRead CHANGES IN VERSION 1.65.0 ------------------------- ENHANCEMENT o (1.65.4) Change to allow Mac ARM64 binaries o (1.65.2) Convert Sweave vignettes to Rmd o (1.65.2) Add .gitignore CHANGES IN VERSION 1.63.0 ------------------------- BUG FIX o (1.63.1) Fix bug with Authors@R parsing for making VIEWS CHANGES IN VERSION 1.61.0 ------------------------- ENHANCEMENT o (1.61.1) Added Spatial, SpatialData, SpatialWorkflow to distinguish from SigleCell CHANGES IN VERSION 1.59.0 ------------------------- ENHANCEMENT o (1.57.3) Add biocViews term DifferentialDNA3DStructure o (1.57.2) Add CRAN packages to reverse dependency list o (1.57.1) Add biocViews term Chlamydomonas_reinhardtii CHANGES IN VERSION 1.57.0 ------------------------- NEW FEATURES o (1.57.5) New views AnnotationHubSoftware and ExperimentHubSoftware BUG FIX o (1.57.4) In NEWS generation, fix formatting. o (1.57.1) In VIEWS generation fix but with vignetteTitles. When combinding different format types could potentially remove vignette titles that ended with "RNA,". Do strict start of and end of string check for formatting. CHANGES IN VERSION 1.55.0 ------------------------- NEW FEATURES o (1.55.2) printNEWS and getPackageDescriptions now have argument option 'relativeLink` that allows for relative links instead of hard coded urls for website. Important for release announcement. BUG FIX o (1.55.1) If new package fails to build still include in release announcement and don't fail out for lack of version number. CHANGES IN VERSION 1.51.11 ------------------------- NEW FEATURES o (1.51.7) Cross check views with manifest file so all expected bioconductor package get listed in biocViews. New argument to write_VIEWS manifestFile o (1.51.9) New argument to write_VIEWS meatPath. For packages that fail to build on any platform, use cloned repository DESCRIPTION file to fill in as much information to the biocVIEWS entry. o (1.51.10) Add new biocVIEW terms ImmunoOncolocy and ImmunoOncologyWorkflow. o (1.51.12) Allow NEWS file to be in .md format. R 3.6 started allowing NEWS, NEWS.Rd and newly NEWS.md formats. Adjust code accordingly. CHANGES IN VERSION 1.37.2 ------------------------- NEW FEATURES o Add new function recommendPackages for finding packages tagged with a set of biocViews. biocViews/R/0000755000175200017520000000000014710217211013723 5ustar00biocbuildbiocbuildbiocViews/R/AllClasses.R0000644000175200017520000000615214710217211016100 0ustar00biocbuildbiocbuild## TODO: make the reposInfo list into an S4 class to represent ## repository data setClass("Htmlized", representation("VIRTUAL")) setClass("PackageDetail", contains="Htmlized", representation("Package"="character", "Version"="character", "Title"="character", "Description"="character", "Author"="character", "Maintainer"="character", "Depends"="character", "Imports"="character", "Suggests"="character", "SystemRequirements"="character", "License"="character", "URL"="character", "biocViews"="character", "vignettes"="character", "vignetteScripts"="character", "vignetteTitles"="character", "htmlTitles"="character", "source.ver"="character", "win.binary.ver"="character", "mac.binary.ver"="character", "mac.binary.mavericks.ver"="character", "mac.binary.el-capitan.ver"="character", "downloadStatsUrl"="character", "manuals"="character", "dependsOnMe"="character", "importsMe"="character", "suggestsMe"="character", "functionIndex"="character", "reposFullUrl"="character", "reposRoot"="character", "viewRoot"="character", "devHistoryUrl"="character", "Archs"="character")) ## Define a subclass of PackageDetail for each "chunk" of the object ## that we want to be able to render to HTML separately. setClass("pdAuthorMaintainerInfo", contains="PackageDetail") setClass("pdVignetteInfo", contains="PackageDetail") setClass("pdDownloadInfo", contains="PackageDetail") setClass("pdDetailsInfo", contains="PackageDetail") setClass("pdDescriptionInfo", contains="PackageDetail") setClass("pdVigsAndDownloads", contains="PackageDetail") setClass("RepositoryDetail", contains="Htmlized", representation(Title="character", reposRoot="character", homeUrl="character", htmlDir="character", packageList="list")) setClass("rdPackageTable", contains="RepositoryDetail") setClass("BiocView", contains=c("RepositoryDetail"), representation(name="character", subViews="character", parentViews="character")) setClass("bvTitle", contains="BiocView") setClass("bvPackageTable", contains="BiocView") setClass("bvSubViews", contains="BiocView") setClass("bvParentViews", contains="BiocView") ## Outline ## 1. given a repos with VIEWS file, run extractVignettes. ## 2. Now get a pkgList using loadPackageDetails() ## 3. write HTML biocViews/R/AllGenerics.R0000644000175200017520000000036114710217211016236 0ustar00biocbuildbiocbuildsetGeneric("htmlDoc", function(object, ...) standardGeneric("htmlDoc")) setGeneric("htmlValue", function(object) standardGeneric("htmlValue")) setGeneric("htmlFilename", function(object, ...) standardGeneric("htmlFilename")) biocViews/R/as-methods.R0000644000175200017520000000016314710217211016112 0ustar00biocbuildbiocbuildsetAs("BiocView", "rdPackageTable", function(from) { as(as(from, "RepositoryDetail"), "rdPackageTable") }) biocViews/R/dump_concept.R0000644000175200017520000000115014710217211016523 0ustar00biocbuildbiocbuild#' produce character stream for use with Protege entities/class hierarchy ingestion #' based on biocViews subgraphs #' @param x character(1) name of a node in the biocViewsVocab graph #' @param edob a list as produced by graph::edges #' @return a character atom with x abutting left and edge targets tab-indented #' @examples #' cat(substring(dump_concept("ResearchField"), 1, 152), "\n") #' @export dump_concept = function (x, edob = edges(biocViewsVocab)) { data("biocViewsVocab", package = "biocViews") paste(x, "\n\t", paste(edob[[x]], collapse = "\n\t"), collapse = "\n\t", "\n", sep = "") } biocViews/R/getPackNames.R0000644000175200017520000002316114710217211016413 0ustar00biocbuildbiocbuild## FIXME this is really dumb as does not ## use the information in VIEWS (VignetteBuilder field) myStangle <- function(file) { oldwd <- setwd(dirname(file)) on.exit(setwd(oldwd)) bfile <- basename(file) tryCatch(Stangle(bfile), error=function(e){ if (file.exists(bfile) && grepl("\\.Rnw$", bfile, ignore.case=TRUE)) { rfile <- sub("\\.Rnw$", ".R", bfile, ignore.case=TRUE) if (file.exists(rfile)) unlink(rfile) if (!requireNamespace("knitr")) { stop("'knitr' package required to tangle knitr vignettes") } tryCatch(knitr::purl(bfile),error=function(e){ print(sprintf("Error purling %s!", bfile)) }) } }) } readPackageInfo <- function(file, fields = NULL, all = FALSE) { info <- read.dcf(file = file, fields = fields, all = all) if ("vignettes" %in% colnames(info)) { info <- cbind(info, "vignetteScripts" = unlist(lapply(strsplit(info[,"vignettes"], ",\n"), function(vigs) { paste(lapply(sub("pdf$", "Rnw", vigs), function(v) { if (file.exists(v) && (!file.info(v)$isdir)) { myStangle(v) rfile <- sub("Rnw$", "R", basename(v)) file.copy(rfile, dirname(v), overwrite = TRUE) file.remove(rfile) sub("Rnw$", "R", v) } else { v <- sub("Rnw$", "rnw", v) if (file.exists(v) && (!file.info(v)$isdir)) { myStangle(v) rfile <- sub("rnw$", "R", basename(v)) file.copy(rfile, dirname(v), overwrite = TRUE) file.remove(rfile) sub("rnw$", "R", v) } else "" } }), collapse = ",\n") })), "vignetteTitles" = unlist(lapply(strsplit(info[,"vignettes"], ",\n"), function(vigs) { paste(lapply(sub("pdf$", "Rnw", vigs), function(v) { if (file.exists(v)) tools:::vignetteInfo(v)[["title"]] else { v <- sub("Rnw$", "rnw", v) if (file.exists(v)) tools:::vignetteInfo(v)[["title"]] else sub("rnw$", "pdf", basename(v)) } }), collapse = ",\n") }))) } ## TODO: make the 'manuals' path configurable if ("Package" %in% colnames(info)) { info <- cbind(info, "manuals" = unlist(lapply(info[,"Package"], function(pkg) { man <- file.path("manuals", pkg, "man", paste(pkg, ".pdf", sep = "")) if (file.exists(man)) man else NA_character_ }))) } info } writeBiocViews <- function(bvList, dir, backgroundColor="transparent") { ## bvList is a list of BiocViews objects ## dir is the output directory in which to write the views. for (bv in bvList) { fn <- file.path(dir, htmlFilename(bv)) html <- htmlDoc(bv) writeHtmlDoc(html, fn) } ## copy the css cssName <- "repository-detail.css" cssPath <- system.file(file.path("css", paste(cssName, ".in", sep="")), package="biocViews") res <- try(copySubstitute(cssPath, file.path(dir, cssName), symbolValues=list("BACKGROUND_COLOR"=backgroundColor)), silent=TRUE) res } writeTopLevelView <- function(dir, vocab) { top <- getRootNode(vocab) mainSubViews <- edges(vocab)[[top]] topView <- new("BiocView", name=top, subViews=mainSubViews) fn <- file.path(dir, htmlFilename(topView)) writeHtmlDoc(htmlDoc(topView), fn) } getBiocViews <- function(reposUrl, vocab, defaultView, local=FALSE, htmlDir="") { viewList <- getPacksAndViews(reposUrl, vocab, defaultView, local) viewRoster <- permulist(viewList$views, vocab) if (local) { reposUrl <- character(0) if (!htmlDir == "") { htmlDir <- htmlDir } } biocViews <- loadViews(vocab, viewRoster, viewList$pkgList, reposUrl, htmlDir) biocViews } getBiocSubViews <- function(reposUrl, vocab, topTerm, local=FALSE, htmlDir="") { root <- getRootNode(vocab) terms <- getSubTerms(vocab, topTerm) subVocab <- subGraph(c(root, terms), vocab) bvl <- getBiocViews(reposUrl, subVocab, topTerm, local, htmlDir) bvl[terms] ## exclude root } loadViews <- function(viewGraph, viewRoster, pkgList, reposUrl, htmlDir="html") { views <- nodes(viewGraph) viewmat <- as(viewGraph, "matrix") viewFactory <- function(name) { subViews <- viewmat[name, ] == 1 if (any(subViews)) subViews <- views[subViews] else subViews <- character(0) parentViews <- viewmat[ , name] == 1 if (any(parentViews)) parentViews <- views[parentViews] else parentViews <- character(0) if (name %in% names(viewRoster)) { pkgsInView <- pkgList[viewRoster[[name]]] } else pkgsInView <- list() new("BiocView", name=name, subViews=subViews, parentViews=parentViews, packageList=pkgsInView, htmlDir=htmlDir, reposRoot=reposUrl) } biocViews <- lapply(views, viewFactory) names(biocViews) <- views biocViews } getPacksAndViews <- function(reposURL, vocab, defaultView, local=FALSE) { tmpf <- tempfile() on.exit(unlink(tmpf)) method <- "auto" ## FIXME: needs error checking and to look for VIEWS.gz first z <- download.file(url=paste(reposURL, "VIEWS", sep="/"), destfile=tmpf, method=method, cacheOK=FALSE, quiet=TRUE, mode="wb") pmat <- readPackageInfo(file=tmpf) bcvl <- pkgList <- vector(mode="list", length=nrow(pmat)) if (nrow(pmat) == 0L) return(list(views=bcvl, pkgList=pkgList)) ns <- pmat[,"Package"] ## The DESCRIPTION fields we try to parse for tags DESC_FIELDS <- c("biocViews") names(bcvl) <- ns for (tagCol in DESC_FIELDS) { if (tagCol %in% colnames(pmat)) { tags <- pmat[, tagCol] names(tags) <- ns bcvl <- processTagsField(tags, bcvl, defaultView) } } ## In case none of the fields were available, make sure everyone ## gets a NoViewsProvided tag. bcvl <- lapply(bcvl, function(x) { if (is.null(x)) defaultView else x }) bcvl <- normalizeTags(bcvl, vocab) if (!local) pkgList <- createPackageDetailList(pmat, reposURL) else pkgList <- createPackageDetailList(pmat) list(views=bcvl, pkgList=pkgList) } normalizeTags <- function(tagList, vocab) { ## try to match tags to the vocab ignoring case. ## If found, replace with case as found in vocab. knownTerms <- nodes(vocab) knownTermsLower <- tolower(knownTerms) tagList <- lapply(tagList, function(x) { idx <- match(tolower(x), knownTermsLower) unknown <- is.na(idx) if (any(unknown)) { warning("Dropping unknown biocViews terms:\n", paste(x[unknown], collapse=", "), call.=FALSE) idx <- idx[!is.na(idx)] } knownTerms[unique(idx)] ## remove duplicates }) tagList } processTagsField <- function(tags, tagList, defaultTag) { ## Given a named character vector of comma separated tags, ## parse the tags and append data to the given tagList. ## Names of tags and tagList must match. if (!all.equal(names(tags), names(tagList))) stop("Names of tags and tagList must match") tags[is.na(tags)] <- defaultTag tags <- gsub("\\\n","",tags) fieldSp <- strsplit(tags, ", *") names(fieldSp) <- names(tagList) for (n in names(tagList)) { tagList[[n]] <- c(tagList[[n]], fieldSp[[n]]) } tagList } getSubTerms <- function(dag, term) { c(term, names(acc(dag, term)[[1]])) } permulist <- function(allv, vocab, interp=TRUE) { if (length(allv) == 0L) return(list()) lens <- sapply(allv, length) packnames <- names(allv) repp <- rep(packnames, lens) ans <- split(repp, unlist(allv)) if (interp) ans <- pump(ans, vocab) return(ans) } biocViews/R/getPackageNEWS.R0000644000175200017520000002230314710217211016576 0ustar00biocbuildbiocbuild.msg <- function(fmt, ..., width=getOption("width")) ## Use this helper to format all error / warning / message text { strwrap(sprintf(fmt, ...), width=width, exdent=4) } ## collate package NEWS files using starting version number in ## prevRepos, and membership in currRepos as references. Package ## source tree rooted at srcDir, possibiblly as tarred files # repo: bioc data/experiment workflows getPackageNEWS <- function(prevRepos="3.6", currRepos="3.7", repo=c("bioc", "data/experiment", "workflows"), srcdir=NULL){ repo <- match.arg(repo) URL_BASE <- "http://master.bioconductor.org/packages/" VIEWS <- "%s%s/%s/VIEWS" prevUrl <- url(sprintf(VIEWS, URL_BASE, prevRepos, repo)) prev <- read.dcf(prevUrl, fields=c("Package", "Version")) rownames(prev) <- prev[,1] close(prevUrl) currUrl <- url(sprintf(VIEWS, URL_BASE, currRepos, repo)) curr <- read.dcf(currUrl, fields=c("Package", "Version")) rownames(curr) <- curr[,1] close(currUrl) prev <- prev[rownames(prev) %in% rownames(curr),] newpkgs <- setdiff(rownames(curr), rownames(prev)) idx <- package_version(curr[newpkgs, "Version"], strict=FALSE) >= "0.99.0" newpkgs <- newpkgs[idx] vers <- c(sub("\\.[[:digit:]]?$", ".0", prev[,"Version"]), setNames(rep("0.0", length(newpkgs)), newpkgs)) if (is.null(srcdir)){ temp = tempdir() system(paste0("scp -r webadmin@master.bioconductor.org:/extra/www/bioc/packages/", currRepos, "/", repo, "/news ", temp)) srcdir <- paste0(temp, "/news") } getNews <- function(pkg, ver, srcdir) { newsloc <- file.path(srcdir, pkg, c("inst", "inst", "inst", ".","."), c("NEWS.Rd", "NEWS", "NEWS.md", "NEWS.md", "NEWS")) news <- head(newsloc[file.exists(newsloc)], 1) if (0L == length(news)) return(NULL) tryCatch({ db <- if (grepl("Rd$", news)){ tools:::.build_news_db_from_package_NEWS_Rd(news) } else if (grepl("md$", news)){ tools:::.build_news_db_from_package_NEWS_md(news) } else { tools:::.news_reader_default(news) } if (!is.null(db)) utils::news(Version > ver, db=db) else NULL }, error=function(...) NULL) } ret <- Filter(function(x) !is.null(x) && 0L != nrow(x), Map(getNews, names(vers), vers, srcdir)) nms <- names(ret) s <- sort(nms) newRet <- ret[s] } ## based on tools:::.build_news_db() getNEWSFromFile <- function (dir, destfile, format = NULL, reader = NULL, output=c("md", "text")) { mdIfy <- function(txt) { lines <- strsplit(txt, "\n") segs <- lines[[1]] segs <- sub("^ o +", "- ", segs) segs <- sub("^\t", " ", segs) return(paste(segs, collapse="\n")) } newsRdFile <- file.path(dir, "NEWS.Rd") ## should never be found newsRdFile2 <- file.path(dir, "inst", "NEWS.Rd") if (!file_test("-f", newsRdFile) && !file_test("-f", newsRdFile2)) { newsMdFile <- file.path(dir, "NEWS.md") newsMdFile2 <- file.path(dir, "inst", "NEWS.md") if (!file_test("-f", newsMdFile) && !file_test("-f", newsMdFile2)) { nfile <- file.path(dir, "NEWS") nfile2 <- file.path(dir, "inst", "NEWS") if (!file_test("-f", nfile) && !file_test("-f", nfile2)) return(invisible()) nfile <- ifelse(file_test("-f", nfile), nfile, nfile2) if (!is.null(format)) .NotYetUsed("format", FALSE) if (!is.null(reader)) .NotYetUsed("reader", FALSE) file <- file(destfile, "w+") on.exit(close(file)) news <- paste(readLines(nfile), collapse="\n") if ("md" == output) news = mdIfy(news) cat(news, file=file) return(invisible()) } newsMdFile <- ifelse(file_test("-f", newsMdFile), newsMdFile, newsMdFile2) file <- file(destfile, "w+") on.exit(close(file)) db <- tools:::.build_news_db_from_package_NEWS_md(newsMdFile) news <- NULL try(news <- capture.output(print(db))) if (is.null(news)) { message(sprintf("Error building news database for %s/%s", dir, destfile)) return(invisible()) } news <- paste(news, collapse="\n") if ("md" == output) news <- mdIfy(news) cat(news, file=file) return(invisible()) } newsRdFile <- ifelse(file_test("-f", newsRdFile), newsRdFile, newsRdFile2) file <- file(destfile, "w+") on.exit(close(file)) db <- tools:::.build_news_db_from_package_NEWS_Rd(newsRdFile) news <- NULL try(news <- capture.output(print(db))) if (is.null(news)) { message(sprintf("Error building news database for %s/%s", dir, destfile)) return(invisible()) } news <- paste(news, collapse="\n") if ("md" == output) news <- mdIfy(news) cat(news, file=file) return(invisible()) } printNEWS <- function(dbs, destfile, overwrite=FALSE, width=68, output=c("md", "text"), relativeLink=FALSE, ...) { output <- match.arg(output) dbs <- lapply(dbs, function(db) { db[["Text"]] <- sapply(db[["Text"]], function(elt) { elt <- unlist(strsplit(elt, "\n")) paste(strwrap(elt, width=options()[["width"]] - 10), collapse="\n") }) db }) urlBase <- ifelse(relativeLink, "/packages/","https://bioconductor.org/packages/") txt <- capture.output({ for (i in seq_along(dbs)) { tryCatch({ cat(sprintf( "\n[%s](%s%s)\n%s\n\n", names(dbs)[[i]], urlBase, names(dbs)[[i]], paste(rep("-", nchar(names(dbs)[[i]])), collapse=""))) print(dbs[[i]]) }, error=function(err) { warning("print() failed for ", sQuote(names(dbs)[[i]]), immediate.=TRUE, call.=FALSE) }) } }) if ("md" == output) { txt <- sub("^ o ", "-", txt) txt <- sub("^\t", " ", txt) } if (!is(destfile, "connection")) { if (file.exists(destfile) && !overwrite) stop(.msg("'%s' exists and overwrite=FALSE", destfile)) file <- file(destfile, "w+") on.exit(close(file)) } else file = destfile writeLines(txt, file) } # manifest: software.txt data-experiment.txt workflows.txt # status: new or removed getPackageTitles <- function(prevBranch="RELEASE_3_6", currBranch="devel", manifest=c("software.txt", "data-experiment.txt", "workflows.txt", "data-annotation.txt", "books.txt"), status = c("new", "removed")){ manifest <- match.arg(manifest) status <- match.arg(status) GIT_ARCHIVE <- "git archive --remote=ssh://git@git.bioconductor.org/admin/manifest %s %s | tar -xO" prevRepo <- system(sprintf(GIT_ARCHIVE, prevBranch, manifest), intern=TRUE) prevRepo <- trimws(gsub(pattern = "Package: ", replacement="", prevRepo[-which(prevRepo=="")])) currRepo <- system(sprintf(GIT_ARCHIVE, currBranch, manifest), intern=TRUE) currRepo <- trimws(gsub(pattern = "Package: ", replacement="", currRepo[-which(currRepo=="")])) # switch statement pkgs <- switch(status, new = setdiff(currRepo, prevRepo), removed = setdiff(prevRepo, currRepo) ) pkgs } printNewPackageTitles <- function(titles, destfile, overwrite=FALSE) { if (!is(destfile, "connection")) { if (file.exists(destfile) && !overwrite) stop(.msg("'%s' exists and overwrite=FALSE", destfile)) file <- file(destfile, "w+") on.exit(close(file)) } else file = destfile cat(strwrap(sprintf("\n- %s: %s", names(titles), titles), width=70, exdent=2), file=stdout(), sep="\n") } getPackageDescriptions <- function(pkgs, outfile, output=c("md", "text"),relativeLink=FALSE) { output <- match.arg(output) if (output == "text") exdent = 4 else exdent = 2 plower <- tolower(pkgs) names(plower) <- pkgs pkgs <- names(sort(plower)) file <- tempfile() DESC_FILE <- "git archive --remote=ssh://git@git.bioconductor.org/packages/%s devel DESCRIPTION|tar -xO > %s" urlBase <- ifelse(relativeLink, "/packages/","https://bioconductor.org/packages/") desc = lapply(pkgs, function(pkg) { system(sprintf(DESC_FILE, pkg, file)) d = read.dcf(file)[,"Description"] paste(strwrap(sprintf("- [%s](%s%s) %s", pkg, urlBase, pkg, d), width=70, exdent=exdent), collapse="\n") }) cat(noquote(unlist(desc)), sep="\n\n", file=outfile) invisible(NULL) } biocViews/R/htmlDoc-methods.R0000644000175200017520000000461014710217211017102 0ustar00biocbuildbiocbuildmakeHtmlHeader <- function(title, stylesheet) { ## Right now xmlTree's addNode method doesn't accept XMLNode objects ## html <- xmlTree("html", ## attrs=c(xmlns="http://www.w3.org/1999/xhtml", ## "xml:lang"="en", lang="en"), ## dtd=c('html', ## '-//W3C//DTD XHTML 1.0 Strict//EN', ## 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd')) html <- xmlOutputDOM("html", attrs=c(xmlns="http://www.w3.org/1999/xhtml", "xml:lang"="en", lang="en")) ### gaah! header is only supported by xmlOutputBuffer ! :-( ### so instead we write out the DOCTYPE in the writeDoc method. ## header=paste('')) html$addTag("head", close=FALSE) html$addTag("title", title) myAttrs <- c(rel="stylesheet", type="text/css", href=stylesheet) html$addTag("link", attrs=myAttrs) html$closeTag() html } setMethod("htmlDoc", signature(object="Htmlized"), function(object, ..., title, stylesheet="style.css") { dom <- makeHtmlHeader(title, stylesheet) dom$addTag("body", close=FALSE) dom$addNode(htmlValue(object)) dom$closeTag() dom$value() }) setMethod("htmlDoc", signature(object="PackageDetail"), function(object, ...) { title <- object@Package stylesheet="package-detail.css" callNextMethod(object=object, title=title, stylesheet=stylesheet) }) setMethod("htmlDoc", signature(object="RepositoryDetail"), function(object, ...) { title <- object@Title stylesheet="repository-detail.css" callNextMethod(object=object, title=title, stylesheet=stylesheet) }) setMethod("htmlDoc", signature(object="BiocView"), function(object, ...) { title <- paste("Bioconductor Task View", object@name) stylesheet="repository-detail.css" callNextMethod(object=object, title=title, stylesheet=stylesheet) }) biocViews/R/htmlFilename-methods.R0000644000175200017520000000101014710217211020104 0ustar00biocbuildbiocbuildsetMethod("htmlFilename", signature(object="character"), function(object) paste(object, ".html", sep="")) setMethod("htmlFilename", signature(object="RepositoryDetail"), function(object) "index.html") setMethod("htmlFilename", signature(object="BiocView"), function(object) { paste(object@name, ".html", sep="") }) setMethod("htmlFilename", signature(object="PackageDetail"), function(object) { htmlFilename(object@Package) }) biocViews/R/htmlValue-methods.R0000644000175200017520000004343714710217211017463 0ustar00biocbuildbiocbuildwriteHtmlDoc <- function(html, file) { ## Temporary fix: we open and close 'file' here instead of passing it ## directly to saveXML because of a bug in current XML::saveXML ## (from XML 1.3-2). Bug reported to XML's author on 2006-12-14. Herve. f <- file(file, open="w") ## another temp fix: write the DOCTYPE header here, perhaps we should ## use prefix for this in the call to saveXML? writeLines(paste(''), con=f) saveXML(html, f, prefix="") close(f) } tableHelper <- function(tableData, table.attrs) { dom <- xmlOutputDOM("table", attrs=table.attrs) odd <- TRUE for (fld in names(tableData)) { rowClass <- if(odd) "row_odd" else "row_even" odd <- !odd dom$addTag("tr", attrs=c(class=rowClass), close=FALSE) dom$addTag("th", fld) dom$addTag("td", tableData[[fld]]) dom$closeTag() } dom$closeTag() ## end details table dom$value() } cleanText <- function(text) { text <- gsub("&([a-zA-Z0-9#]+;)", "@_@_@\\1", text) text <- gsub("&", "&", text, fixed=TRUE) text <- gsub("@_@_@([a-zA-Z0-9#]+;)", "&\\1", text) text <- gsub("<", "<", text, fixed=TRUE) text <- gsub(">", ">", text, fixed=TRUE) text } setMethod("htmlValue", signature(object="rdPackageTable"), function(object) { dom <- xmlOutputDOM("table", attrs=c(class="repos_index")) odd <- TRUE alphaOrder <- order(tolower(names(object@packageList))) dom$addTag("tr", close=FALSE) dom$addTag("th", "Package") dom$addTag("th", "Maintainer") dom$addTag("th", "Title") dom$closeTag() for (pkg in object@packageList[alphaOrder]) { rowClass <- if(odd) "row_odd" else "row_even" odd <- !odd dom$addTag("tr", attrs=c(class=rowClass), close=FALSE) dom$addTag("td", attrs=c(class="package"), close=FALSE) if (length(object@reposRoot) > 0) root <- paste(object@reposRoot, object@htmlDir, sep="/") else root <- object@htmlDir infoPage <- paste(root, htmlFilename(pkg), sep="/") dom$addTag("a", attrs=c(href=infoPage), pkg@Package) dom$closeTag() dom$addTag("td", removeEmail(pkg@Maintainer), attrs=c(class="maintainer")) dom$addTag("td", pkg@Title, attrs=c(class="title")) dom$closeTag() ## end tr } dom$value() }) setMethod("htmlValue", signature(object="RepositoryDetail"), function(object) { dom <- xmlOutputDOM("div", attrs=c(class="RepositoryDetail")) dom$addTag("h1", cleanText(object@Title)) ## Package table pkgTable <- as(object, "rdPackageTable") dom$addNode(htmlValue(pkgTable)) dom$value() }) setMethod("htmlValue", signature(object="pdAuthorMaintainerInfo"), function(object) { dom <- xmlOutputDOM("table", attrs=c(class="author_info")) dom$addTag("tr", close=FALSE) dom$addTag("td", "Author") dom$addTag("td", cleanText(removeEmail(object@Author))) dom$closeTag() dom$addTag("tr", close=FALSE) dom$addTag("td", "Maintainer") dom$addTag("td", cleanText(removeEmail(object@Maintainer))) dom$closeTag() dom$value() }) setMethod("htmlValue", signature(object="pdVignetteInfo"), function(object) { dom <- xmlOutputDOM("table", attrs=c(class="vignette")) odd <- TRUE rowClass <- "row_odd" if (length(object@vignettes) > 0) { vignetteTitles <- ifelse(nzchar(object@vignetteTitles), object@vignetteTitles, basename(object@vignettes)) for (i in order(vignetteTitles)) { rowClass <- if(odd) "row_odd" else "row_even" dom$addTag("tr", attrs=c(class=rowClass), close=FALSE) dom$addTag("th", vignetteTitles[i]) dom$addTag("td", close=FALSE) pdflink <- paste(object@reposRoot, object@vignettes[i], sep="/") dom$addTag("a", "PDF", attrs=c(href=pdflink)) dom$closeTag() if (nchar(object@vignetteScripts[i]) > 0) { dom$addTag("td", close=FALSE) Rlink <- paste(object@reposRoot, object@vignetteScripts[i], sep="/") dom$addTag("a", "R Script", attrs=c(href=Rlink)) dom$closeTag() } dom$closeTag() ## end tr odd <- !odd } } else { dom$addTag("tr", attrs=c(class=rowClass), close=FALSE) dom$addTag("td", "No vignettes available") dom$closeTag() odd <- !odd } rowClass <- if(odd) "row_odd" else "row_even" if (length(object@manuals) > 0 && !is.na(object@manuals[1])) { dom$addTag("tr", attrs=c(class=rowClass), close=FALSE) dom$addTag("td", close=FALSE) mlink <- paste(object@reposRoot, object@manuals[1], sep="/") dom$addTag("a", "Reference Manual", attrs=c(href=mlink)) dom$closeTag() dom$closeTag() ## end tr odd <- !odd } else { dom$addTag("tr", attrs=c(class=rowClass), close=FALSE) dom$addTag("td", "No reference manual available") dom$closeTag() odd <- !odd } dom$value() }) setMethod("htmlValue", signature(object="pdDownloadInfo"), function(object) { flds <- c(source="source.ver", win.binary="win.binary.ver", mac.binary="mac.binary.ver", mac.binary.mavericks="mac.binary.mavericks.ver", `mac.binary.el-capitan`="mac.binary.el-capitan.ver") fileTypes <- list(source="Package source", win.binary="Windows 32-bit binary", mac.binary="macOS 10.13 (High Sierra) binary", mac.binary.mavericks="MacOS X 10.9 (Mavericks) binary", `mac.binary.el-capitan`="MacOS X 10.11 (El Capitan) binary") makeLinkHelper <- function(type) { isAvailable = TRUE archs <- slot(object, "Archs") if (length(archs) > 0 && nchar(archs) > 0) { if (type == "win.binary") { if (length(grep("i386", archs, value=TRUE)) == 0) { isAvailable = FALSE } } } pkgPath <- slot(object, flds[type]) if (isAvailable && !is.na(pkgPath) && length(pkgPath) > 0 && pkgPath != "") { ref <- paste(object@reposRoot, pkgPath, sep="/") aTag <- xmlNode("a", basename(pkgPath), attrs=c(href=ref)) } else { aTag <- "Not Available" } aTag } fileLinks <- lapply(names(fileTypes), makeLinkHelper) names(fileLinks) <- fileTypes downloadStatsUrl <- slot(object, "downloadStatsUrl") if ((length(downloadStatsUrl) == 1) && (nchar(downloadStatsUrl) > 0)) { fileLinks <- c(fileLinks, list("Package Downloads Report" = xmlNode("a", "Downloads Stats", attrs=c(href=paste(downloadStatsUrl, "/", slot(object, "Package"), ".html", sep=""))))) } domValue <- tableHelper(fileLinks, table.attrs=list(class="downloads")) domValue }) setMethod("htmlValue", signature(object="pdDetailsInfo"), function(object) { ## link generating functions buildLinks <- function(x, root, class, check = FALSE) { nodes <- lapply(x, function(y) { urlError <- FALSE if (nchar(y) == 0 || length(root) == 0) { urlError <- TRUE } else { if (check) { oldWarn <- options()[["warn"]] options(warn = -1) for (i in seq_len(length(root))) { link <- paste(root[i], "/", y, ".html", sep="") con <- try(url(link, "r"), silent = TRUE) if (class(con)[[1]] != "try-error") break; } options(warn = oldWarn) if (class(con)[[1]] == "try-error") { urlError <- TRUE } else { close(con) } } else { link <- paste(root[1], "/", y, ".html", sep="") } } if (urlError) { node <- y } else { node <- xmlNode("a", y, attrs=c(href=link)) } return(node) }) if (length(nodes) == 0) { args <- list() } else if (length(nodes) == 1) { args <- nodes } else { args <- vector("list", 2*length(nodes) - 1) args[seq(1, 2*length(nodes) - 1, by = 2)] <- nodes args[seq(2, 2*(length(nodes) - 1), by = 2)] <- list(", ") } args <- c(list(name = "div"), args, list(attrs = c(class=class))) return(do.call(xmlNode, args)) } buildViewLinks <- function(x) buildLinks(x, object@viewRoot, class="views") buildPkgLinks <- function(x) buildLinks(x, paste(object@reposFullUrl, "/html", sep=""), class="packages", check=TRUE) buildURLLink <- function(u) { if (!length(u) || nchar(u) == 0) node <- "" else node <- xmlNode("a", u, attrs=c(href=u)) return(node) } ## create list elements for fields flds <- c("biocViews"="biocViews", "Depends"="Depends", "Imports"="Imports", "Suggests"="Suggests", "System Requirements"="SystemRequirements", "License"="License", "URL"="URL", "Depends On Me"="dependsOnMe", "Imports Me"="importsMe", "Suggests Me"="suggestsMe", "Development History"="devHistoryUrl") tableDat <- vector("list", length = length(flds)) names(tableDat) <- flds ## add biocViews info tableDat[["biocViews"]] <- buildViewLinks(object@biocViews) ## add Depends, Imports, Suggests, dependsOnMe, importsMe, suggestsMe pkgFlds <- c("Depends", "Imports", "Suggests", "dependsOnMe", "importsMe", "suggestsMe") tableDat[pkgFlds] <- lapply(pkgFlds, function(x) buildPkgLinks(slot(object, x))) ## add SystemRequirements and License info otherFlds <- c("SystemRequirements", "License") tableDat[otherFlds] <- lapply(otherFlds, function(x) paste(slot(object, x), collapse=", ")) ## add URL info tableDat[["URL"]] <- buildURLLink(object@URL) ## add development history devHistoryUrl <- object@devHistoryUrl if ((length(devHistoryUrl) == 1) && (nchar(devHistoryUrl) > 0)) { tableDat[["devHistoryUrl"]] <- xmlNode("a", "Bioconductor Changelog", attrs=c(href=paste(devHistoryUrl, "/", object@Package, sep=""))) } else { flds <- flds[- match("devHistoryUrl", flds)] tableDat[["devHistoryUrl"]] <- NULL } ## rename rows names(tableDat) <- names(flds) domValue <- tableHelper(tableDat, table.attrs=list(class="details")) domValue }) setMethod("htmlValue", signature(object="pdDescriptionInfo"), function(object) { node <- xmlNode("p", cleanText(object@Description), attrs=c(class="description")) node }) setMethod("htmlValue", signature(object="PackageDetail"), function(object) { dom <- xmlOutputDOM("div", attrs=c(class="PackageDetail")) ## Heading dom$addTag("h1", object@Package) dom$addTag("h2", cleanText(object@Title)) ## Description descInfo <- as(object, "pdDescriptionInfo") dom$addNode(htmlValue(descInfo)) ## Author info authorInfo <- as(object, "pdAuthorMaintainerInfo") dom$addNode(htmlValue(authorInfo)) ## Installation Instructions dom$addTag("div", attrs=c(class="installInstruct"), close=FALSE) dom$addTag("p", paste("To install this package,", "start R and enter:"), attrs=c(class="install")) dom$addTag("pre", paste(" if (!require(\"BiocManager\"))", "\n install.packages(\"BiocManager\")", "\n BiocManager::install(\"", object@Package, "\")", sep="") ) dom$closeTag() # div ## Documentation dom$addTag("h3", "Documentation") vigInfo <- as(object, "pdVignetteInfo") dom$addNode(htmlValue(vigInfo)) ## Details dom$addTag("h3", "Details") detailsInfo <- as(object, "pdDetailsInfo") dom$addNode(htmlValue(detailsInfo)) ## Package Downloads dom$addTag("h3", "Package Downloads") downloadInfo <- as(object, "pdDownloadInfo") dom$addNode(htmlValue(downloadInfo)) return(dom$value()) }) viewsHelper <- function(views) { dom <- xmlOutputDOM("ul") for (v in views) { link <- htmlFilename(v) dom$addTag("li", close=FALSE) dom$addTag("a", v, attrs=c(href=link)) dom$closeTag() } dom$value() } setMethod("htmlValue", signature(object="bvSubViews"), function(object) { dom <- xmlOutputDOM("div", attrs=c(class="bv_subviews")) dom$addTag("h2", "Subviews") dom$addNode(viewsHelper(object@subViews)) dom$value() }) setMethod("htmlValue", signature(object="bvParentViews"), function(object) { dom <- xmlOutputDOM("div", attrs=c(class="bv_parentviews")) dom$addTag("h2", "Subview of") dom$addNode(viewsHelper(object@parentViews)) dom$value() }) setMethod("htmlValue", signature(object="BiocView"), function(object) { dom <- xmlOutputDOM("div", attrs=c(class="BiocView")) ## Heading dom$addTag("h1", paste("Bioconductor Task View:", object@name)) ## Parent Views if (length(object@parentViews) > 0) { parentViews <- as(object, "bvParentViews") dom$addNode(htmlValue(parentViews)) } ## Subviews if (length(object@subViews) > 0) { subViews <- as(object, "bvSubViews") dom$addNode(htmlValue(subViews)) } dom$addTag("h2", "Packages in view") if (length(object@packageList) > 0) { pkgTable <- as(object, "rdPackageTable") dom$addNode(htmlValue(pkgTable)) } else { dom$addTag("p", "No packages in this view") } dom$value() }) biocViews/R/packageDetails.R0000644000175200017520000001314414710217211016752 0ustar00biocbuildbiocbuildloadPackageDetails <- function(reposRoot, reposUrl="..", viewUrl="../..", reposFullUrl=reposUrl, downloadStatsUrl="", devHistoryUrl="") { ## Return a list of PackageDetail objects representing ## the packages contained in the repository located ## on the local filesystem at reposRoot. ## ## reposRoot - Path to local filesystem CRAN-style repository ## ## FIXME: should allow reading VIEWS from a URL also. viewsFile <- file.path(reposRoot, "VIEWS") pkgMat <- readPackageInfo(viewsFile) createPackageDetailList(pkgMat, reposUrl, viewUrl, reposFullUrl, downloadStatsUrl, devHistoryUrl) } createPackageDetailList <- function(viewMat, reposUrl="..", viewUrl=character(0), reposFullUrl=reposUrl, downloadStatsUrl="", devHistoryUrl="") { if (nrow(viewMat) == 0L) return(list()) pkgList <- apply(viewMat, 1, viewRowToPackageDetail) names(pkgList) <- viewMat[, "Package"] pkgList <- setDependsOnMeImportsMeSuggestsMe(pkgList) pkgList <- lapply(pkgList, function(p) { p@devHistoryUrl <- devHistoryUrl p@downloadStatsUrl <- downloadStatsUrl p@reposFullUrl <- reposFullUrl p@reposRoot <- reposUrl p@viewRoot <- viewUrl p }) return(pkgList) } setDependsOnMeImportsMeSuggestsMe <- function(pkgDetailsList) { ## Add list of packages that depend on and suggest each package ## listed in pkgDetailsList, a list of PackageDetail objects. pkgNames <- names(pkgDetailsList) depCols <- lapply(pkgDetailsList, function(x) pkgNames %in% x@Depends) depMat <- do.call(cbind, depCols) colnames(depMat) <- rownames(depMat) <- pkgNames impCols <- lapply(pkgDetailsList, function(x) pkgNames %in% x@Imports) impMat <- do.call(cbind, impCols) colnames(impMat) <- rownames(impMat) <- pkgNames sugCols <- lapply(pkgDetailsList, function(x) pkgNames %in% x@Suggests) sugMat <- do.call(cbind, sugCols) colnames(sugMat) <- rownames(sugMat) <- pkgNames setDepsImpsSugs <- function(pkg) { deps <- pkgNames[which(depMat[pkg@Package, ])] imps <- pkgNames[which(impMat[pkg@Package, ])] sugs <- pkgNames[which(sugMat[pkg@Package, ])] pkg@dependsOnMe <- deps pkg@importsMe <- imps pkg@suggestsMe <- sugs return(pkg) } return(lapply(pkgDetailsList, setDepsImpsSugs)) } viewRowToPackageDetail <- function(row) { ## Given a row from a VIEWS package description matrix as returned by ## calling read.dcf through readPackageInfo on a VIEWS file, return a ## PackageDetail instance. pkg <- new("PackageDetail") ## assume we have names on the row flds <- names(row) ourSlots <- slotNames(getClass("PackageDetail")) for (fld in flds) { if (! fld %in% ourSlots) next val <- row[[fld]] ## FIXME: are we sure we want to get rid of the NA's here? if (is.na(val)) val <- "" slot(pkg, fld) <- val } ## Fix vector fields ## FIXME: we are using a private func from tools. Also, ## this func gives more structure (version info) which for now we ## ignore. cleanPkgField <- function(val) { val <- names(tools:::.split_dependencies(val)) if (is.null(val)) val <- character(0) val } cleanField <- function (x) { x <- unlist(strsplit(x, ",")) if (!length(x)) return(character(0)) x <- unique(sub("^[[:space:]]*(.*)[[:space:]]*$", "\\1", x)) x } cleanVigs <- function(vigs) { if (length(vigs) > 0 && !is.na(vigs)) { vigs <- gsub("\n", "", vigs) ans <- strsplit(vigs, ", *")[[1]] } else { ans <- character(0) } return(ans) } pkg@Depends <- cleanPkgField(pkg@Depends) pkg@Suggests <- cleanPkgField(pkg@Suggests) pkg@Imports <- cleanPkgField(pkg@Imports) pkg@biocViews <- cleanField(pkg@biocViews) pkg@vignettes <- cleanVigs(pkg@vignettes) pkg@vignetteScripts <- cleanVigs(pkg@vignetteScripts) pkg@vignetteTitles <- cleanVigs(pkg@vignetteTitles) pkg@htmlTitles <- cleanVigs(pkg@htmlTitles) return(pkg) } removeEmail <- function(line) { line <- gsub("<[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+>", "", line) line <- gsub("[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+", "", line) line <- sub(" +$", "", line) line } mangleEmail <- function(line) { chrA <- c("À", "Á", "Â", "Ã", "Ä", "Å", "Æ") chrO <- c("Ò", "Ó", "Ô", "Õ", "Ö") makeAT <- function() { i <- sample(seq(length=length(chrA), 1)) paste(" ", chrA[i], "T", " ", sep="") } makeDOT <- function() { i <- sample(seq(length=length(chrO), 1)) paste(" ", "D", chrO[i], "T", " ", sep="") } emailStarts <- gregexpr("<", line, fixed=TRUE)[[1]] emailEnds <- gregexpr(">", line, fixed=TRUE)[[1]] emails <- sapply(seq(length=length(emailStarts)), function(x) substr(line, emailStarts[x], emailEnds[x])) emails <- sapply(emails, function(line) { AT <- makeAT() DOT <- makeDOT() line <- gsub("@", AT, line, fixed=TRUE) line <- gsub("\\.", DOT, line, fixed=TRUE) line }) other <- strsplit(line, "<[^>]+@[^>]+>")[[1]] paste(other, emails, collapse="") } biocViews/R/pump.R0000644000175200017520000000244214710217211015031 0ustar00biocbuildbiocbuildgetRootNode <- function(g) { rootIdx <- which(sapply(inEdges(g), length) == 0) nodes(g)[rootIdx] } pump <- function(viewlist, vocab) { # make packages annotated to hypernyms of their # direct annotations vs <- names(viewlist) root <- getRootNode(vocab) for (v in vs) { st <- tellSuperTop(v, vocab, root) if (length(st) > 0) { for (sti in st) viewlist[[sti]] <- union(viewlist[[sti]], viewlist[[v]]) } } viewlist } tellSuperTop <- function(topic, vocab, root) { # returns vector of supertopics if (length(topic)>1) stop("must have length 1 topic") if (!(topic %in% nodes(vocab))) { warning(paste("attempt to interpolate term [", topic, "] that is not even in the vocabulary! just returning term")) return(topic) } path <- sp.between( vocab, root, topic )[[1]]$path_detail path[-c(1, length(path))] } tellSubTop <- function(topic, vocab) { if (length(topic)>1) stop("must have length 1 topic") # returns vector of subtopics if (!(topic %in% nodes(vocab))) { warning(paste("attempt to interpolate term [", topic, "] that is not even in the vocabulary! just returning term")) return(topic) } desc <- acc( vocab, topic )[[1]] names(desc)[desc==1] } biocViews/R/recommendBiocViews.R0000644000175200017520000003312014710217211017631 0ustar00biocbuildbiocbuild.cleanupDependency <- function(input) { if (is.null(input)) return(character(0)) output <- gsub("\\s", "", input) output <- gsub("\\([^)]*\\)", "", output) res <- strsplit(output, ",")[[1]] unique(res[which(res != "R")]) } .parseDot <- function(dot) { dot <- sub(" *; *$", "", dot[grepl("^[[:space:][:alpha:]]+->", dot)]) unique(unlist(strsplit(dot, " *-> *"))) } getCurrentbiocViews <- function() { #read biocViews from dot file. biocViewdotfile <- system.file("dot","biocViewsVocab.dot", package="biocViews") if(!file.exists(biocViewdotfile)) stop("Package biocViews not found.") dot <- readLines(biocViewdotfile) Software <- dot[seq(grep("BiocViews -> Software", dot), grep("BiocViews -> AnnotationData", dot) - 1)] AnnotationData <- dot[seq(grep("BiocViews -> AnnotationData", dot), grep("BiocViews -> ExperimentData", dot) - 1)] ExperimentData <- dot[seq(grep("BiocViews -> ExperimentData", dot), grep("BiocViews -> Workflow", dot) - 1)] Workflow <- dot[seq(grep("BiocViews -> Workflow", dot), length(dot),1)] Software <- .parseDot(Software) ExperimentData <- .parseDot(ExperimentData) AnnotationData <- .parseDot(AnnotationData) Workflow <- .parseDot(Workflow) list(Software= Software ,ExperimentData= ExperimentData, AnnotationData= AnnotationData, Workflow= Workflow) } .findBranchReadDot <- function(current, branch) { ans <- getCurrentbiocViews() Software <- ans$Software ExperimentData <- ans$ExperimentData AnnotationData <- ans$AnnotationData Workflow <- ans$Workflow find_branch <- NULL if(length(current) != 0){ idx<- list(Software = match(current, Software), AnnotationData = match(current, AnnotationData), ExperimentData = match(current, ExperimentData), Workflow = match(current, Workflow)) atrue <- sapply(idx, function(x) any(!is.na(x))) #which branch has hit find_branch <- names(which(atrue==TRUE)) if(length(find_branch)>1) message("You have biocViews from multiple branches.") } if(length(find_branch)==0 & length(branch)==3){ txt <- paste0("Incorrect biocViews in file & no branch specified. Cant recommend biocViews") message(paste(strwrap(txt,exdent=2), collapse="\n")) } if(length(branch)==3 & length(find_branch)==1) { branch <- find_branch } if( length(branch)==1 & length(find_branch)==1) { if( length(branch)!=3 & (tolower(branch)!=tolower(find_branch))){ txt <- paste0("You have specified ",branch," branch but your package contains biocViews from ",find_branch, " branch.") message(paste(strwrap(txt,exdent=2), collapse="\n")) } } # return appropriate dot terms based on branch. if (tolower(branch)=="software") returndot <- Software else if(tolower(branch)=="experimentdata") returndot <- ExperimentData else if(tolower(branch)=="annotationdata") returndot <- AnnotationData else returndot <- Workflow returndot } .wordsfromDESCRIPTION <- function(pkgdir) { ## strategy 1- parse the words in the DESCRIPTION file to get ## biocViews descr_file <- file.path(pkgdir,"DESCRIPTION") dcf <- read.dcf(descr_file, c("Description", "Title", "Package","biocViews")) words1 <- unique(unlist(strsplit(dcf, " "))) ## strategy 2- get biocViews of packages in depends field. pkgs <- read.dcf(descr_file, "Depends") pkgs <- unlist(strsplit(gsub("[0-9.()>= ]", "", pkgs), ",")) urls <- .getBioCDevelUrl(devel=TRUE, branch="software") words2 <- character() con <- url(urls) biocpkgs <- read.dcf(con,"Package") idx <- which(biocpkgs %in% pkgs) if (length(idx)!=0) { wrd <- read.dcf(con, "biocViews")[idx] wrd <- unique(unlist(strsplit(wrd, ", "))) words2 <- c(words2,wrd) } close(con) if (length(words2)!=0) { words <- c(words1, words2) } else { words <- c(words1) } words } .wordsfromMANVIN <- function(pkgdir, man, vig) { manfls <- character(0) vinfls <- character(0) ##strategy -3 man pages parsing. if(man) manfls <- list.files(file.path(pkgdir,"man"), full.names=TRUE, pattern="\\.Rd$") ##stragegy -4 vignette pages parsing. if(vig) vinfls <- list.files(file.path(pkgdir,"vignettes"), full.names=TRUE, pattern="\\.Rnw$") allfls <- c(manfls,vinfls) if(length(allfls)==0){ all_words <- NA }else{ q <- lapply(allfls, readLines) temp <- unlist(strsplit(q[[1]], "[[:punct:]]", perl = TRUE)) temp <- unlist(strsplit(temp, "[[:space:]]", perl = TRUE)) all_words <- unique(temp[temp != ""]) } all_words } recommendBiocViews <- function(pkgdir, branch= c("Software", "AnnotationData", "ExperimentData")) { if(!file.exists(pkgdir)) stop("Package Directory not found.") if(!file.exists(file.path(pkgdir,"DESCRIPTION"))) stop("No DESCRIPTION file found.") ## existing biocView in test package? current <- read.dcf(file.path(pkgdir,"DESCRIPTION"), c("biocViews", "BiocViews")) current <- .cleanupDependency(current) if(length(current)==0 & missing(branch)){ txt <- "No existing biocViews found in this package and cannot determine the branch of package to recommend biocViews" stop(paste(strwrap(txt,exdent=2), collapse="\n")) } words1 <- .wordsfromDESCRIPTION(pkgdir) m <- file.exists(file.path(pkgdir,"man")) v <- file.exists(file.path(pkgdir,"vignettes")) man <- character(0) vig <- character(0) if(all(m,v)){ all_words<- .wordsfromMANVIN(pkgdir, man=TRUE, vig=TRUE) } else{ if(!m){ message("No man pages found.") all_words<- .wordsfromMANVIN(pkgdir, man=FALSE, vig=TRUE) } if(!v){ message("No vignettes found.") all_words<- .wordsfromMANVIN(pkgdir, man=TRUE, vig=FALSE) } } words1 <- c(words1,all_words) words1 <- unlist(sapply(words1,.cleanupDependency, USE.NAMES = FALSE) ) dotterms <- .findBranchReadDot(current, branch) ### split "DecsisionTree" to "decision" , "tree" terms <- sapply(dotterms, function(x){ m <- gregexpr(pattern= "[[:upper:]]", text = x, ignore.case=FALSE) s1 <- unlist(regmatches(x,m)) s2 <- unlist(strsplit(x, "[[:upper:]]")) if(length(s2)!=length(s1)) s2 <- s2[-1] word<-function(s1,s2) paste0(s1,s2) ans <- mapply(word, s1,s2, USE.NAMES=FALSE) if(length(ans)==0) ans <- x ans }, simplify = TRUE) terms <- lapply(terms, function(z){ z<- setdiff(z,"Data") unlist(strsplit(z,"_")) }) if(branch=="ExperimentData") { terms$CpGIslandData <- c("cpg", "island") terms$GEO <- "GEO" terms$HapMap <- "HapMap" terms$SNPData <- "SNP" terms$DNASeqData <- c("DNA","Seq") terms$RNASeqData <- c("RNA","Seq") terms$ChIPSeqData <- c("ChIP","Seq") terms$RIPSeqData <- c("RIP","Seq") terms$COPDData <-"COPD" terms$qPCRData <- "pcr" terms$SAGEData <-"sage" } # combine words from all sources and map words1 <- unique(unlist(strsplit(words1,"\n"))) words1 <- unique(unlist(strsplit(words1,"-"))) words1 <- unique(unlist(strsplit(words1,"_"))) words1 <- gsub("[.]","",words1) ## match against biocViews. idx <- which(tolower(dotterms) %in% tolower(words1)) temp <- dotterms[idx] ## only if both "decision" and "tree" are found add biocView "DecisionTree" split_word <- mapply(FUN= function(x,y){ i <- which(tolower(x) %in% tolower(words1)) ifelse(length(i)==length(x), y, NA) }, terms, names(terms), USE.NAMES=FALSE) suggest_bioc <- unique(c(split_word[complete.cases(split_word)], temp)) commonbiocViews <- c("Infrastructure","Software", "AssayDomain","BiologicalQuestion","Infrastructure", "ResearchField","StatisticalMethod","Technology", "Annotation","Visualization","DataRepresentation", "miRNA","SNP","qPCR","SAGE","Genetics", "GenomeAnnotation", "SpecimenSource","OrganismData", "DiseaseModel","TechnologyData","AssayDomainData", "RepositoryData") suggest_bioc <- setdiff(suggest_bioc,commonbiocViews) ## setdiff between current and suggested biocViews. if(length(current)!=0){ new_bioc <- setdiff(suggest_bioc, current) }else{ new_bioc <- suggest_bioc } ## some pkgs have terms which do not belong to software branch. remove <- c(intersect(current, commonbiocViews), setdiff(current, dotterms)) list(current = paste(current, collapse=", "), recommended = paste(new_bioc, collapse=", "), remove = paste(remove, collapse=", ")) } .getBioCDevelUrl <- function(devel=TRUE, branch) { con <- url("http://bioconductor.org/js/versions.js") x <- readLines(con) pattern <- ifelse(devel, "develVersion", "releaseVersion") dv <- x[grep(pattern, x)] devel_version <- strsplit(dv, '"')[[1]][2] repos <- switch(tolower(branch), software="/bioc/", experimentdata="/data/experiment/", annotationdata="/data/annotation/") close(con) paste0("http://bioconductor.org/packages/", devel_version, repos, "VIEWS") } recommendPackages <- function(biocViews, use.release=TRUE, intersect.views=TRUE) { if(length(biocViews)==0) # return avaialbel biocViews stop("Input some biocViews to get recommended packages.") toMatch <- paste(biocViews, collapse="|") ## check if the input biocViews are defined by us. existingbiocViews <- getCurrentbiocViews() match <- sapply(existingbiocViews, function(x){ length(unique(grep(toMatch, x, ignore.case=TRUE))) }) if(all(match==0L)) stop("See: http://bioconductor.org/packages for valid biocViews") ## which branch do these biocViews belong to ? branch <- names(match)[match != 0L] if (length(branch) != 1L) stop("Input biocViews belong to branches ", paste(sQuote(branch), collapse=", "), "; choose from 1 branch only") ## recommed packages based on branch url <- .getBioCDevelUrl(devel=!use.release, branch) con <- url(url) tbl <- read.dcf(con, fields=c("Package", "biocViews")) close(con) ## get child biocViews of input biocView ## eg: if biocView is 'Alignment' then we should get packages tagged ## with 'MultipleSequenceAlignment' also! biocViews <- c(biocViews, .getChildEdgeFromDot(biocViews)) idx0 <- sapply(tbl[,"biocViews"], function(table, x) { y <- gsub("\n", " ", table) y <- unlist(strsplit(y, ",")) y <- gsub("^\\s+|\\s+$", "", y) # remove trailing/leading white spaces tolower(x) %in% tolower(y) } , biocViews) if(length(biocViews)==1L){ ## a list is returned. No operation needs to be done return(tbl[idx0, "Package"]) } ## if intersect.views = TRUE then 'and' operation is carried out. ## eg: Packages tagged with both biocView 'a' and 'b' will be resturned. colnames(idx0) <- tbl[,"Package"] if (intersect.views) pkg <- colnames(idx0)[colSums(idx0)==length(biocViews)] # and operation else{ pkg <- colnames(idx0)[colSums(idx0)!=0] # or operation } pkg } .getChildEdgeFromDot <- function(biocView) { ans <- .getChildren(biocView) ans <- unlist(ans) names(ans) <- NULL ans[!(ans %in% "1")] } .getChildren <- function(biocView) { biocViewsVocab <- NULL data(biocViewsVocab, package="biocViews", envir=environment()) ans <- unlist(edges(biocViewsVocab, biocView)) if(length(ans)==0) return("1") else return(c(ans, .getChildren(ans))) } # Best guess if cannot be determined defaults to software guessPackageType <- function(biocViews){ if(length(biocViews)==0){ return("Software") } else{ toMatch <- paste0("^",paste(biocViews, collapse="$|^"), "$") ## check if the input biocViews are defined by us. existingbiocViews <- getCurrentbiocViews() match <- sapply(existingbiocViews, function(x){ length(unique(grep(toMatch, x))) }) if(all(match==0L)) return("Software") branch <- names(match)[which(match == max(match))] return(as.character(branch[1])) } } biocViews/R/repository.R0000644000175200017520000011523114710217211016270 0ustar00biocbuildbiocbuildgenReposControlFiles <- function(reposRoot, contribPaths, manifestFile=NA, meatPath=NA) { ## Generate all control files for BioC hosted R ## package repositorys message("Generating repos control files:") message("- write_REPOSITORY() ... ", appendLF=FALSE) t <- system.time(write_REPOSITORY(reposRoot, contribPaths))[["elapsed"]] message(sprintf("OK (total time: %.2fs)", t)) ## Write PACKAGES files for all contrib paths packagesPaths <- file.path(reposRoot, contribPaths) names(packagesPaths) <- names(contribPaths) for (type in names(packagesPaths)) { path <- packagesPaths[[type]] if (type == "win64.binary") { type <- "win.binary" } else if (substr(type, 1, 10) == "mac.binary") { type <- "mac.binary" } message("- write_PACKAGES() to ", path, " ... ", appendLF=FALSE) t <- system.time(write_PACKAGES(path, type=type))[["elapsed"]] message(sprintf("OK (total time: %.2fs)", t)) } ## Write a VIEWS file at the top-level containing ## detailed package info message("- write_VIEWS() ... ", appendLF=FALSE) t <- system.time( write_VIEWS(reposRoot, manifestFile=manifestFile, meatPath=meatPath) )[["elapsed"]] message(sprintf("OK (total time: %.2fs)", t)) ## Write a SYMBOLS file at the top-level containing the ## exported symbols for all packages that have name ## spaces. This is used to build a searchable index. #message("- write_SYMBOLS() ... ", appendLF=FALSE) #t <- system.time(write_SYMBOLS(reposRoot))[["elapsed"]] #message(sprintf("OK (total time: %.2fs)", t)) message("DONE Generating repos control files.") } pkgName <- function(tarball) { strsplit(basename(tarball), "_", fixed=TRUE)[[1L]][1L] } unpack <- function(tarball, unpackDir, wildcards) { args <- c("-C", unpackDir, "-xzf", tarball, "--wildcards", wildcards) system2("tar", args, stderr=NULL) } cleanUnpackDir <- function(tarball, unpackDir, subDir="", pattern=NULL) { ## Delete files from a previous extraction pkg <- pkgName(tarball) pkgDir <- file.path(unpackDir, pkg, subDir) files <- list.files(pkgDir, pattern=pattern, full.names=TRUE, recursive=is.null(pattern), include.dirs=is.null(pattern)) unlink(files) } extractManuals <- function(reposRoot, srcContrib, destDir) { ## Extract Rd man pages from source package tarballs and ## convert to pdf documents ## ## reposRoot - Top level path for CRAN-style repos ## srcContrib - Location of source packages ## destDir - where to extract. ## ## Notes: ## Under destDir, for tarball foo_1.2.3.tar.gz, you will ## get destDir/foo/man/*.pdf ## if (missing(destDir)) destDir <- file.path(reposRoot, "manuals") buildManualsFromTarball <- function(tarball, unpackDir=".") { ## helper function to unpack pdf & Rd files from the vig status <- TRUE cleanUnpackDir(tarball, unpackDir, "man", ".*\\.(pdf|Rd|rd)$") ret <- unpack(tarball, unpackDir, "'*/man/*.[Rr]d'") if (ret != 0) { warning("non-zero exit status ", ret, " extracting man pages: ", tarball) status <- FALSE } else { pkg <- pkgName(tarball) pkgDir <- file.path(unpackDir, pkg, "man") RCmd <- file.path(Sys.getenv("R_HOME"), "bin", "R") Rd2pdfCmd <- paste0( RCmd, " CMD Rd2pdf --no-preview ", "--output=", pkgDir, "/", pkg, ".pdf ", "--title=", pkg, " ", pkgDir, "/*.[Rr]d") ret <- system(Rd2pdfCmd) cleanUnpackDir(tarball, unpackDir, "man", ".*\\.(Rd|rd)$") if (ret != 0) { warning("non-zero exit status ", ret, " building ref man: ", pkg) status <- FALSE } } status } tarballs <- list.files(file.path(reposRoot, srcContrib), pattern="\\.tar\\.gz$", full.names=TRUE) if (!file.exists(destDir)) dir.create(destDir, recursive=TRUE) if (!file.info(destDir)$isdir) stop("destDir must specify a directory") if (endsWith(reposRoot, "data/annotation")) { n <- vapply(tarballs, function(tarball, ...) { tryCatch({ buildManualsFromTarball(tarball, ...) }, error = function(e) { warning("error extracting manual for: ", tarball, "\n ", conditionMessage(e)) FALSE }) }, logical(1), unpackDir=destDir) } else { n <- 0 } paste(sum(n), "/", length(tarballs), "tarball manuals processsed") } getRefmanLinks <- function(pkgList, reposRootPath, refman.dir) { unlist(lapply(pkgList, function(pkg) { refmanSubDir <- "man" refmanDir <- file.path(reposRootPath, refman.dir, pkg, refmanSubDir) if (file.exists(refmanDir)) { refmans <- list.files(refmanDir, pattern=".*\\.pdf$") refmans <- paste(refman.dir, pkg, refmanSubDir, refmans, sep="/", collapse=", ") } else refmans <- NA_character_ refmans })) } extractTopLevelFiles <- function(reposRoot, srcContrib, destDir, fileName) { extractFileFromTarball <- function(tarball, unpackDir=".") { pkg <- pkgName(tarball) cleanUnpackDir(tarball, unpackDir, pattern=fileName) message("Attempting to extract ", fileName, " from ", tarball) unpack(tarball, unpackDir, file.path(pkg, fileName)) } tarballs <- list.files(file.path(reposRoot, srcContrib), pattern="\\.tar\\.gz$", full.names=TRUE) if (!file.exists(destDir)) dir.create(destDir, recursive=TRUE) if (!file.info(destDir)$isdir) stop("destDir must specify a directory") lapply(tarballs, extractFileFromTarball, unpackDir=destDir) invisible(NULL) } extractINSTALLfiles <- function(reposRoot, srcContrib, destDir) { extractTopLevelFiles(reposRoot, srcContrib, destDir, "INSTALL") } ### Will return NULL if the citation could not be generated from the CITATION ### file. This typically occurs when the file contains code that relies on ### the package to be installed e.g. it contains calls to things like ### packageVersion() or packageDate() instead of using 'meta$Version' ### or 'meta$Date'. See ### https://cran.r-project.org/doc/manuals/r-release/R-exts.html#CITATION-files ### for the details. .extract_citation <- function(tarball) { pkgname <- pkgName(tarball) tmpdir <- tempdir() ## Remove any stale DESCRIPTION or CITATION file from the tmpdir/pkgname/ ## folder (could happen e.g. if 'tmpdir' somehow already contained a stale ## source tree for 'pkgname'). tmp_pkgdir <- file.path(tmpdir, pkgname) DESCRIPTION_path <- file.path(tmp_pkgdir, "DESCRIPTION") CITATION_path <- file.path(tmp_pkgdir, "inst", "CITATION") paths <- c(DESCRIPTION_path, CITATION_path) status <- unlink(paths) ## Should never happen. if (status != 0L) stop("failed to remove files DESCRIPTION and/or ", "inst/CITATION from folder ", tmp_pkgdir) ## Try to extract files DESCRIPTION and inst/CITATION from tarball. ## Note that the path separator is **always** / in a tarball, even ## on Windows, so do NOT use file.path() here. DESCRIPTION_tpath <- paste0(pkgname, "/DESCRIPTION") CITATION_tpath <- paste0(pkgname, "/inst/CITATION") tpaths <- c(DESCRIPTION_tpath, CITATION_tpath) status <- untar(tarball, tpaths, exdir=tmpdir) ## Unfortunately, there are some rare situations where untar() returns ## a non-zero value even though the requested files get successfully ## extracted. This happens with some package source tarballs generated ## by 'R CMD build' but seem corrupted e.g.: ## > untar("simpleSingleCell_1.13.5.tar.gz", "simpleSingleCell/DESCRIPTION") ## /bin/tar: Skipping to next header ## /bin/tar: Skipping to next header ## /bin/tar: Exiting with failure status due to previous errors ## Warning message: ## In untar("simpleSingleCell_1.13.5.tar.gz", "simpleSingleCell/DESCRIPTION") : ## "/bin/tar -xf 'simpleSingleCell_1.13.5.tar.gz' 'simpleSingleCell/DESCRIPTION'" returned error code 2 ## So instead of checking 'status', we check for the existence of the ## extracted files. if (!file.exists(DESCRIPTION_path)) # should never happen stop("failed to extract DESCRIPTION file from ", tarball) description <- packageDescription(pkgname, lib.loc=tmpdir) ## If tarball contains a CITATION file, use it to generate the citation. if (file.exists(CITATION_path)) { message("(try to process CITATION file) ", appendLF=FALSE) citation <- try(readCitationFile(CITATION_path, meta=description), silent=TRUE) if (inherits(citation, "try-error")) citation <- NULL return(citation) } ## If there is no CITATION file, auto-generate citation from ## DESCRIPTION file. message("(auto-generate from DESCRIPTION file) ", appendLF=FALSE) citation(pkgname, lib.loc=tmpdir, auto=description) } .write_citation_as_HTML <- function(pkgname, citation, destdir) { destfile <- file.path(destdir, "citation.html") if (dir.exists(destdir)) { status <- unlink(destfile) if (status != 0L) stop("failed to remove previous ", destfile, " file") } else { if (!dir.create(destdir)) stop("failed to create ", destdir, " directory") } if (is.null(citation)) { message("(failed! ==> replacing citation with red banner) ", appendLF=FALSE) html <- c("

Important note to the ", "maintainer of the ", pkgname, "package: An error ", "occured while trying to generate the citation ", "from the CITATION file. This typically occurs ", "when the file contains R code that relies on ", "the package to be installed e.g. it contains calls ", "to things like packageVersion() or ", "packageDate() instead of using ", "meta$Version or meta$Date. ", "See R documentation ", "for more information.

") } else { ## print() can fail on a citation object. See: ## https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17725 html <- try(capture.output(print(citation, style="html")), silent=TRUE) if (inherits(html, "try-error")) { message("(failed! ==> replacing citation with red banner) ", appendLF=FALSE) html <- c("

Important note to the ", "maintainer of the ", pkgname, "package: An error ", "occured while trying to generate the citation ", "from the CITATION file. Please make sure that the ", "CITATION file in your package is valid by calling ", "utils::readCitationFile() on it.

") } ## Filter out lines starting with \Sexprs. html <- html[grep("^\\\\Sexpr", html, invert=TRUE)] } cat(html, file=destfile, sep="\n") } extractCitations <- function(reposRoot, srcContrib, destDir) { tarballs <- list.files( file.path(reposRoot, srcContrib), pattern="\\.tar\\.gz$", full.names=TRUE) if (!dir.exists(destDir)) { if (!dir.create(destDir, recursive=TRUE)) stop("failed to create ", destDir, " directory") } for (tarball in tarballs) { message("Generate citation for ", tarball, " ... ", appendLF=FALSE) citation <- .extract_citation(tarball) pkgname <- pkgName(tarball) .write_citation_as_HTML(pkgname, citation, file.path(destDir, pkgname)) message("OK") } } extractReadmes <- function(reposRoot, srcContrib, destDir) { ## Extract README files from source package tarballs ## ## reposRoot - Top level path for CRAN-style repos ## srcContrib - Location of source packages ## destDir - where to extract. ## ## Notes: ## Under destDir, for tarball foo_1.2.3.tar.gz, you will ## get destDir/foo/inst/doc/*.pdf ## extractTopLevelFiles(reposRoot, srcContrib, destDir, "README") } extractNEWS <- function(reposRoot, srcContrib, destDir) { if (missing(destDir)) destDir <- file.path(reposRoot, "news") extractNewsFromTarball <- function(tarball, unpackDir=".") { pkg <- pkgName(tarball) cleanUnpackDir(tarball, unpackDir, pattern="NEWS") unpack(tarball, unpackDir, "'*NEWS*'") } convertNEWSToText <- function(tarball, srcDir, destDir) { pkg <- pkgName(tarball) srcDir <- file.path(srcDir, pkg) destDir <- file.path(destDir, pkg) if (!file.exists(destDir)) dir.create(destDir, recursive=TRUE) destFile <- file.path(destDir, "NEWS") getNEWSFromFile(srcDir, destFile, output="text") } tarballs <- list.files(file.path(reposRoot, srcContrib), pattern="\\.tar\\.gz$", full.names=TRUE) if (!file.exists(destDir)) dir.create(destDir, recursive=TRUE) if (!file.info(destDir)$isdir) stop("destDir must specify a directory") unpackDir <- tempdir() lapply(tarballs, function(tarball) { cat("Attempting to extract NEWS from", tarball, "\n") extractNewsFromTarball(tarball, unpackDir=unpackDir) res <- try(convertNEWSToText(tarball, srcDir=unpackDir, destDir=destDir)) if (inherits(res, "try-error")) cat("FAILED!\n") }) invisible(NULL) } extractVignettes <- function(reposRoot, srcContrib, destDir) { ## Extract vignettes from source package tarballs ## ## reposRoot - Top level path for CRAN-style repos ## srcContrib - Location of source packages ## destDir - where to extract. ## ## Notes: ## Under destDir, for tarball foo_1.2.3.tar.gz, you will ## get destDir/foo/inst/doc/*.pdf ## if (missing(destDir)) destDir <- file.path(reposRoot, "vignettes") extractVignettesFromTarball <- function(tarball, unpackDir=".") { cleanUnpackDir(tarball, unpackDir, subDir=file.path("inst", "doc")) cat("Extracting vignettes from", tarball, "\n") ret <- unpack(tarball, unpackDir, "'*/inst/doc/*'") if (ret != 0) warning("tar had non-zero exit status for vig extract of: ", tarball) } tarballs <- list.files(file.path(reposRoot, srcContrib), pattern="\\.tar\\.gz$", full.names=TRUE) if (!file.exists(destDir)) dir.create(destDir, recursive=TRUE) if (!file.info(destDir)$isdir) stop("destDir must specify a directory") invisible(lapply(tarballs, extractVignettesFromTarball, unpackDir=destDir)) } extractHTMLDocuments <- function(reposRoot, srcContrib, destDir) { ## Extract HTML documents from source package tarballs ## IF any HTML document is present in inst/doc. ## ## reposRoot - Top level path for CRAN-style repos ## srcContrib - Location of source packages ## destDir - where to extract. ## ## Notes: ## Under destDir, for tarball foo_1.2.3.tar.gz, you will ## get destDir/foo/inst/doc/*.pdf ## if (missing(destDir)) destDir <- file.path(reposRoot, "vignettes") extractHTMLDocumentsFromTarball <- function(tarball, unpackDir=".") { ## helper function to unpack HTML documents and deps from tarball ## here we untar twice, once (just listing files) to see ## if there are html files in inst/doc, then if there are, ## we untar again (extracting). Optimal? fileList <- untar(tarball, list=TRUE) if (length(grep("inst/doc/.*\\.html$", fileList, ignore.case=TRUE))) { cat("Found HTML document in", tarball, "\n") ## This extracts everything, including ## Rnw and Rmd files...too liberal? Then use vignettes/ dir cat("Extracting HTML documents from", tarball, "\n") ret <- unpack(tarball, unpackDir, "'*/inst/doc/*'") if (ret != 0) warning("tar had non-zero exit status for HTML extract of: ", tarball) } } tarballs <- list.files(file.path(reposRoot, srcContrib), pattern="\\.tar\\.gz$", full.names=TRUE) if (!file.exists(destDir)) dir.create(destDir, recursive=TRUE) if (!file.info(destDir)$isdir) stop("destDir must specify a directory") invisible(lapply(tarballs, extractHTMLDocumentsFromTarball, unpackDir=destDir)) } getDcfValues <- function(values) { if (is.na(values)) return (character(0)) values <- gsub("\n", " ", values, fixed=TRUE) l <- unlist(strsplit(values, ", ", fixed=TRUE)) res <- unlist(lapply(l, function(x) { p <- strsplit(x, " |\\(", fixed=FALSE) unlist(p)[[1]] })) res } getFileExistsAttr <- function(pkgList, reposRootPath, dir, filename) { unlist(lapply(pkgList, function(pkg) { ret <- logical(0) filedir <- file.path(reposRootPath, dir, pkg) file <- file.path(filedir, filename) exists <- file.exists(filedir) && file.exists(file) ret <- c(ret, exists) ret })) } getFileLinks <- function(pkgList, reposRootPath, vignette.dir, ext, ignore.case=FALSE) { if (length(pkgList) == 0L) return(character(0)) unlist(lapply(pkgList, function(pkg) { vigSubDir <- "inst/doc" vigDir <- file.path(reposRootPath, vignette.dir, pkg, vigSubDir) vigs <- NA_character_ if (file.exists(vigDir)) { pattern <- paste(".*\\.", ext, "$", sep="") files <- list.files(vigDir, pattern=pattern, ignore.case=ignore.case) if (length(files)) vigs <- paste(vignette.dir, pkg, vigSubDir, files, sep="/", collapse=", ") } vigs })) } getDocumentTitles <- function(docs, ext="pdf", src=c("Rnw", "Rmd"), reposRootPath, fun) { if (length(docs) == 0L) return(character()) filelist <- strsplit(docs, ", ", fixed = TRUE) unlist(lapply(filelist, function(files) { if (all(is.na(files))) { NA_character_ } else { files <- file.path(reposRootPath, files) titles <- unlist(lapply(files, function(file) { title <- NA_character_ src <- paste0(sub(sprintf("\\.%s$", ext), ".", file, ignore.case=TRUE), src) idx <- which(file.exists(src))[1L] ## extract title from source file if (!is.na(idx)) { title <- fun(file, src[idx]) title <- trimws(title) title <- gsub(",", ",,", title, fixed=TRUE) } ## use filename if no source file found, title extraction failed, ## or the extracted title is empty if (is.na(title) || nchar(title)==0L) basename(file) else title })) paste(titles, collapse=", ") } })) } getVignetteIndexEntry <- function(file) { lines <- readLines(file, warn=FALSE) ## use the same regular expression as in tools:::.get_vignette_metadata regex <- "[[:space:]]*%+[[:space:]]*\\\\VignetteIndexEntry\\{([^}]*(\\{[^}]*\\})*[^}]*)\\}.*" ## match to first occurance res <- grep(regex, lines, value = TRUE)[1L] gsub(regex, "\\1", res) } getPdfTitle <- function(doc, src) { getVignetteIndexEntry(src) } getHtmlTitle <- function(doc, src) { ## First look for an old-fashioned VignetteIndexEntry in the source file title <- getVignetteIndexEntry(src) if (is.na(title)) { ## now look for an HTML title doc <- htmlParse(doc) res <- xpathApply(doc, "//title", xmlValue) if (length(res)) title <- res[[1L]] } title } write_REPOSITORY <- function(reposRootPath, contribPaths) { contrib <- as.list(contribPaths) names(contrib) <- gsub("-", ".", names(contribPaths)) contrib[["provides"]] <- paste(names(contribPaths), collapse=", ") fn <- file.path(reposRootPath, "REPOSITORY") write.dcf(contrib, fn) } read_REPOSITORY <- function(reposRootPath) { reposInfo <- read.dcf(file.path(reposRootPath, "REPOSITORY")) reposInfo[, "provides"] <- gsub("[ \t\r\n\v\f]", "", reposInfo[, "provides"]) provided <- strsplit(reposInfo[, "provides"], ",")[[1L]] m <- match(gsub("-", ".", provided), colnames(reposInfo)) if (anyNA(m)) stop("malformed REPOSITORY file: 'provides' field is inconsistent ", "with other fields)") if (anyDuplicated(m)) stop("malformed REPOSITORY file: several values in 'provides' field ", "are mapped to the same entry in the file") colnames(reposInfo)[m] <- provided reposInfo } .write_repository_db <- function(db, dir, fname) { if ("Bundle" %in% colnames(db)) { noPack <- is.na(db[, "Package"]) db[noPack, "Package"] <- db[noPack, "Bundle"] } gzname <- paste(fname, "gz", sep=".") out <- file(file.path(dir, fname), "wt") ##FIXME: gzfile writing segfaults for me ##outgz <- gzfile(file.path(dir, gzname), "wt") for (i in seq_len(nrow(db))) { dbi <- db[i, !(is.na(db[i, ]) | (db[i, ] == "")), drop = FALSE] write.dcf(dbi, file = out) ##FIXME: writing to the gz file segfaults for me ##write.dcf(dbi, file = outgz) cat("\n", file=out) } close(out) ##FIXME: writing to the gz file segfaults ##close(outgz) invisible(nrow(db)) } ## To manually run/debug write_VIEWS() on the central builder (e.g. on ## nebbiolo2), start R-4.1 from the biocpush account and do: ## library(BiocManager) # check that the Bioconductor version is correct ## repositories() # check that all the repositories are correct ## library(biocViews) ## reposRoot <- "~/PACKAGES/3.14/bioc" ## manifestFile <- "~biocbuild/bbs-3.14-bioc/manifest/software.txt" ## meatPath <- "~biocbuild/bbs-3.14-bioc/MEAT0" ## setwd(reposRoot) ## write_VIEWS(reposRoot, manifestFile=manifestFile, meatPath=meatPath) write_VIEWS <- function(reposRootPath, fields = NULL, verbose = FALSE, vignette.dir="vignettes", manifestFile=NA, meatPath=NA ) { ## Copied from tools::write_PACKAGES if (is.null(fields)) fields <- c("Title", "Description", "biocViews", "Author", "Maintainer", "URL", "License", "SystemRequirements", "organism", "manufacturer", "hasReadme", "VignetteBuilder", "Video", "BugReports", "PackageStatus", "git_url", "git_branch", "git_last_commit", "git_last_commit_date", "Date/Publication") ## Read REPOSITORY file for contrib path info reposInfo <- read_REPOSITORY(reposRootPath) provided <- strsplit(reposInfo[, "provides"], ",")[[1L]] fields = unique(c(tools:::.get_standard_repository_db_fields("source"), tools:::.get_standard_repository_db_fields("mac.binary"), tools:::.get_standard_repository_db_fields("win.binary"), fields)) convertToMat <- function(reposRootPath, reposInfo, os, fields, verbose){ ## Use code from tools to build a matrix of package info pkg.dir <- file.path(reposRootPath, reposInfo[, os]) if(grepl(os, pattern="mac.*.binary")) os = "mac.binary" if(grepl(os, pattern="win.binary")) os = "win.binary" db <- tools:::.build_repository_package_db(pkg.dir, fields, os, verbose) ## Turn 'db' into a matrix with 1 row per package if (length(db) != 0L) { dbMatTemp <- do.call(rbind, db) } else { dbMatTemp <- matrix(nrow=0L, ncol=length(fields)) colnames(dbMatTemp) <- fields } dbMatTemp } # get standard list of fields information for packages os = provided[1] dbMat = convertToMat(reposRootPath, reposInfo, os, fields, verbose) if (length(provided) > 1){ otheros = provided[-1] for(os in otheros){ dbMat2 = convertToMat(reposRootPath, reposInfo, os, fields, verbose) idx = !(dbMat2[,"Package"] %in% dbMat[, "Package"]) if (length(which(idx)) != 0){ tempMat = dbMat2[idx,] dbMat = rbind(dbMat, tempMat) } } } ## Integrate version and archive file path info for the different contrib ## paths in this repos. We duplicate the source path info here, but that ## makes things easier to handle later on as there is no special case. fldNames <- c(colnames(dbMat), paste(provided, "ver", sep=".")) dbMat <- cbind(dbMat, matrix(NA, nrow=nrow(dbMat), ncol=length(provided))) colnames(dbMat) <- fldNames for (ctype in provided) { cPath <- reposInfo[, ctype] buildPkgPath <- function(pkgs, vers) { ext <- switch(ctype, 'source'=".tar.gz", 'win.binary'=".zip", 'mac.binary'=, 'mac.binary.big-sur-x86_64'=, 'mac.binary.big-sur-arm64'=, 'mac.binary.mavericks'=, 'mac.binary.el-capitan'=".tgz", stop("unknown type")) paste(cPath, "/", pkgs, "_", vers, ext, sep="") } packagesFile <- file.path(reposRootPath, cPath, "PACKAGES") if (!file.exists(packagesFile)) { warning("No PACKAGES file found at ", file.path(reposRootPath, cPath), "\nSkipping this contrib path.") next } readOk <- tryCatch({ cDat <- read.dcf(packagesFile) TRUE }, error=function(e) FALSE) if (!readOk) next if (!length(cDat)) { warning("Empty PACKAGES file found at ", file.path(reposRootPath, cPath), "\nSkipping this contrib path.") next } cDatGood <- cDat[, "Package"] %in% dbMat[, "Package"] dbMatIdx <- match(cDat[cDatGood, "Package"], dbMat[, "Package"]) dbMatIdx <- dbMatIdx[!is.na(dbMatIdx)] col <- paste(ctype, "ver", sep=".") dbMat[dbMatIdx, col] <- buildPkgPath(cDat[cDatGood, "Package"], cDat[cDatGood, "Version"]) if (length((grep("^win",ctype,value=TRUE)) > 0) && ("Archs" %in% colnames(cDat))) { which1 <- which(dbMat[,"Package"] %in% cDat[,"Package"]) which2 <- which(cDat[,"Package"] %in% dbMat[,"Package"]) dbMat[which1, "Archs"] <- cDat[which2, "Archs"] } } ## Add vignette path info vigs <- getFileLinks(dbMat[, "Package"], reposRootPath, vignette.dir, "pdf") vtitles <- getDocumentTitles(vigs, reposRootPath=reposRootPath, fun=getPdfTitle) rfiles <- getFileLinks(dbMat[, "Package"], reposRootPath, vignette.dir, "R") htmlDocs <- getFileLinks(dbMat[, "Package"], reposRootPath, vignette.dir, "html", TRUE) htmlDocs[grep("\\/index\\.html$", htmlDocs)] <- NA htmlTitles <- getDocumentTitles(htmlDocs, ext="html", src=c("Rmd", "Rhtml"), reposRootPath, getHtmlTitle) allVigs <- paste(vigs, htmlDocs, sep=", ") allTitles <- paste(vtitles, htmlTitles, sep=", ") formatVec <- function(vec){ vec <- gsub(pattern="NA, NA", replacement=NA, vec) vec <- gsub(pattern="^NA, ", replacement="", vec) vec <- gsub(pattern=", NA$", replacement="", vec) vec } allVigs <- formatVec(allVigs) allTitles <- formatVec(allTitles) names(allVigs) <- names(vigs) names(allTitles) <- names(vtitles) # get any included extra files readmes <- getFileExistsAttr(dbMat[, "Package"], reposRootPath, "readmes", "README") news <- getFileExistsAttr(dbMat[, "Package"], reposRootPath, "news", "NEWS") install <- getFileExistsAttr(dbMat[, "Package"], reposRootPath, "install", "INSTALL") license <- getFileExistsAttr(dbMat[, "Package"], reposRootPath, "licenses", "LICENSE") # add additional values to matrix for writing dbMat <- cbind(dbMat, allVigs) dbMat <- cbind(dbMat, allTitles) dbMat <- cbind(dbMat, readmes) dbMat <- cbind(dbMat, news) dbMat <- cbind(dbMat, install) dbMat <- cbind(dbMat, license) dbMat <- cbind(dbMat, rfiles) colnames(dbMat) <- c(fldNames, "vignettes", "vignetteTitles", "hasREADME", "hasNEWS", "hasINSTALL", "hasLICENSE", "Rfiles") # get reverse dependency list including CRAN all_repos <- repositories() all_pkgs <- available.packages(repos = all_repos) mm = match(dbMat[,"Package"], all_pkgs[,"Package"]) dependsOnMe <- getReverseDepends(all_pkgs, "Depends")[mm] dbMat <- cbind(dbMat, dependsOnMe) importsMe <- getReverseDepends(all_pkgs, "Imports")[mm] dbMat <- cbind(dbMat, importsMe) suggestsMe <- getReverseDepends(all_pkgs, "Suggests")[mm] dbMat <- cbind(dbMat, suggestsMe) linksToMe <- getReverseDepends(all_pkgs, "LinkingTo")[mm] dbMat <- cbind(dbMat, linksToMe) # add (recursive) dependency count for badge on landing page bioc_pkgs <- available.packages(repos = all_repos[setdiff(names(all_repos), "CRAN")] ) deps <- tools::package_dependencies(rownames(bioc_pkgs), db = all_pkgs, recursive=TRUE) numDeps <- lengths(deps) dependencyCount <- numDeps[dbMat[, "Package"]] dbMat <- cbind(dbMat, dependencyCount) # Add place Holder for valid packages compared to manifest # That haven't built so they get a shell landing page rather # than no landing page if (!is.na(manifestFile)){ if(file.exists(manifestFile)){ file = readLines(manifestFile) fmtFile = vapply(file, FUN = function(vl){ if(startsWith(vl, "Package")){ trimws(gsub(vl, pattern="Package: ", replacement="")) }else{ "" }}, FUN.VALUE=character(1), USE.NAMES=FALSE) man_pkgs = fmtFile[-which(fmtFile=="")] missing_pkgs = man_pkgs[!(man_pkgs %in% unname(dbMat[,"Package"]))] add_mat = matrix(NA, nrow=length(missing_pkgs), ncol=ncol(dbMat)) rownames(add_mat) = missing_pkgs colnames(add_mat) = colnames(dbMat) # manually fill info for missing packages add_mat[,which(colnames(dbMat)=="Package")] = missing_pkgs if (!is.na(meatPath)){ for(i in seq_along(missing_pkgs)){ add_mat = tryCatch({ desc <- tools:::.read_description(file.path(meatPath, missing_pkgs[i], "DESCRIPTION")) for (dx in names(desc)){ if (dx %in% colnames(add_mat)){ add_mat[i, which(colnames(add_mat) == dx)] = desc[dx] }else{ # check for Authors@R and parse accordingly if (dx == "Authors@R"){ authMain <- tools:::.expand_package_description_db_R_fields(desc) add_mat[i,which(colnames(dbMat)=="Maintainer")] = authMain["Maintainer"] add_mat[i,which(colnames(dbMat)=="Author")] = authMain["Author"] } } } add_mat }, error = function(err){ add_mat[i,which(colnames(dbMat)=="Maintainer")] = "ERROR" add_mat[i,which(colnames(dbMat)=="Title")] = "ERROR" add_mat }, warning = function(err){ add_mat[i,which(colnames(dbMat)=="Maintainer")] = "ERROR" add_mat[i,which(colnames(dbMat)=="Title")] = "ERROR" add_mat }) } } # make sure necessary columns are not NA if (any(is.na(add_mat[,"Title"]))){ add_mat[which(is.na(add_mat[,"Title"])), "Title"] = "ERROR" } if (any(is.na(add_mat[,"Maintainer"]))){ add_mat[which(is.na(add_mat[,"Maintainer"])), "Maintainer"] = "ERROR" } dbMat = rbind(dbMat, add_mat) } } .write_repository_db(dbMat, reposRootPath, "VIEWS") } getReverseDepends <- function(db, fieldName) { pkgNames <- db[, "Package"] names(pkgNames) <- NULL df <- as.data.frame(db, stringsAsFactors=FALSE) depCols <- lapply(pkgNames, function(x) { pkgRecord <- subset(df, Package==x) pkgNames %in% getDcfValues(pkgRecord[fieldName]) }) depMat <- do.call(cbind, depCols) colnames(depMat) <- rownames(depMat) <- pkgNames ret <- character() bar <- function(x) { deps <- pkgNames[which(depMat[x, ])] ret <- c(ret, unlist(paste(deps, collapse=", "))) } ret <- lapply(pkgNames, bar) unlist(ret) } writeRFilesFromVignettes <- function(reposRoot, reposUrl="..", viewUrl="../..", reposFullUrl=reposUrl, downloadStatsUrl="", devHistoryUrl="") { pkgList <- loadPackageDetails(reposRoot, reposUrl, viewUrl, reposFullUrl, downloadStatsUrl, devHistoryUrl) StangleHTMLVignettes(reposRoot) } .printf <- function(...) print(noquote(sprintf(...))) StangleHTMLVignettes <- function(reposRoot) { viewsFile <- file.path(reposRoot, "VIEWS") pkgMat <- readPackageInfo(viewsFile) info <- read.dcf(file=viewsFile) apply(info, 1, function(x){ if (!is.na(x["vignettes"])) { if (!requireNamespace("knitr")) { stop("'knitr' package required to tangle HTML vignettes") } docs <- strsplit(x["vignettes"], ",\n")[[1]] docs <- docs[endsWith(docs, "html")] for (doc in docs) { vig <- sub("\\.html", ".Rmd", doc, ignore.case=TRUE) out <- sub("\\.html", ".R", doc, ignore.case=TRUE) if (file.exists(vig)) tryCatch(knitr::purl(vig, out), error=function(e){ print(e) }) } } }) } writeRepositoryHtml <- function(reposRoot, title, reposUrl="..", viewUrl="../..", reposFullUrl=reposUrl, downloadStatsUrl="", devHistoryUrl="", link.rel=TRUE, backgroundColor="transparent") { ## Writes package description html under reposRoot/html and an index.html ## file under reposRoot. ## ## Links created in the package description html will use reposUrl as ## prefix. pkgList <- loadPackageDetails(reposRoot, reposUrl, viewUrl, reposFullUrl, downloadStatsUrl, devHistoryUrl) writePackageDetailHtml(pkgList, file.path(reposRoot, "html"), backgroundColor=backgroundColor) writeRepositoryIndexHtml(pkgList, reposRoot, title, link.rel=link.rel) ## copy the css stylesheet cssName <- "repository-detail.css" cssPath <- system.file(file.path("css", paste(cssName, ".in", sep="")), package="biocViews") res <- try(copySubstitute(cssPath, file.path(reposRoot, cssName), symbolValues=list("BACKGROUND_COLOR"=backgroundColor)), silent=TRUE) res } writePackageDetailHtml <- function(pkgList, htmlDir="html", backgroundColor="transparent") { if (!file.exists(htmlDir)) dir.create(htmlDir) for (pkg in pkgList) { f <- file.path(htmlDir, htmlFilename(pkg)) cat("writing html for", pkg@Package, "\n") writeHtmlDoc(htmlDoc(pkg), f) } ## copy the package detail css stylesheet cssName <- "package-detail.css" cssPath <- system.file(file.path("css", paste(cssName, ".in", sep="")), package="biocViews") res <- try(copySubstitute(cssPath, file.path(htmlDir, cssName), symbolValues=list("BACKGROUND_COLOR"=backgroundColor)), silent=TRUE) res } writeRepositoryIndexHtml <- function(pkgList, reposRoot, title, htmlDir="html", link.rel=TRUE) { if (link.rel) linkRoot <- character(0) else linkRoot <- reposRoot repos <- new("RepositoryDetail", Title=title, reposRoot=linkRoot, htmlDir=htmlDir, packageList=pkgList) f <- file.path(reposRoot, htmlFilename(repos)) writeHtmlDoc(htmlDoc(repos), f) } write_SYMBOLS <- function(dir, verbose=FALSE, source.dirs=FALSE) { con <- file(file.path(dir, "SYMBOLS"), open="w") tdir <- tempfile("NAMESPACES") dir.create(tdir) on.exit(file.remove(tdir, recursive=TRUE)) extractNAMESPACEFromTarball <- function(tarball, unpackDir=tdir) { ## helper function to unpack NAMESPACE file from the tarball ret <- unpack(tarball, unpackDir, "'*/NAMESPACE'") #if (ret != 0) # warning("tar had non-zero exit status for NAMESPACE extract of: ", # tarball) } writeField <- function(field, v) { ## Helper function for writing DCF if (length(v)) { vals <- paste(v, collapse=", ") field <- paste(field, ":", sep="") writeLines(paste(field, vals), con=con) } } if (!source.dirs) { tarballs <- list.files(file.path(dir, "src/contrib"), pattern="\\.tar\\.gz$", full.names=TRUE) for (t in tarballs) { extractNAMESPACEFromTarball(t) } dir <- tdir } pkgs <- list.files(dir) for (p in pkgs) { syms <- tryCatch(parseNamespaceFile(p, dir), error=function(e) character(0)) numSyms <- (length(syms$exports) + length(syms$exportMethods) +length(syms$exportClasses)) if (numSyms > 0) { writeField("Package", p) writeField("Exports", syms$exports) writeField("ExportMethods", syms$exportMethods) writeField("ExportClasses", syms$exportClasses) writeLines("", con=con) } if (verbose) cat(p, numSyms, "symbols\n") } close(con) NULL } biocViews/R/show-methods.R0000644000175200017520000000075414710217211016475 0ustar00biocbuildbiocbuildsetMethod("show", signature(object="BiocView"), function(object) { cat("Bioconductor View:", object@name, "\n") cat("Parent Views:\n") print(object@parentViews) cat("Subviews:\n") print(object@subViews) cat("Contains packages:\n") if (length(object@packageList)) print(names(object@packageList)) else cat("\n") }) biocViews/R/showvoc.R0000644000175200017520000000066414710217211015544 0ustar00biocbuildbiocbuild showVoc <- function(g,outfile=tempfile()) { top <- adj(g, nodes(g)[1])[[1]] dd <- xmlTree("a") dd$addTag("body", close=FALSE) for (i in 1:length(top)) { dd$addTag("H2", top[i]) nxt <- adj(g, top[i])[[1]] if (length(nxt)>0) { dd$addTag("UL", close=FALSE) for (j in 1:length(nxt)) dd$addTag("LI", nxt[j]) dd$closeTag() } } dd$closeTag() cat(saveXML(dd$value()),sep="\n",file=outfile) } biocViews/R/validation_tests.R0000644000175200017520000000112214710217211017416 0ustar00biocbuildbiocbuild## These are test functions that can be called from the unit tests of any BioC ## package. validate_bioc_views <- function(pkg) { bvStr <- packageDescription(pkg)$biocViews checkTrue(!is.null(bvStr), paste("No biocViews defined for package", pkg)) bvStr <- gsub(" ", "", bvStr) views <- strsplit(bvStr, ",")[[1]] biocViewsVocab <- NULL data("biocViewsVocab", envir=environment()) nodes <- nodes(biocViewsVocab) for (view in views) { checkTrue(view %in% nodes, paste("Invalid view", view, "in package", pkg)) } invisible(NULL) } biocViews/README.md0000644000175200017520000000071714710217211015006 0ustar00biocbuildbiocbuild[](https://bioconductor.org/) **biocViews** is an R/Bioconductor package that implements the infrastructure to support _views_ used to classify Bioconductor packages. See https://bioconductor.org/packages/biocViews for more information including how to install the release version of the package (please refrain from installing directly from GitHub). biocViews/build/0000755000175200017520000000000014710271425014630 5ustar00biocbuildbiocbuildbiocViews/build/vignette.rds0000644000175200017520000000037114710271425017170 0ustar00biocbuildbiocbuild‹‹àb```b`aad`b2™… @Ä84¯‡xˆ¿®“s˜^Pn TP8¹(5±$5(µ ¿Ø£$7,…ª?)3?9,3µ¼XlTX!ìŒ0#³$¿¨Ò#Ä×Í>„å@k ¢"趃åPur#9*$ˆáhOÀz zhâ, 1F¨¬y‰¹©ÅPI6¨ ‹[fN*LAHf œÃàâe2œÄî’Zš—R årx§V–çù¨qå—ëÁ,㹬Hüÿÿÿº‹’s‹a.‚ r¥$–$ê¥õyÿcWöbiocViews/data/0000755000175200017520000000000014710217211014433 5ustar00biocbuildbiocbuildbiocViews/data/biocViewsVocab.rda0000644000175200017520000001265314710217211020037 0ustar00biocbuildbiocbuild‹í]x$Iuž·+iVqÓÝgœ#X#Ý»i¤•Ä­¤9nï|¶jzjfú¶Ã\­fmÀãœ1΃McÀ9aœm0¶1Îç|ç¿zºª«ºgùNrºïc>¾ÿvûUuÕ«W¯êýoº¶Ø[{`yòÉR©t²4rÿÅ_K£÷í_yÊ¥Riä¨4RšÀŸ3 Û·®ÙüFxÍ·X£D'oÏÕõü&ñ—9Èþ6N¬Ê×RÁxÍoE7XÀe»+žçG,²}oELJ×»<°]îEštü~?¸ÞrüéóÔJ²Þšï2ÛKE“ûÜêx¾ã·{©dz‡œVçŠÍf*\€Z¨c[̹7æ¡è=-9-û¨E¼+kKÙ6óX› ­Ò’ùšPmu|ÙÁÌ–× X±Åj°µŽíõVº]iVÙØLÿ>[ᎳÊBÞL†¥ VélU­Ž-•9Sñ»½Ømðà l¦é>Qénl…ó”k;+B­žcT[?ô½• `ÒD3Üã°xÀÃ0«¶ ¤YÒKÃvìHÖ?YÛ©JëîÌ ­ÀîjLÖøÃ1÷,ÛkKɶm>Óúœ¾{Vz‘ïò(¹m†µ.·¢À<\­ì¥?›4ÙQÀ«OŒ%ëÕV6ÖÓ¿Uö¶jÕ=¥”q¸0q*9UëÂ(L>Ž6›Yç2§ÜŒ9=—ùf±ðÔÊþJ×J`²§ñµLoö|jÏnøZå=½ò)1ïz¡þ4ÑŸU­iÌ©«5=êÚhM¹óÚ<Ðj×\æ8Y…þô`…»rS÷w|‡Ã2Ñé5<ø†ìì> Ú<âM±Èrs~¦_?sìµÙ´?æÔ¢ [¼'7íŠtªþ›5+àÜSKaÛ´ßøUßkïq&ÝýôvìDv¥Ã<ËyÜõxN²Ã7%sÚÑ×ŬkÔëbLºx:ÑÖ3Ö AÁË'+X¸»^%[¾·íñ„¼ÚÁPªpdn}ÎíÛaóBKgQ·ذmüçÖîú ·Bk½í‡!’ÙÑÜzÿ‘Ïfu°E)ŸÞ`‰-ÛÉÒnI>þƒ"fÅŽØTÛpz˜^wÙ¡\½›a=d];Ëãf7ý É¡ÉAì´³Üùì=NÜCXöÝ6îº#v[ø Z6zÕL?“¹‚C)'ZØf`Ibùux½Úœ©¦*ßöëØ<ì“xOÚiÛ?b9°aXÇÔðä—9’mŒØCô®[§;áÒÅë 4â·ÕL¼|ñ:0Ë y•dãï¾´(get3Þ]ÊŒv£)0j{M&›™µÓU²»Ì;(/åÅÛ~rU{>'îÊ‚iY€M4kû™ì&Kòžˆi*¦Dͤ»ke]”´iŠúµ¤RB„TS®é½î’ùhN‡ë.Ý•›Ž1·?í.å‚ý§Ì“ç†QÚÈ•ZF©¥J'ÝÔ /*/tZÊ\*(—:åúü®åÅÜ£r WØ‚¬‹TÀ2I—7ú£n\.þ& Mp9_ãòÀjùmÇå‹j–ñ´´¤ÖÀ˜«{àÒQ$ž—/)?ÙE",¾ˆy•ïL)­.ËÉÊDjÿ™yD‡#s2ýéT`zAÀø’fÅþc#{Œ–2ŽíxY9@ÿ©a<©e$³¥7l¸×hà¡¶Üí÷ü¢piqñb![ ¢¬æX Ûk¤¶¹ö l_ì—‡Ë*2öƒ­ÇzŒSf´×/_’úÞ䀵찣v'«m——¤;Š½Ý¾”eʵ¶þéâ¤ÕlÉŠ"Ú­I£œl6ä|œÞòD¶áùvSOÊ MIF!QãUßéU;jýv_Ñž‘ÚÖ•}©lm§ þ£‚ÙH­MÑÈþ¡jvl›ÃpòiäÊÞ¶üv3m|«’Z¬Ç⑵Õôù¬È;}$õvÃáòƒhZ6#>ˆŒ¼†¼VEæÓj˜™ž¿Ñ±ëýLöÁU«9«}™Õ?ëŠßZÀ=üÀ¨¬å’šx¬ÿ%DÙµÿåA>ß¡Ækwµ{É'Jìh?æŽË,•ýû?¤¥ç Ùk]Ó匙ÂêEŠy¬^|û dV¯p¾´ê¥³Y檋Ÿ08}5ô*æ°zñ¹|"k¾[H[õâ9-5ÕåO¼E~j4]LRõâ;fª†âùtU/\0rVÃbƒWcXZöªËçõV/8›Ëcy”Ì.e¦­†Š¹«Y\H` Lb陬ዅtV/½m@Nk4«'¶FžÝÌ¥¸Æ0æ¹Æ”Nv2^½ôI·J{ =æ¾z;o™íší Jyµžå½†Ù$¿Æ ‰®áff¶k™)¯ábżW/ž–ɯ.œÄŽê´esëš~|§²[]Ó×Ûj b{áµÙ ‰WÏÝc7=Þ+È®òø:wmV(™¹{í‚t~÷ ù†Ql¨*¶ñâ+Æa}•oÚíÎ~'ðãv§GéwxÝÃóßäu{ˆS-úD:Ù¢×§[tóV66õÑf§ntiv’@_:·81 OgÿèŠ.ÙËK¦Ò3*F¥¼dZUÑ©„<¯¢É&’3+ú›êÜŠþ¦<»Rdr~Å0ˆ:ó£ëœžûÑ=K?7¢7Ñ¥Ùùc¢sgHô…–;GblÅúY}ìîáLvœD»·:R¢«—?V¢ûÝ £%(ž8Ó5U§Îtß•ÍçK¿Êè o“u·™¤ÿ'7Ö凲Ӊúé;²x§"?’Ü‘~íÛ?I¿G‰VL}•Kù!¸uyqq±ÏúU>±¾SÙ]“‡Ä¦³\òeóè„>ÔUÚVîâBFÀs%çÍsuù÷2÷̦̕.š_Ð?Ñ{Q˜+>£»Éw•Ûɕ܆d ¡ý÷Æ<èA¡\ùšÈÓ´—*ÍåÍ6¿Z*8“MþD!Œ Œ¢òÉô³¥Ì•gKÍ…ð‘\kÉ< '›fú,¹N ×JëÌô{yô(¾xðjà5Àkׯ޼ñ¨B;‚œ" Žpó¨ bˆô§ÀŸüð—À_ ¼øàýýI8rã¥Ù´ò¼p+áubsÎ GN*œ ¸ý¨ Üxð\àyÀóÏ>øà /¾øbàK€/Ð, yÔÁ‰µöeÀ—/¾x1ð•ÀW_ | ðµÀ×_ÿ:(t"ñÛ€—ß|ðÀwß |ð½À÷ßüðƒÀ? ¼ ø‘£ŽLìQ/^ü(ðcQó£ÀèP,­>øXàãJ}ßùà)ÀSO2°,w»§—€ËÀ'Ÿ |Êqö€Ož|ð `X*À°\6Ž3ŸâÏÍÿsñøAa¿án4"þáÊ7ß|3ð-À·±Ñ‚V/yœº¡¡¨Xå¿ üðàwß~x'ð.à€wüðÇÀ{€?Þ €1”ÀJ` %0†C Œ¡ÆPzÆPúqàMÀOoÞ¼øIà§€Ÿ~øYà瀟~øEà—€_Þü ðvàW_~ø à7ß:Înô~T¦ôwÀßÿü#ðOÀ?ÿü+ðoGm\Ðþã¸ÛØ÷ÅGŽªªÏö ÿ!¼LàÒ„8EX6L`Ã$ø&"°aTšð>Í`v„ΕÀìHðt0;³#„³#ð'³#5Q#5Q£;5z2¢F j¢F j¢F j„ðE_„ðE_„ðE_„ðEO¾h@ø"„/‚cÂ!|Â!|Â!|Â!|Â!ÑÓD#z€hDˆF„hDˆF„hDˆF„hD,þGàþGàþG;øUð?ÿ#ð?ÿ#ð?ÿ#ð?ÿ#ð?ÿ#ð?ÿ#ð?zþGÏØQ'O‹0‰ŽEàƒ>Hàƒ>Hàƒ>Hàƒ>HàƒäàƒÔÀ)xœnUC ñcA‰É!ù!$?ôÉ=xþQW§Øž°BÂBHX !a!$,êB`æA`æA`ôy ½@^BÈKy !/!ä%„¼„—òB^BÈKy !/!ä%ô2Y!K#di„,¥²4B–FÈÒY!K#$Y„$‹^ É¢u"V ¢—¯8Æ/#ô:àõÀ€7` ô&lÞ ¼åʨ ÊÐ;Ú€p‚wà>ôn܇À}܇Þs *@ KôÞÂm¶`U$¼„„—^ ¼ x5ðàµÿÃÆÉÓ"zë7Kt|•ÀW |•ÀW |•ÀW |•ÀW |•ÀW |•ÞvœŸß@péí.à.à.àÈ:¬Ó;>|IàðN€áÃ;†w ïÞ PÞ 0¼ }qx'ÀðN€áÃ;†w ïÞ 0¼`x'ÀðN€áÃ;†w ïè“¥áÚÓðNñ4¼`x'ÀðN€á¥á²dx'ÀðN€áÃ;†w ïÞ 0¼ LJw ïÞ —òðN€ÿï;ä©PuÜu\wMìYü¿”i yÿ™—òï5y‹a†·(µÄWÏRéÄœþB7+ŸêöÓRî(n[|Ê,ÇY³¶£2{ÔTæTîyüѬÏDá,ðR`SÐä8~”©p"×eñXñÀBÙϠ°¬Ü‹…èºc(Iaßê@µa¨¦`íò[ýôÄ‹À yÖxÑØI';ëW£†¥Gþ 1UEs mbiocViews/inst/0000755000175200017520000000000014710217211014477 5ustar00biocbuildbiocbuildbiocViews/inst/css/0000755000175200017520000000000014710217211015267 5ustar00biocbuildbiocbuildbiocViews/inst/css/package-detail.css.in0000644000175200017520000000121514710217211021240 0ustar00biocbuildbiocbuildbody { background-color: @BACKGROUND_COLOR@; margin-left:15%; margin-right:15%; } p.description { background-color: #CE8; padding:10px; } tr.row_odd { background-color: #FFF; } tr.row_even { background-color: #DDD; } td { vertical-align: top; padding-right:10px; padding-left:4px; } th { text-align: right; padding-right:10px; padding-left:4px; font-weight:normal; } h3 { margin-bottom: 2px; } table.vigsAndDownloads { margin-left: 10%; margin-right: 10%; } table.author_info { margin-bottom: 20px; } div.installInstruct { background-color: #FFF; } biocViews/inst/css/repository-detail.css.in0000644000175200017520000000065214710217211022070 0ustar00biocbuildbiocbuildbody { background-color: @BACKGROUND_COLOR@; margin-left:10%; margin-right:10%; } p.description { background-color: #CE8; margin-right:20%; } tr.row_odd { background-color: #FFF; } tr.row_even { background-color: #DDD; } td { padding-right:10px; padding-left:4px; } th { text-align: left; padding-right:10px; padding-left:4px; font-weight:bold; } biocViews/inst/doc/0000755000175200017520000000000014710271425015253 5ustar00biocbuildbiocbuildbiocViews/inst/doc/HOWTO-BCV.R0000644000175200017520000000167314710271424016714 0ustar00biocbuildbiocbuild## ----include=FALSE------------------------------------------------------------ library(biocViews) ## ----Establishing a vocabulary of terms, echo=TRUE, message=FALSE, warning=FALSE---- vocabFile <- system.file("dot/biocViewsVocab.dot", package="biocViews") cat(readLines(vocabFile)[1:20], sep="\n") cat("...\n") ## ----Querying a repository, echo=TRUE, message=FALSE, warning=FALSE----------- data(biocViewsVocab) reposPath <- system.file("doc", package="biocViews") reposUrl <- paste("file://", reposPath, sep="") biocViews <- getBiocSubViews(reposUrl, biocViewsVocab, topTerm="Software") print(biocViews[1:2]) ## ----getSubTerms, message=FALSE, warning=FALSE-------------------------------- getSubTerms(biocViewsVocab, term="Technology") ## ----Generating HTML, echo=TRUE, message=FALSE, warning=FALSE----------------- viewsDir <- file.path(tempdir(), "biocViews") dir.create(viewsDir) writeBiocViews(biocViews, dir=viewsDir) dir(viewsDir)[1:2] biocViews/inst/doc/HOWTO-BCV.Rmd0000644000175200017520000001221214710217211017216 0ustar00biocbuildbiocbuild--- title: "HOWTO generate biocViews HTML" author: "S. Falcon and V.J. Carey" date: "`r format(Sys.time(), '%B %d, %Y')`" vignette: > %\VignetteIndexEntry{biocViews-HOWTO} %\VignetteEncoding{UTF-8} %\VignetteEngine{knitr::rmarkdown} output: BiocStyle::html_document: number_sections: true toc: yes toc_depth: 2 editor_options: markdown: wrap: 72 --- ```{r include=FALSE} library(biocViews) ``` # Overview The purpose of *biocViews* is create HTML pages that categorize packages in a Bioconductor package repository according to terms, or *views*, in a controlled vocabulary. The fundamental resource is the VIEWS file placed at the root of a repository. This file contains the complete DESCRIPTION file contents for each package along with additional meta data describing the location of package artifacts such as archive files for different platforms and vignettes. The standard behavior of the view generation program is to query the repository over the internet. This package includes a static sample VIEWS file so that the examples in this document can run without internet access. # Establishing a vocabulary of terms We use `dot` to describe the vocabulary. For details on the `dot` syntax, see . ```{r Establishing a vocabulary of terms, echo=TRUE, message=FALSE, warning=FALSE} vocabFile <- system.file("dot/biocViewsVocab.dot", package="biocViews") cat(readLines(vocabFile)[1:20], sep="\n") cat("...\n") ``` The dot description is transformed to a GXL document using `dot2gxl`, a tool included in the graphviz distribution. The GXL is then converted to a *graphNEL* instance using `fromGXL` from the *graph* package. There is a helper script in the root of the *biocViews* package called `updateVocab.sh` that automates the update process if the required tools are available. The script will also attempt to dump the ontology graph into a local SQLite database using tools from *DBI* and *RSQLite*. The information in this database can be used to create a dynamic HTML representation of the graph by means of a PHP script. The definition of the vocabulary lacks a notion of order. Since the purpose of the vocabulary is primarily for display, a valuable improvement would be to use graph attributes to allow the ordering of the terms. Another missing piece is a place to put a text description of each term. This could also be achieved using graph attributes. ## Use Case: adding a term to the vocabulary To add a new term to the vocabulary: 1. edit the *dot* file `dot/biocViewsVocab.dot` and add the desired term. Note that terms cannot contain spaces and that the underscore character, `_`, should be used instead. 2. ensure that R and dot2gxl are on your PATH. 3. cd into the biocViews working copy directory. 4. run the updateVocab.sh script. 5. reinstall the package and test that the new term is part of the vocabulary. In short, you will load the data using `data(biocViewsVocab)` and check that the term is a node of the graph instance. 6. commit changes to svn. ## Use Case: updating BioConductor website This is for BioConductor web administrator: 1. update local copy of biocViews using `svn update`. 2. find the correct instance R that is used to generate HTML pages on BioConductor website, and install the updated `biocViews`. 3. re-generate the related HTML packages by using `/home/biocadmin/bin/prepareRepos-*.sh` and `/home/biocadmin/bin/pushRepos-*.sh`. # Querying a repository To generate a list of *BiocViews* objects that can be used to generate HTML views, you will need the repository URL and a graph representation of the vocabulary. There are three main Bioconductor package repositories: a software repository containing analytic packages, an annotation data repository, and an experiment data repository. The vocabulary of terms has a single top-level node, all other nodes have at least one parent. The top-level node, *BiocViews*, has three children that correspond to the three main Bioconductor repositories: *Software*, *AnnotationData*, and *ExperimentData*. Views for each repository are created separately using `getBiocSubViews`. Below, we demonstrate how to build the *Software* set of views. ```{r Querying a repository, echo=TRUE, message=FALSE, warning=FALSE} data(biocViewsVocab) reposPath <- system.file("doc", package="biocViews") reposUrl <- paste("file://", reposPath, sep="") biocViews <- getBiocSubViews(reposUrl, biocViewsVocab, topTerm="Software") print(biocViews[1:2]) ``` To query the currently available vocabulary terms, use function `getSubTerms` on the *graphNEL* object `biocViewsVocab`. The second argument of this function takes a character of the base term for which all subterms should be returned. For a complete list use `term="BiocViews"`. ```{r getSubTerms, message=FALSE, warning=FALSE} getSubTerms(biocViewsVocab, term="Technology") ``` # Generating HTML By default, the set of HTML views will link to package description pages located in the html subdirectory of the remote repository. ```{r Generating HTML, echo=TRUE, message=FALSE, warning=FALSE} viewsDir <- file.path(tempdir(), "biocViews") dir.create(viewsDir) writeBiocViews(biocViews, dir=viewsDir) dir(viewsDir)[1:2] ``` biocViews/inst/doc/HOWTO-BCV.html0000644000175200017520000234376114710271425017471 0ustar00biocbuildbiocbuild HOWTO generate biocViews HTML

Contents

1 Overview

The purpose of biocViews is create HTML pages that categorize packages in a Bioconductor package repository according to terms, or views, in a controlled vocabulary. The fundamental resource is the VIEWS file placed at the root of a repository. This file contains the complete DESCRIPTION file contents for each package along with additional meta data describing the location of package artifacts such as archive files for different platforms and vignettes.

The standard behavior of the view generation program is to query the repository over the internet. This package includes a static sample VIEWS file so that the examples in this document can run without internet access.

2 Establishing a vocabulary of terms

We use dot to describe the vocabulary. For details on the dot syntax, see http://www.graphviz.org/doc/info/lang.html.

vocabFile <- system.file("dot/biocViewsVocab.dot", package="biocViews")
cat(readLines(vocabFile)[1:20], sep="\n")
## /* Bioc Views Vocabular Definition in dot format */
## 
## /* How To Process this file:
##    1. Use dot2gxl from graphviz to transform into GXL format.
##    dot2gxl biocViewsVocab.dot > biocViewsVocab.gxl
##    2. use graph::fromGXL to obtain a graphNEL object
## 
## */
## 
## digraph G {
## 
## /****************************************************************************
##  *                               Software                                   *
##  ****************************************************************************/
## BiocViews -> Software;
## 
## /* Software -> AssayDomain */
## Software -> AssayDomain;
## AssayDomain -> aCGH;
## AssayDomain -> CellBasedAssays;
cat("...\n")
## ...

The dot description is transformed to a GXL document using dot2gxl, a tool included in the graphviz distribution. The GXL is then converted to a graphNEL instance using fromGXL from the graph package. There is a helper script in the root of the biocViews package called updateVocab.sh that automates the update process if the required tools are available. The script will also attempt to dump the ontology graph into a local SQLite database using tools from DBI and RSQLite. The information in this database can be used to create a dynamic HTML representation of the graph by means of a PHP script.

The definition of the vocabulary lacks a notion of order. Since the purpose of the vocabulary is primarily for display, a valuable improvement would be to use graph attributes to allow the ordering of the terms.

Another missing piece is a place to put a text description of each term. This could also be achieved using graph attributes.

2.1 Use Case: adding a term to the vocabulary

To add a new term to the vocabulary:

  1. edit the dot file dot/biocViewsVocab.dot and add the desired term. Note that terms cannot contain spaces and that the underscore character, _, should be used instead.
  2. ensure that R and dot2gxl are on your PATH.
  3. cd into the biocViews working copy directory.
  4. run the updateVocab.sh script.
  5. reinstall the package and test that the new term is part of the vocabulary. In short, you will load the data using data(biocViewsVocab) and check that the term is a node of the graph instance.
  6. commit changes to svn.

2.2 Use Case: updating BioConductor website

This is for BioConductor web administrator:

  1. update local copy of biocViews using svn update.
  2. find the correct instance R that is used to generate HTML pages on BioConductor website, and install the updated biocViews.
  3. re-generate the related HTML packages by using /home/biocadmin/bin/prepareRepos-*.sh and /home/biocadmin/bin/pushRepos-*.sh.

3 Querying a repository

To generate a list of BiocViews objects that can be used to generate HTML views, you will need the repository URL and a graph representation of the vocabulary.

There are three main Bioconductor package repositories: a software repository containing analytic packages, an annotation data repository, and an experiment data repository. The vocabulary of terms has a single top-level node, all other nodes have at least one parent. The top-level node, BiocViews, has three children that correspond to the three main Bioconductor repositories: Software, AnnotationData, and ExperimentData. Views for each repository are created separately using getBiocSubViews. Below, we demonstrate how to build the Software set of views.

data(biocViewsVocab)
reposPath <- system.file("doc", package="biocViews")
reposUrl <- paste("file://", reposPath, sep="") 
biocViews <- getBiocSubViews(reposUrl, biocViewsVocab, topTerm="Software")
print(biocViews[1:2])
## $Software
## Bioconductor View: Software 
## Parent Views:
## [1] "BiocViews"
## Subviews:
## [1] "AssayDomain"        "Technology"         "ResearchField"     
## [4] "BiologicalQuestion" "WorkflowStep"       "WorkflowManagement"
## [7] "StatisticalMethod"  "Infrastructure"     "ShinyApps"         
## Contains packages:
## [1] "Ruuid"      "aCGH"       "affycomp"   "affydata"   "affypdnn"  
## [6] "affxparser" "affylmGUI"  "affy"      
## 
## $AssayDomain
## Bioconductor View: AssayDomain 
## Parent Views:
## [1] "Software"
## Subviews:
##  [1] "aCGH"                "CellBasedAssays"     "ChIPchip"           
##  [4] "CopyNumberVariation" "CpGIsland"           "DNAMethylation"     
##  [7] "ExonArray"           "GeneExpression"      "GeneticVariability" 
## [10] "SNP"                 "Transcription"      
## Contains packages:
## <no packages>

To query the currently available vocabulary terms, use function getSubTerms on the graphNEL object biocViewsVocab. The second argument of this function takes a character of the base term for which all subterms should be returned. For a complete list use term="BiocViews".

getSubTerms(biocViewsVocab, term="Technology")
##  [1] "Technology"               "Sequencing"              
##  [3] "Microarray"               "FlowCytometry"           
##  [5] "MassSpectrometry"         "qPCR"                    
##  [7] "MicrotitrePlateAssay"     "SAGE"                    
##  [9] "CRISPR"                   "SingleCell"              
## [11] "Spatial"                  "ddPCR"                   
## [13] "AnnotationHubSoftware"    "ExperimentHubSoftware"   
## [15] "ATACSeq"                  "DNASeq"                  
## [17] "DNaseSeq"                 "RiboSeq"                 
## [19] "RNASeq"                   "ChIPSeq"                 
## [21] "RIPSeq"                   "MethylSeq"               
## [23] "ExomeSeq"                 "miRNA"                   
## [25] "SangerSeq"                "SmallRNA"                
## [27] "Microbiome"               "WholeGenome"             
## [29] "DenovoGenome"             "TargetedResequencing"    
## [31] "DenovoTranscriptome"      "MicrobialStrain"         
## [33] "HiC"                      "PooledScreens"           
## [35] "MNaseSeq"                 "LongRead"                
## [37] "MultiChannel"             "OneChannel"              
## [39] "TwoChannel"               "MethylationArray"        
## [41] "GenotypingArray"          "MicroRNAArray"           
## [43] "mRNAMicroarray"           "ChipOnChip"              
## [45] "ReversePhaseProteinArray" "TissueMicroarray"        
## [47] "ProprietaryPlatforms"     "ImagingMassSpectrometry"

4 Generating HTML

By default, the set of HTML views will link to package description pages located in the html subdirectory of the remote repository.

viewsDir <- file.path(tempdir(), "biocViews")
dir.create(viewsDir)
writeBiocViews(biocViews, dir=viewsDir)
## NULL
dir(viewsDir)[1:2]
## [1] "ATACSeq.html"         "Agroinformatics.html"
biocViews/inst/doc/VIEWS0000644000175200017520000001665514710217211016101 0ustar00biocbuildbiocbuildPackage: RBGL Version: 1.7.0 Depends: graph Title: Test interface to boost C++ graph lib Description: demo of interface with full copy of all hpp defining boost biocViews: GraphsAndNetworks Author: Vince Carey , Li Long Maintainer: Li Long URL: http://www.bioconductor.org License: LGPL source.ver: src/contrib/RBGL_1.7.0.tar.gz vignettes: vignettes/RBGL/inst/doc/RBGL-004.pdf, vignettes/RBGL/inst/doc/RBGL-005.pdf, vignettes/RBGL/inst/doc/RBGL-006.pdf, vignettes/RBGL/inst/doc/RBGL-011.pdf, vignettes/RBGL/inst/doc/RBGL-012.pdf, vignettes/RBGL/inst/doc/RBGL-016.pdf, vignettes/RBGL/inst/doc/RBGL-017.pdf, vignettes/RBGL/inst/doc/RBGL.pdf, vignettes/RBGL/inst/doc/filedep.pdf Package: Rgraphviz Version: 1.9.0 Depends: R (>= 2.1.0), graph Suggests: Biobase, geneplotter, fibroEset, hgu95av2 Title: Provides plotting capabilities for R graph objects Description: Interfaces R with the AT&T GraphViz library to provide the ability for plotting R graph objects from the graph package biocViews: GraphsAndNetworks Author: Jeff Gentry Maintainer: Jeff Gentry License: LGPL SystemRequirements: Graphviz version >= 1.12 source.ver: src/contrib/Rgraphviz_1.9.0.tar.gz vignettes: vignettes/Rgraphviz/inst/doc/Rgraphviz.pdf, vignettes/Rgraphviz/inst/doc/layingOutPathways.pdf Package: Ruuid Version: 1.9.0 Depends: R (>= 2.1), methods Title: Ruuid: Provides Universally Unique ID values Description: A package to provide UUID values in R Author: R. Gentleman Maintainer: R. Gentleman License: LGPL source.ver: src/contrib/Ruuid_1.9.0.tar.gz vignettes: vignettes/Ruuid/inst/doc/Ruuid.pdf Package: aCGH Version: 1.5.0 Depends: R (>= 1.8.0), cluster, survival, multtest, sma Title: Classes and functions for Array Comparative Genomic Hybridization data. Description: Functions for reading aCGH data from image analysis output files and clone information files, creation of aCGH S3 objects for storing these data. Basic methods for accessing/replacing, subsetting, printing and plotting aCGH objects. Author: Jane Fridlyand , Peter Dimitrov Maintainer: Jane Fridlyand License: GPL source.ver: src/contrib/aCGH_1.5.0.tar.gz win.binary.ver: bin/windows/contrib/2.3/aCGH_1.4.0.zip vignettes: vignettes/aCGH/inst/doc/aCGH.pdf Package: affxparser Version: 1.3.0 Depends: R (>= 2.0), Biobase Suggests: affy Title: Affymetrix File Parsing SDK Description: Package for parsing Affymetrix files (CDF, CEL, CHP, BPMAP, BAR) biocViews: DataImport Author: James Bullard, Kasper Daniel Hansen Maintainer: James Bullard License: LGPL-2 source.ver: src/contrib/affxparser_1.3.0.tar.gz Package: affy Version: 1.9.1 Depends: R (>= 2.0.1), Biobase (>= 1.5.0), methods, utils Suggests: tkWidgets (>= 1.2.2), affydata Title: Methods for Affymetrix Oligonucleotide Arrays Description: The package contains functions for exploratory oligonucleotide array analysis. The dependance to tkWidgets only concerns few convenience functions. 'affy' is fully functional without it. biocViews: Microarray, OneChannel, Preprocessing Author: Rafael A. Irizarry , Laurent Gautier , Benjamin Milo Bolstad , and Crispin Miller with contributions from Magnus Astrand , Leslie M. Cope , Robert Gentleman, Jeff Gentry, Conrad Halling , Wolfgang Huber, James MacDonald , Benjamin I. P. Rubinstein, Christopher Workman , John Zhang Maintainer: Rafael A. Irizarry License: LGPL version 2 or newer source.ver: src/contrib/affy_1.9.1.tar.gz win.binary.ver: bin/windows/contrib/2.3/affy_1.8.1.zip vignettes: vignettes/affy/inst/doc/affy.pdf, vignettes/affy/inst/doc/builtinMethods.pdf, vignettes/affy/inst/doc/customMethods.pdf, vignettes/affy/inst/doc/dealing_with_cdfenvs.pdf, vignettes/affy/inst/doc/vim.pdf Package: affycomp Version: 1.7.0 Depends: R (>= 1.8.1), Biobase (>= 1.1.0) Title: Graphics Toolbox for Assessment of Affymetrix Expression Measures Description: The package contains functions that can be used to compare expression measures for Affymetrix Oligonucleotide Arrays. Author: Rafael A. Irizarry and Zhijin Wu with contributions from Simon Cawley , Maintainer: Rafael A. Irizarry License: GPL version 2 or newer source.ver: src/contrib/affycomp_1.7.0.tar.gz win.binary.ver: bin/windows/contrib/2.3/affycomp_1.6.0.zip vignettes: vignettes/affycomp/inst/doc/affycomp.pdf Package: affydata Version: 1.7.0 Depends: R (>= 1.6.2), affy (>= 1.2) Suggests: hgu95av2cdf, hgu133acdf Title: Affymetrix Data for Demonstration Purpose Description: Example datasets of a slightly large size. They represent 'real world examples', unlike the artificial examples included in the package affy. Author: Bioconductor Maintainer: Laurent License: GPL version 2 or newer source.ver: src/contrib/affydata_1.7.0.tar.gz win.binary.ver: bin/windows/contrib/2.3/affydata_1.6.0.zip vignettes: vignettes/affydata/inst/doc/affydata.pdf Package: affylmGUI Version: 1.5.0 Depends: limma, tcltk, affy Suggests: tkrplot, affyPLM, R2HTML, xtable Title: GUI for affy analysis using limma package Description: A Graphical User Interface for affy analysis using the limma Microarray package biocViews: Microarray, OneChannel, DataImport, QualityControl, Preprocessing, Statistics, DifferentialExpression, MultipleComparisons Author: James Wettenhall and Ken Simpson Division of Genetics and Bioinformatics, WEHI. Maintainer: Keith Satterley URL: http://bioinf.wehi.edu.au/affylmGUI/ License: GPL version 2 or newer source.ver: src/contrib/affylmGUI_1.5.0.tar.gz win.binary.ver: bin/windows/contrib/2.3/affylmGUI_1.4.0.zip vignettes: vignettes/affylmGUI/inst/doc/affylmGUI.pdf, vignettes/affylmGUI/inst/doc/extract.pdf Package: affypdnn Version: 1.5.0 Depends: R (>= 1.9.0), affy (>= 1.5), affydata, hgu95av2probe Title: Probe Dependent Nearest Neighbours (PDNN) for the affy package Description: The package contains functions to perform the PDNN method described by Li Zhang et al. Author: H. Bjorn Nielsen and Laurent Gautier (Many thanks to Li Zhang early communications about the existence of the PDNN program and related publications). Maintainer: Laurent License: LGPL source.ver: src/contrib/affypdnn_1.5.0.tar.gz win.binary.ver: bin/windows/contrib/2.3/affypdnn_1.4.0.zip Package: graph Version: 1.9.0 Depends: R (>= 2.1.0), cluster, Ruuid Suggests: SparseM (>= 0.36), XML Title: graph: A package to handle graph data structures Description: A package that implements some simple graph handling capabilities. biocViews: GraphsAndNetworks Author: R. Gentleman, Elizabeth Whalen Maintainer: R. Gentleman License: LGPL source.ver: src/contrib/graph_1.9.0.tar.gz vignettes: vignettes/graph/inst/doc/clusterGraph.pdf, vignettes/graph/inst/doc/graph.pdf biocViews/inst/doc/createReposHtml.R0000644000175200017520000000372114710271425020502 0ustar00biocbuildbiocbuild## ----eval=FALSE--------------------------------------------------------------- # reposRoot <- "path/to/reposRoot" # ## The names are essential # contribPaths <- c(source="src/contrib", # win.binary="bin/windows/contrib/4.0", # mac.binary="bin/macosx/contrib/4.0") ## ----eval=FALSE--------------------------------------------------------------- # extractVignettes(reposRoot, contribPaths["source"]) ## ----eval=FALSE--------------------------------------------------------------- # genReposControlFiles(reposRoot, contribPaths) ## ----eval=FALSE--------------------------------------------------------------- # ## Define classes like this for each logical document chunk # setClass("pdAuthorMaintainerInfo", contains="PackageDetail") # setClass("pdVignetteInfo", contains="PackageDetail") # ## Then define a htmlValue method # setMethod("htmlValue", signature(object="pdDescriptionInfo"), # function(object) { # node <- xmlNode("p", cleanText(object@Description), # attrs=c(class="description")) # node # }) # ## Then you can make use of all this... # ## Assume object contains a PackageDetail instance # authorInfo <- as(object, "pdAuthorMaintainerInfo") # dom$addNode(htmlValue(authorInfo)) ## ----eval=FALSE--------------------------------------------------------------- # details <- list(heading=list(tag="h3", text="Details"), # content="pdDetailsInfo") # downloads <- list(heading=list(tag="h3", text="Download Package"), # content="pdDownloadInfo") # vignettes <- list(heading=list(tag="h3", # text="Vignettes (Documentation)"), # content="pdVignetteInfo") # doSection <- function(sec) { # dom$addTag(sec$heading$tag, sec$heading$text) # secObj <- as(object, sec$content) # dom$addNode(htmlValue(secObj)) # } # lapply(list(details, downloads, vignettes), doSection) biocViews/inst/doc/createReposHtml.Rmd0000644000175200017520000001372514710217211021021 0ustar00biocbuildbiocbuild--- title: "HOWTO generate repository HTML" author: "S. Falcon" date: "`r format(Sys.time(), '%B %d, %Y')`" vignette: > %\VignetteEngine{knitr::rmarkdown} %\VignetteIndexEntry{biocViews-CreateRepositoryHTML} %\VignetteEncoding{UTF-8} output: BiocStyle::html_document: number_sections: yes toc: yes toc_depth: 4 --- # Overview This document assumes you have a collection of R packages on local disk that you would like to prepare for publishing to the web. The end result we are going for is: 1. Packages organized per CRAN-style repository standard. 2. PACKAGES files created for install.packages access. 3. VIEWS file created for generating biocViews. 4. A vignette directory created containing the extracted vignette pdf files from each source package in the repository. 5. An html directory created containing html descriptions of each package with links for downloading available artifacts. 6. A simple alphabetical listing index.html file. # CRAN-style Layout Establish a top-level directory for the repository, we will refer to this directory as reposRoot. Place your packages as follows: **src/contrib** Contains all source packages (*.tar.gz). **bin/windows/contrib/x.y** Contains all win.binary packages (*.zip). Where x.y is the major.minor version number of R. **bin/macosx/contrib/x.y** Contains the mac.binary (High Sierra) (*.tgz) packages. You will need the following parameters: ```{r eval=FALSE} reposRoot <- "path/to/reposRoot" ## The names are essential contribPaths <- c(source="src/contrib", win.binary="bin/windows/contrib/4.0", mac.binary="bin/macosx/contrib/4.0") ``` # Extracting vignettes The `extractVignettes` function extracts pdf files from inst/doc. The default is to extract to a reposRoot/vignettes. ```{r eval=FALSE} extractVignettes(reposRoot, contribPaths["source"]) ``` # Generating the control files The `genReposControlFiles` function will generate the PACKAGES files for each contrib path and also create a VIEWS file with complete info for later use by biocViews. ```{r eval=FALSE} genReposControlFiles(reposRoot, contribPaths) ``` # Generating the HTML The `writeRepositoryHtml` will generate HTML detail files for each package in reposRoot/html. The function will also create an index.html file at the top level. Two CSS files are included with *biocViews* that are automatically copied along side the appropriate HTML files during the HTML generation process. These CSS files are: ``` reposRoot/repository-detail.css reposRoot/html/package-detail.css ``` # Design and extension notes The basic idea is that using the VIEWS file and the known repository structure (location of packages and extracted vignettes), we represent the details for each package in the repository in a *PackageDetail-class* instance. *packageDetail-class* objects know how to write themselves to HTML using the `htmlValue` method. We used the *XML* package's `xmlOutputDOM` function to build up the HTML documents. Each HTML producing class extends *Htmlized-class* which contains a slot to hold the DOM tree and provides a place to put methods that are not specific to any given HTML outputting class. In terms of extending this to generate the biocViews, have a look at `setDependsOnMeImportsMeSuggeswhich` builds up an adjacency matrix representing package dependencies, importations, and suggestions. The matrix is square with rows and columns labeled with the names of the packages. The entries are 0/1 with a*ij* = 1 meaning that package *j* depends on package *i*. ## Details on HTML generation I started by breaking the `htmlValue` method for *PackageDetail-class* into one helper function for each logical section of the HTML we produce (author, description, details, downloads, and vignettes). That made the long method short enough to be readable. In order to be able to mix and match the different chunks and be able to more easily create new renderings, it seemed that it would be easiest to be able to render to HTML each chunk with a method. One possibility is a function `htmlChunk(object, "descriptions")` where the dispatch would be done using a switch statement or similar. A more flexible approach is to create dummy classes for each output "chunk". Each dummy class contains (subclasses) *PackageDescription* and that's it. We then can take advantage of the behavior of the as method to convert. ```{r eval=FALSE} ## Define classes like this for each logical document chunk setClass("pdAuthorMaintainerInfo", contains="PackageDetail") setClass("pdVignetteInfo", contains="PackageDetail") ## Then define a htmlValue method setMethod("htmlValue", signature(object="pdDescriptionInfo"), function(object) { node <- xmlNode("p", cleanText(object@Description), attrs=c(class="description")) node }) ## Then you can make use of all this... ## Assume object contains a PackageDetail instance authorInfo <- as(object, "pdAuthorMaintainerInfo") dom$addNode(htmlValue(authorInfo)) ``` One advantage of this setup is that we can now define a method to generate complete HTML documents that will work for all the dummy classes. Hence mix and match. ## A note on the htmlValue method for PackageDetail We could parameterize as follows. Not sure this makes things easier to follow, but it does demonstrate how you could start building up documents in a more programatic fashion. ```{r eval=FALSE} details <- list(heading=list(tag="h3", text="Details"), content="pdDetailsInfo") downloads <- list(heading=list(tag="h3", text="Download Package"), content="pdDownloadInfo") vignettes <- list(heading=list(tag="h3", text="Vignettes (Documentation)"), content="pdVignetteInfo") doSection <- function(sec) { dom$addTag(sec$heading$tag, sec$heading$text) secObj <- as(object, sec$content) dom$addNode(htmlValue(secObj)) } lapply(list(details, downloads, vignettes), doSection) ``` biocViews/inst/doc/createReposHtml.html0000644000175200017520000233657214710271425021264 0ustar00biocbuildbiocbuild HOWTO generate repository HTML

Contents

1 Overview

This document assumes you have a collection of R packages on local disk that you would like to prepare for publishing to the web. The end result we are going for is:

  1. Packages organized per CRAN-style repository standard.
  2. PACKAGES files created for install.packages access.
  3. VIEWS file created for generating biocViews.
  4. A vignette directory created containing the extracted vignette pdf files from each source package in the repository.
  5. An html directory created containing html descriptions of each package with links for downloading available artifacts.
  6. A simple alphabetical listing index.html file.

2 CRAN-style Layout

Establish a top-level directory for the repository, we will refer to this directory as reposRoot. Place your packages as follows:

src/contrib Contains all source packages (*.tar.gz).

bin/windows/contrib/x.y Contains all win.binary packages (*.zip). Where x.y is the major.minor version number of R.

bin/macosx/contrib/x.y Contains the mac.binary (High Sierra) (*.tgz) packages.

You will need the following parameters:

reposRoot <- "path/to/reposRoot"
## The names are essential
contribPaths <- c(source="src/contrib",
                   win.binary="bin/windows/contrib/4.0",
                   mac.binary="bin/macosx/contrib/4.0")

3 Extracting vignettes

The extractVignettes function extracts pdf files from inst/doc. The default is to extract to a reposRoot/vignettes.

extractVignettes(reposRoot, contribPaths["source"])

4 Generating the control files

The genReposControlFiles function will generate the PACKAGES files for each contrib path and also create a VIEWS file with complete info for later use by biocViews.

genReposControlFiles(reposRoot, contribPaths)

5 Generating the HTML

The writeRepositoryHtml will generate HTML detail files for each package in reposRoot/html. The function will also create an index.html file at the top level.

Two CSS files are included with biocViews that are automatically copied along side the appropriate HTML files during the HTML generation process. These CSS files are:

reposRoot/repository-detail.css
reposRoot/html/package-detail.css

6 Design and extension notes

The basic idea is that using the VIEWS file and the known repository structure (location of packages and extracted vignettes), we represent the details for each package in the repository in a PackageDetail-class instance.

packageDetail-class objects know how to write themselves to HTML using the htmlValue method. We used the XML package’s xmlOutputDOM function to build up the HTML documents. Each HTML producing class extends Htmlized-class which contains a slot to hold the DOM tree and provides a place to put methods that are not specific to any given HTML outputting class.

In terms of extending this to generate the biocViews, have a look at setDependsOnMeImportsMeSuggeswhich builds up an adjacency matrix representing package dependencies, importations, and suggestions. The matrix is square with rows and columns labeled with the names of the packages. The entries are 0/1 with aij = 1 meaning that package j depends on package i.

6.1 Details on HTML generation

I started by breaking the htmlValue method for PackageDetail-class into one helper function for each logical section of the HTML we produce (author, description, details, downloads, and vignettes). That made the long method short enough to be readable.

In order to be able to mix and match the different chunks and be able to more easily create new renderings, it seemed that it would be easiest to be able to render to HTML each chunk with a method. One possibility is a function htmlChunk(object, "descriptions") where the dispatch would be done using a switch statement or similar.

A more flexible approach is to create dummy classes for each output “chunkâ€. Each dummy class contains (subclasses) PackageDescription and that’s it. We then can take advantage of the behavior of the as method to convert.

## Define classes like this for each logical document chunk
setClass("pdAuthorMaintainerInfo", contains="PackageDetail")
setClass("pdVignetteInfo", contains="PackageDetail")
## Then define a htmlValue method
setMethod("htmlValue", signature(object="pdDescriptionInfo"),
           function(object) {
           node <- xmlNode("p", cleanText(object@Description),
                            attrs=c(class="description"))
           node
         })
## Then you can make use of all this...
## Assume object contains a PackageDetail instance
authorInfo <- as(object, "pdAuthorMaintainerInfo")
dom$addNode(htmlValue(authorInfo))

One advantage of this setup is that we can now define a method to generate complete HTML documents that will work for all the dummy classes. Hence mix and match.

6.2 A note on the htmlValue method for PackageDetail

We could parameterize as follows. Not sure this makes things easier to follow, but it does demonstrate how you could start building up documents in a more programatic fashion.

details <- list(heading=list(tag="h3", text="Details"),
                content="pdDetailsInfo")
downloads <- list(heading=list(tag="h3", text="Download Package"),
                 content="pdDownloadInfo")
vignettes <- list(heading=list(tag="h3",
                    text="Vignettes (Documentation)"),
                 content="pdVignetteInfo")
doSection <- function(sec) {
   dom$addTag(sec$heading$tag, sec$heading$text)
   secObj <- as(object, sec$content)
   dom$addNode(htmlValue(secObj))
}
lapply(list(details, downloads, vignettes), doSection)
biocViews/inst/dot/0000755000175200017520000000000014710217211015265 5ustar00biocbuildbiocbuildbiocViews/inst/dot/biocViewsVocab.dot0000644000175200017520000004276014710217211020713 0ustar00biocbuildbiocbuild/* Bioc Views Vocabular Definition in dot format */ /* How To Process this file: 1. Use dot2gxl from graphviz to transform into GXL format. dot2gxl biocViewsVocab.dot > biocViewsVocab.gxl 2. use graph::fromGXL to obtain a graphNEL object */ digraph G { /**************************************************************************** * Software * ****************************************************************************/ BiocViews -> Software; /* Software -> AssayDomain */ Software -> AssayDomain; AssayDomain -> aCGH; AssayDomain -> CellBasedAssays; AssayDomain -> ChIPchip; AssayDomain -> CopyNumberVariation; AssayDomain -> CpGIsland; AssayDomain -> DNAMethylation; AssayDomain -> ExonArray; AssayDomain -> GeneExpression; AssayDomain -> GeneticVariability; AssayDomain -> SNP; AssayDomain -> Transcription; /* Software -> Technology */ Software -> Technology; Technology -> Sequencing; Sequencing -> ATACSeq; Sequencing -> DNASeq; Sequencing -> DNaseSeq; Sequencing -> RiboSeq; Sequencing -> RNASeq; Sequencing -> ChIPSeq; Sequencing -> RIPSeq; Sequencing -> MethylSeq; Sequencing -> ExomeSeq; Sequencing -> miRNA; Sequencing -> SangerSeq; Sequencing -> SmallRNA; Sequencing -> Microbiome; Sequencing -> WholeGenome; Sequencing -> DenovoGenome; Sequencing -> TargetedResequencing; Sequencing -> DenovoTranscriptome; Sequencing -> MicrobialStrain; Sequencing -> HiC; Sequencing -> PooledScreens; Sequencing -> MNaseSeq; Sequencing -> LongRead; Technology -> Microarray; Microarray -> MultiChannel; Microarray -> OneChannel; Microarray -> TwoChannel; Microarray -> MethylationArray; Microarray -> GenotypingArray; Microarray -> MicroRNAArray; Microarray -> mRNAMicroarray; Microarray -> ChipOnChip; Microarray -> ReversePhaseProteinArray; Microarray -> TissueMicroarray; Microarray -> ProprietaryPlatforms; Technology -> FlowCytometry; Technology -> MassSpectrometry; MassSpectrometry -> ImagingMassSpectrometry; Technology -> qPCR; Technology -> MicrotitrePlateAssay; Technology -> SAGE; Technology -> CRISPR; Technology -> SingleCell; Technology -> Spatial; Technology -> ddPCR; Technology -> AnnotationHubSoftware; Technology -> ExperimentHubSoftware; /* Software -> ResearchFields */ Software -> ResearchField; ResearchField -> CellBiology; ResearchField -> Genetics; ResearchField -> Metabolomics; ResearchField -> Metagenomics; ResearchField -> Proteomics; ResearchField -> Lipidomics; ResearchField -> Epigenetics; ResearchField -> Phylogenetics; ResearchField -> Pharmacogenomics; ResearchField -> Pharmacogenetics; ResearchField -> Cheminformatics; ResearchField -> StructuralGenomics; ResearchField -> StructuralPrediction; ResearchField -> Biophysics; ResearchField -> MathematicalBiology; ResearchField -> BiomedicalInformatics; ResearchField -> ComparativeGenomics; ResearchField -> FunctionalGenomics; ResearchField -> SystemsBiology; ResearchField -> ComputationalChemistry; ResearchField -> Agroinformatics; ResearchField -> Transcriptomics; ResearchField -> ImmunoOncology; ResearchField -> Epitranscriptomics; /* Software -> BiologicalQuestion */ Software -> BiologicalQuestion; BiologicalQuestion -> AlternativeSplicing; BiologicalQuestion -> Coverage; BiologicalQuestion -> DemethylateRegionDetection; BiologicalQuestion -> DenovoAssembler; BiologicalQuestion -> DifferentialDNA3DStructure; BiologicalQuestion -> DifferentialExpression; BiologicalQuestion -> DifferentialMethylation; BiologicalQuestion -> DifferentialPeakCalling; BiologicalQuestion -> DifferentialSplicing; BiologicalQuestion -> DNA3DStructure; BiologicalQuestion -> DriverMutation; BiologicalQuestion -> FunctionalPrediction; BiologicalQuestion -> GeneFusionDetection; BiologicalQuestion -> GenePrediction; BiologicalQuestion -> GeneRegulation; BiologicalQuestion -> GeneSetEnrichment; BiologicalQuestion -> GeneSignaling; BiologicalQuestion -> GeneTarget; BiologicalQuestion -> GenomeAssembly; BiologicalQuestion -> GenomeWideAssociation; BiologicalQuestion -> GenomicVariation; BiologicalQuestion -> GenomeAnnotation; BiologicalQuestion -> GermlineMutation; BiologicalQuestion -> HistoneModification; BiologicalQuestion -> IndelDetection; BiologicalQuestion -> LinkageDisequilibrium; BiologicalQuestion -> MetagenomeAssembly; BiologicalQuestion -> MicrosatelliteDetection; BiologicalQuestion -> MotifAnnotation; BiologicalQuestion -> MotifDiscovery; BiologicalQuestion -> NetworkEnrichment; BiologicalQuestion -> NetworkInference; BiologicalQuestion -> NucleosomePositioning; BiologicalQuestion -> PeakDetection; BiologicalQuestion -> QuantitativeTrailLocus; BiologicalQuestion -> Scaffolding; BiologicalQuestion -> SequenceMatching; BiologicalQuestion -> SomaticMutation; BiologicalQuestion -> SplicedAlignment; BiologicalQuestion -> StructuralVariation; BiologicalQuestion -> TranscriptomeVariant; BiologicalQuestion -> VariantAnnotation; BiologicalQuestion -> VariantDetection; /* Software -> WorkflowStep */ Software -> WorkflowStep; WorkflowStep -> ExperimentalDesign; WorkflowStep -> Alignment; Alignment -> MultipleSequenceAlignment; WorkflowStep -> Annotation; WorkflowStep -> BatchEffect; WorkflowStep -> MultipleComparison; WorkflowStep -> Normalization; WorkflowStep -> Pathways; Pathways -> GO; Pathways -> KEGG; Pathways -> Reactome; Pathways -> BioCarta; Pathways -> NCINatureCurated; WorkflowStep -> Preprocessing; WorkflowStep -> QualityControl; WorkflowStep -> ReportWriting; WorkflowStep -> Visualization; Visualization -> Network; WorkflowStep -> GenomeBrowsers; /* Software -> WorkflowManagement */ Software -> WorkflowManagement; /* Software -> StatisticalMethod */ Software -> StatisticalMethod; StatisticalMethod -> Bayesian; StatisticalMethod -> Classification; StatisticalMethod -> Clustering; StatisticalMethod -> DecisionTree; StatisticalMethod -> DimensionReduction; StatisticalMethod -> FeatureExtraction; StatisticalMethod -> GraphAndNetwork; StatisticalMethod -> HiddenMarkovModel; StatisticalMethod -> MultidimensionalScaling; StatisticalMethod -> NeuralNetwork; StatisticalMethod -> PatternLogic; StatisticalMethod -> PrincipalComponent; StatisticalMethod -> Regression; StatisticalMethod -> StructuralEquationModels; StatisticalMethod -> SupportVectorMachine; StatisticalMethod -> Survival; StatisticalMethod -> TimeCourse; /* Software -> Infrastructure */ Software -> Infrastructure; Infrastructure -> ThirdPartyClient Infrastructure -> DataImport; Infrastructure -> DataRepresentation; Infrastructure -> GUI; /* Software -> ShinyApps */ Software -> ShinyApps; /**************************************************************************** * AnnotationData * ****************************************************************************/ BiocViews -> AnnotationData; /* AnnotationData -> Organism */ AnnotationData -> Organism; Organism -> Anopheles_gambiae; Organism -> Apis_mellifera; Organism -> Arabidopsis_lyrata; Organism -> Arabidopsis_thaliana; Organism -> Asparagus_officinalis; Organism -> Bacillus_subtilis; Organism -> Bos_taurus; Organism -> Caenorhabditis_elegans; Organism -> Callithrix_jacchus; Organism -> Canis_familiaris; Organism -> Cicer_arietinum; Organism -> Ciona_intestinalis; Organism -> Chlamydomonas_reinhardtii; Organism -> Danio_rerio; Organism -> Drosophila_melanogaster; Organism -> Drosophila_virilis; Organism -> Eremothecium_gossypii; Organism -> Escherichia_coli; Organism -> Gallus_gallus; Organism -> Gasterosteus_aculeatus; Organism -> Glycine_max; Organism -> Homo_sapiens; Organism -> Hordeum_vulgare; Organism -> Kluyveromyces_lactis; Organism -> Macaca_fascicularis; Organism -> Macaca_mulatta; Organism -> Magnaporthe_grisea; Organism -> Medicago_truncatula; Organism -> Monodelphis_domestica; Organism -> Mus_musculus; Organism -> Neurospora_crassa; Organism -> Oncorhynchus_mykiss; Organism -> Oryza_sativa; Organism -> Pan_paniscus; Organism -> Pan_troglodytes; Organism -> Plasmodium_falciparum; Organism -> Pseudomonas_aeruginosa; Organism -> Rattus_norvegicus; Organism -> Saccharomyces_cerevisiae; Organism -> Saccharum_officinarum; Organism -> Salmo_salar; Organism -> Schizosaccharomyces_pombe; Organism -> Staphylococcus_aureus; Organism -> Sus_scrofa; Organism -> Taeniopygia_guttata; Organism -> Toxoplasma_gondii; Organism -> Triticum_aestivum; Organism -> Vitis_vinifera; Organism -> Xenopus_laevis; Organism -> Xenopus_tropicalis; Organism -> Zea_mays; /* AnnotationData -> ChipManufacturer */ AnnotationData -> ChipManufacturer; ChipManufacturer -> AffymetrixChip; ChipManufacturer -> AgilentChip; ChipManufacturer -> ClonetechChip; ChipManufacturer -> GEChip; ChipManufacturer -> INDACChip; ChipManufacturer -> IlluminaChip; ChipManufacturer -> QiagenChip; ChipManufacturer -> RNG_MRCChip; ChipManufacturer -> RocheChip; ChipManufacturer -> UniversityHealthNetwork; ChipManufacturer -> CodelinkChip; /* AnnotationData -> CustomCDF */ AnnotationData -> CustomCDF; CustomCDF -> GACustomCDF; CustomCDF -> MBNICustomCDF; /* AnnotationData -> CustomArray */ AnnotationData -> CustomArray; /* AnnotationData -> CustomDBSchema */ AnnotationData -> CustomDBSchema; CustomDBSchema -> GeneCardsCustomSchema; /* AnnotationData -> FunctionalAnnotation */ AnnotationData -> FunctionalAnnotation; /* AnnotationData -> SequenceAnnotation */ AnnotationData -> SequenceAnnotation; SequenceAnnotation -> GenomicSequence; /* AnnotationData -> ChipName */ AnnotationData -> ChipName; ChipName -> adme16cod; ChipName -> ag; ChipName -> ath1121501; ChipName -> celegans; ChipName -> drosgenome1; ChipName -> drosophila2; ChipName -> h10kcod; ChipName -> h20kcod; ChipName -> hcg110; ChipName -> hgfocus; ChipName -> hgu133a2; ChipName -> hgu133a; ChipName -> hgu133b; ChipName -> hgu133plus2; ChipName -> hgu95a; ChipName -> hgu95av2; ChipName -> hgu95b; ChipName -> hgu95c; ChipName -> hgu95d; ChipName -> hgu95e; ChipName -> hguatlas13k; ChipName -> hgug4100a; ChipName -> hgug4101a; ChipName -> hgug4110b; ChipName -> hgug4111a; ChipName -> hgug4112a; ChipName -> hguqiagenv3; ChipName -> hi16cod; ChipName -> hs25kresogen; ChipName -> hu35ksuba; ChipName -> hu35ksubb; ChipName -> hu35ksubc; ChipName -> hu35ksubd; ChipName -> hu6800; ChipName -> HuO22; ChipName -> hwgcod; ChipName -> indac; ChipName -> illuminaHumanv1; ChipName -> illuminaHumanv2; ChipName -> illuminaMousev1; ChipName -> illuminaMousev1p1; ChipName -> illuminaRatv1; ChipName -> JazaerimetaData; ChipName -> lumiHumanV1; ChipName -> lumiMouseV1; ChipName -> lumiHumanV2; ChipName -> lumiRatV1; ChipName -> m10kcod; ChipName -> m20kcod; ChipName -> mi16cod; ChipName -> mm24kresogen; ChipName -> mgu74a; ChipName -> mgu74av2; ChipName -> mgu74b; ChipName -> mgu74bv2; ChipName -> mgu74c; ChipName -> mgu74cv2; ChipName -> mguatlas5k; ChipName -> mgug4121a; ChipName -> mgug4122a; ChipName -> moe430a; ChipName -> moe430b; ChipName -> mouse4302; ChipName -> mouse430a2; ChipName -> mpedbarray; ChipName -> mu11ksuba; ChipName -> mu11ksubb; ChipName -> mu19ksuba; ChipName -> mu19ksubb; ChipName -> mu19ksubc; ChipName -> Mu15v1; ChipName -> Mu22v3; ChipName -> mwgcod; ChipName -> Norway981; ChipName -> OperonHumanV3; ChipName -> pedbarrayv9; ChipName -> pedbarrayv10; ChipName -> PartheenMetaData; ChipName -> r10kcod; ChipName -> rae230a; ChipName -> rae230b; ChipName -> rat2302; ChipName -> rgu34a; ChipName -> rgu34b; ChipName -> rgu34c; ChipName -> rgug4130a; ChipName -> ri16cod; ChipName -> rnu34; ChipName -> Roberts2005Annotation; ChipName -> rtu34; ChipName -> rwgcod; ChipName -> SHDZ; ChipName -> u133x3p; ChipName -> xenopuslaevis; ChipName -> yeast2; ChipName -> ygs98; ChipName -> zebrafish; ChipName -> hcgi12k; ChipName -> hcgi8k; /* AnnotationData -> PackageType */ AnnotationData -> PackageType; PackageType -> BSgenome; PackageType -> cdf; PackageType -> ChipDb; PackageType -> db0; PackageType -> InparanoidDb; PackageType -> OrganismDb; PackageType -> OrgDb; PackageType -> PolyPhen; PackageType -> probe; PackageType -> SIFT; PackageType -> SNPlocs; PackageType -> XtraSNPlocs; PackageType -> TxDb; PackageType -> MeSHDb; PackageType -> FRMA; PackageType -> AnnotationHub; PackageType -> EuPathDB; /**************************************************************************** * ExperimentData * ****************************************************************************/ BiocViews -> ExperimentData; ExperimentData -> ReproducibleResearch; ExperimentData -> SpecimenSource; SpecimenSource -> Tissue; SpecimenSource -> Proteome; SpecimenSource -> Genome; SpecimenSource -> StemCell; SpecimenSource -> CellCulture; SpecimenSource -> Germline; SpecimenSource -> Somatic; ExperimentData -> OrganismData; OrganismData -> Anopheles_gambiae_Data; OrganismData -> Apis_mellifera_Data; OrganismData -> Arabidopsis_lyrata_Data; OrganismData -> Arabidopsis_thaliana_Data; OrganismData -> Bacillus_subtilis_Data; OrganismData -> Bos_taurus_Data; OrganismData -> Caenorhabditis_elegans_Data; OrganismData -> Callithrix_jacchus_Data; OrganismData -> Canis_familiaris_Data; OrganismData -> Ciona_intestinalis_Data; OrganismData -> Danio_rerio_Data; OrganismData -> Drosophila_melanogaster_Data; OrganismData -> Drosophila_virilis_Data; OrganismData -> Eremothecium_gossypii_Data; OrganismData -> Escherichia_coli_Data; OrganismData -> Gallus_gallus_Data; OrganismData -> Gasterosteus_aculeatus_Data; OrganismData -> Glycine_max_Data; OrganismData -> Homo_sapiens_Data; OrganismData -> Hordeum_vulgare_Data; OrganismData -> Kluyveromyces_lactis_Data; OrganismData -> Macaca_mulatta_Data; OrganismData -> Magnaporthe_grisea_Data; OrganismData -> Medicago_truncatul_Data; OrganismData -> Monodelphis_domestica_Data; OrganismData -> Mus_musculus_Data; OrganismData -> Neurospora_crassa_Data; OrganismData -> Oncorhynchus_mykiss_Data; OrganismData -> Oryza_sativa_Data; OrganismData -> Pan_paniscus_Data; OrganismData -> Pan_troglodytes_Data; OrganismData -> Plasmodium_falciparum_Data; OrganismData -> Pseudomonas_aeruginosa_Data; OrganismData -> Rattus_norvegicus_Data; OrganismData -> Saccharomyces_cerevisiae_Data; OrganismData -> Saccharum_officinarum_Data; OrganismData -> Schizosaccharomyces_pombe_Data; OrganismData -> Staphylococcus_aureus_Data; OrganismData -> Sus_scrofa_Data; OrganismData -> Taeniopygia_guttata_Data; OrganismData -> Triticum_aestivum_Data; OrganismData -> Vitis_vinifera_Data; OrganismData -> Xenopus_laevis_Data; OrganismData -> Xenopus_tropicalis_Data; OrganismData -> Zea_mays_Data; ExperimentData -> DiseaseModel; DiseaseModel -> CancerData; CancerData -> BreastCancerData; CancerData -> ColonCancerData; CancerData -> KidneyCancerData; CancerData -> LeukemiaCancerData; CancerData -> LungCancerData; CancerData -> OvarianCancerData; CancerData -> ProstateCancerData; CancerData -> LeukemiaCancerData; DiseaseModel -> HIVData; DiseaseModel -> COPDData; ExperimentData -> TechnologyData; TechnologyData -> FlowCytometryData; TechnologyData -> HighThroughputImagingData; TechnologyData -> MassSpectrometryData; MassSpectrometryData -> ImagingMassSpectrometryData; TechnologyData -> qPCRData; TechnologyData -> MicrotitrePlateAssayData; TechnologyData -> SAGEData; TechnologyData -> CGHData; TechnologyData -> SequencingData; SequencingData -> DNASeqData; SequencingData -> RNASeqData; SequencingData -> ChIPSeqData; SequencingData -> RIPSeqData; SequencingData -> MethylSeqData; SequencingData -> ExomeSeqData; SequencingData -> miRNAData; SequencingData -> SangerSeqData; SequencingData -> SmallRNAData; SequencingData -> MicrobiomeData; SequencingData -> SingleCellData; SequencingData -> SpatialData; TechnologyData -> MicroarrayData; MicroarrayData -> MultiChannelData; MicroarrayData -> OneChannelData; MicroarrayData -> TwoChannelData; MicroarrayData -> MethylationArrayData; MicroarrayData -> GenotypingArrayData; MicroarrayData -> MicroRNAArrayData; MicroarrayData -> mRNAArrayData; MicroarrayData -> ChipOnChipData; MicroarrayData -> ReversePhaseProteinArrayData; MicroarrayData -> TissueMicroarrayData; MicroarrayData -> ProprietaryPlatformsData; ExperimentData -> AssayDomainData; AssayDomainData -> CopyNumberVariationData; AssayDomainData -> CpGIslandData; AssayDomainData -> SNPData; AssayDomainData -> ExpressionData; ExperimentData -> RepositoryData; RepositoryData -> HapMap; RepositoryData -> GEO; RepositoryData -> ArrayExpress; RepositoryData -> NCI; RepositoryData -> PathwayInteractionDatabase; RepositoryData -> Project1000genomes; RepositoryData -> ENCODE; ExperimentData -> PackageTypeData; PackageTypeData -> ExperimentHub; PackageTypeData -> ImmunoOncologyData; /**************************************************************************** * ExperimentData * ****************************************************************************/ BiocViews -> Workflow; Workflow -> BasicWorkflow; Workflow -> AnnotationWorkflow; Workflow -> GeneExpressionWorkflow; Workflow -> SingleCellWorkflow; Workflow -> SpatialWorkflow; Workflow -> GenomicVariantsWorkflow; Workflow -> EpigeneticsWorkflow; Workflow -> ProteomicsWorkflow; Workflow -> ResourceQueryingWorkflow; Workflow -> DifferentialSplicingWorkflow; Workflow -> ImmunoOncologyWorkflow; } biocViews/inst/extdata/0000755000175200017520000000000014710217211016131 5ustar00biocbuildbiocbuildbiocViews/inst/extdata/biocViewsVocab.sqlite0000644000175200017520000006000014710217211022255 0ustar00biocbuildbiocbuildSQLite format 3@ .fê   ^ tablebiocViewsbiocViewsCREATE TABLE `biocViews` ( `edgeFrom` TEXT, `edgeTo` TEXT )ïûõïmS4üÞí’oS5 í È ­ h G ( è Æ ¥ ƒ i J '  ì È ¨ ‰ d ;   å Í ª ‘ s Z <   ê Ñ ¸ œ } j G 4  ðܸ”w]?!éÌ­‹iH$þâ½–qM-äãN!óÅšuP%ûÖ±‰eDóÌ¥~T/Ú¬†a9%u1-BiologicalQuestionNetworkInference&t1/BiologicalQuestionNetworkEnrichment#s1)BiologicalQuestionMotifDiscovery$r1+BiologicalQuestionMotifAnnotation,q1;BiologicalQuestionMicrosatelliteDetection'p11BiologicalQuestionMetagenomeAssembly*o17BiologicalQuestionLinkageDisequilibrium#n1)BiologicalQuestionIndelDetection(m13BiologicalQuestionHistoneModification%l1-BiologicalQuestionGermlineMutation%k1-BiologicalQuestionGenomeAnnotation%j1-BiologicalQuestionGenomicVariation*i17BiologicalQuestionGenomeWideAssociation#h1)BiologicalQuestionGenomeAssemblyg1!BiologicalQuestionGeneTarget"f1'BiologicalQuestionGeneSignaling&e1/BiologicalQuestionGeneSetEnrichment#d1)BiologicalQuestionGeneRegulation#c1)BiologicalQuestionGenePrediction(b13BiologicalQuestionGeneFusionDetection)a15BiologicalQuestionFunctionalPrediction#`1)BiologicalQuestionDriverMutation#_1)BiologicalQuestionDNA3DStructure)^15BiologicalQuestionDifferentialSplicing,]1;BiologicalQuestionDifferentialPeakCalling,\1;BiologicalQuestionDifferentialMethylation+[19BiologicalQuestionDifferentialExpression/Z1ABiologicalQuestionDifferentialDNA3DStructure"Y'1ResearchFieldEpitranscriptomicsX')ResearchFieldImmunoOncologyW'+ResearchFieldTranscriptomicsV'+ResearchFieldAgroinformatics&U'9ResearchFieldComputationalChemistryT')ResearchFieldSystemsBiology"S'1ResearchFieldFunctionalGenomics#R'3ResearchFieldComparativeGenomics%Q'7ResearchFieldBiomedicalInformatics#P'3ResearchFieldMathematicalBiologyO'!ResearchFieldBiophysics$N'5ResearchFieldStructuralPrediction"M'1ResearchFieldStructuralGenomicsL'+ResearchFieldCheminformatics K'-ResearchFieldPharmacogenetics J'-ResearchFieldPharmacogenomicsI''ResearchFieldPhylogeneticsH'#ResearchFieldEpigeneticsG'!ResearchFieldLipidomicsF'!ResearchFieldProteomicsE'%ResearchFieldMetagenomicsD'%ResearchFieldMetabolomicsC'ResearchFieldGeneticsB'#ResearchFieldCellBiology"A!7TechnologyExperimentHubSoftware"@!7TechnologyAnnotationHubSoftware?!TechnologyddPCR>!TechnologySpatial=!!TechnologySingleCell<!TechnologyCRISPR;!TechnologySAGE!:!5TechnologyMicrotitrePlateAssay9!TechnologyqPCR8!-TechnologyMassSpectrometry7!'TechnologyFlowCytometry6!!TechnologyMicroarray5!!TechnologySequencing4#'AssayDomainTranscription3#AssayDomainSNP 2#1AssayDomainGeneticVariability1#)AssayDomainGeneExpression0#AssayDomainExonArray/#)AssayDomainDNAMethylation.#AssayDomainCpGIsland!-#3AssayDomainCopyNumberVariation,#AssayDomainChIPchip+#+AssayDomainCellBasedAssays*#AssayDomainaCGH!)9WorkflowImmunoOncologyWorkflow'(EWorkflowDifferentialSplicingWorkflow#'=WorkflowResourceQueryingWorkflow&1WorkflowProteomicsWorkflow%3WorkflowEpigeneticsWorkflow"$;WorkflowGenomicVariantsWorkflow#+WorkflowSpatialWorkflow"1WorkflowSingleCellWorkflow!!9WorkflowGeneExpressionWorkflow 1WorkflowAnnotationWorkflow'WorkflowBasicWorkflow )+ExperimentDataPackageTypeData))ExperimentDataRepositoryData )+ExperimentDataAssayDomainData))ExperimentDataTechnologyData)%ExperimentDataDiseaseModel)%ExperimentDataOrganismData))ExperimentDataSpecimenSource%)5ExperimentDataReproducibleResearch)#AnnotationDataPackageType)AnnotationDataChipName#)1AnnotationDataSequenceAnnotation%)5AnnotationDataFunctionalAnnotation))AnnotationDataCustomDBSchema)#AnnotationDataCustomArray)AnnotationDataCustomCDF!)-AnnotationDataChipManufacturer)AnnotationDataOrganism SoftwareShinyApps )SoftwareInfrastructure /SoftwareStatisticalMethod 1SoftwareWorkflowManagement %SoftwareWorkflowStep1SoftwareBiologicalQuestion'SoftwareResearchField!SoftwareTechnology#SoftwareAssayDomainBiocViewsWorkflow)BiocViewsExperimentData)BiocViewsAnnotationDataƒnu uêβœ„mS4üÞí’oS5 í È ­ h G ( è Æ ¥ ƒ i J '  ì È ¨ ‰ d ;   å Í ª ‘ s Z <   ê Ñ ¸ œ } j G 4  ðܸ”w]?!éÌ­‹iH$þâ½–qM-äãN!óÅšuP%ûÖ±‰eDóÌ¥~T/Ú¬†a9%u1-BiologicalQuestionNetworkInference&t1/BiologicalQuestionNetworkEnrichment#s1)BiologicalQuestionMotifDiscovery$r1+BiologicalQuestionMotifAnnotation,q1;BiologicalQuestionMicrosatelliteDetection'p11BiologicalQuestionMetagenomeAssembly*o17BiologicalQuestionLinkageDisequilibrium#n1)BiologicalQuestionIndelDetection(m13BiologicalQuestionHistoneModification%l1-BiologicalQuestionGermlineMutation%k1-BiologicalQuestionGenomeAnnotation%j1-BiologicalQuestionGenomicVariation*i17BiologicalQuestionGenomeWideAssociation#h1)BiologicalQuestionGenomeAssemblyg1!BiologicalQuestionGeneTarget"f1'BiologicalQuestionGeneSignaling&e1/BiologicalQuestionGeneSetEnrichment#d1)BiologicalQuestionGeneRegulation#c1)BiologicalQuestionGenePrediction(b13BiologicalQuestionGeneFusionDetection)a15BiologicalQuestionFunctionalPrediction#`1)BiologicalQuestionDriverMutation#_1)BiologicalQuestionDNA3DStructure)^15BiologicalQuestionDifferentialSplicing,]1;BiologicalQuestionDifferentialPeakCalling,\1;BiologicalQuestionDifferentialMethylation+[19BiologicalQuestionDifferentialExpression/Z1ABiologicalQuestionDifferentialDNA3DStructure"Y'1ResearchFieldEpitranscriptomicsX')ResearchFieldImmunoOncologyW'+ResearchFieldTranscriptomicsV'+ResearchFieldAgroinformatics&U'9ResearchFieldComputationalChemistryT')ResearchFieldSystemsBiology"S'1ResearchFieldFunctionalGenomics#R'3ResearchFieldComparativeGenomics%Q'7ResearchFieldBiomedicalInformatics#P'3ResearchFieldMathematicalBiologyO'!ResearchFieldBiophysics$N'5ResearchFieldStructuralPrediction"M'1ResearchFieldStructuralGenomicsL'+ResearchFieldCheminformatics K'-ResearchFieldPharmacogenetics J'-ResearchFieldPharmacogenomicsI''ResearchFieldPhylogeneticsH'#ResearchFieldEpigeneticsG'!ResearchFieldLipidomicsF'!ResearchFieldProteomicsE'%ResearchFieldMetagenomicsD'%ResearchFieldMetabolomicsC'ResearchFieldGeneticsB'#ResearchFieldCellBiology"A!7TechnologyExperimentHubSoftware"@!7TechnologyAnnotationHubSoftware?!TechnologyddPCR>!TechnologySpatial=!!TechnologySingleCell<!TechnologyCRISPR;!TechnologySAGE!:!5TechnologyMicrotitrePlateAssay9!TechnologyqPCR8!-TechnologyMassSpectrometry7!'TechnologyFlowCytometry6!!TechnologyMicroarray5!!TechnologySequencing4#'AssayDomainTranscription3#AssayDomainSNP 2#1AssayDomainGeneticVariability1#)AssayDomainGeneExpression0#AssayDomainExonArray/#)AssayDomainDNAMethylation.#AssayDomainCpGIsland!-#3AssayDomainCopyNumberVariation,#AssayDomainChIPchip+#+AssayDomainCellBasedAssays*#AssayDomainaCGH!)9WorkflowImmunoOncologyWorkflow'(EWorkflowDifferentialSplicingWorkflow#'=WorkflowResourceQueryingWorkflow&1WorkflowProteomicsWorkflow%3WorkflowEpigeneticsWorkflow"$;WorkflowGenomicVariantsWorkflow#+WorkflowSpatialWorkflow"1WorkflowSingleCellWorkflow!!9WorkflowGeneExpressionWorkflow 1WorkflowAnnotationWorkflow'WorkflowBasicWorkflow )+ExperimentDataPackageTypeData))ExperimentDataRepositoryData )+ExperimentDataAssayDomainData))ExperimentDataTechnologyData)%ExperimentDataDiseaseModel)%ExperimentDataOrganismData))ExperimentDataSpecimenSource%)5ExperimentDataReproducibleResearch)#AnnotationDataPackageType)AnnotationDataChipName#)1AnnotationDataSequenceAnnotation%)5AnnotationDataFunctionalAnnotation))AnnotationDataCustomDBSchema)#AnnotationDataCustomArray)AnnotationDataCustomCDF!)-AnnotationDataChipManufacturer)AnnotationDataOrganism SoftwareShinyApps )SoftwareInfrastructure /SoftwareStatisticalMethod 1SoftwareWorkflowManagement %SoftwareWorkflowStep1SoftwareBiologicalQuestion'SoftwareResearchField!SoftwareTechnology#SoftwareAssayDomainBiocViewsWorkflow)BiocViewsExperimentData)BiocViewsAnnotationDataBiocViewsSoftware yþÔ°ƒa:íØpH ý Ë ¤ € e I ,  é Ï ° q R 2  î Í ª Y 3 Ý ¹ – m L  ò Ó ² Ž p J 3  î×Áª”{cN5ę̀…fS6êж–wZ<"úÚ¶‰aQ?)õÛ»šw]>éÌ©…f@ݺ¢bC' ëÕ¶šzX5þn!OrganismBos_taurusm/OrganismBacillus_subtilis l7OrganismAsparagus_officinalisk5OrganismArabidopsis_thalianaj1OrganismArabidopsis_lyratai)OrganismApis_melliferah/OrganismAnopheles_gambiaegOrganismZea_maysf1OrganismXenopus_tropicalise)OrganismXenopus_laevisd)OrganismVitis_viniferac/OrganismTriticum_aestivumb/OrganismToxoplasma_gondiia3OrganismTaeniopygia_guttata`!OrganismSus_scrofa _7OrganismStaphylococcus_aureus$^?OrganismSchizosaccharomyces_pombe]#OrganismSalmo_salar \7OrganismSaccharum_officinarum#[=OrganismSaccharomyces_cerevisiaeZ/OrganismRattus_norvegicus!Y9OrganismPseudomonas_aeruginosa X7OrganismPlasmodium_falciparumW+OrganismPan_troglodytesV%OrganismPan_paniscusU%OrganismOryza_sativaT3OrganismOncorhynchus_mykissS/OrganismNeurospora_crassaR%OrganismMus_musculus Q7OrganismMonodelphis_domesticaP3OrganismMedicago_truncatulaO1OrganismMagnaporthe_griseaN'VisualizationNetworkM-PathwaysNCINatureCuratedLPathwaysBioCartaKPathwaysReactomeJPathwaysKEGG IPathwaysGO%H?AlignmentMultipleSequenceAlignment*G-;MassSpectrometryImagingMassSpectrometry!F!5MicroarrayProprietaryPlatformsE!-MicroarrayTissueMicroarray%D!=MicroarrayReversePhaseProteinArrayC!!MicroarrayChipOnChipB!)MicroarraymRNAMicroarrayA!'MicroarrayMicroRNAArray@!+MicroarrayGenotypingArray?!-MicroarrayMethylationArray>!!MicroarrayTwoChannel=!!MicroarrayOneChannel<!%MicroarrayMultiChannel;!SequencingLongRead:!SequencingMNaseSeq9!'SequencingPooledScreens8!SequencingHiC7!+SequencingMicrobialStrain 6!3SequencingDenovoTranscriptome!5!5SequencingTargetedResequencing4!%SequencingDenovoGenome3!#SequencingWholeGenome2!!SequencingMicrobiome1!SequencingSmallRNA0!SequencingSangerSeq/!SequencingmiRNA.!SequencingExomeSeq-!SequencingMethylSeq,!SequencingRIPSeq+!SequencingChIPSeq*!SequencingRNASeq)!SequencingRiboSeq(!SequencingDNaseSeq'!SequencingDNASeq&!SequencingATACSeq%)InfrastructureGUI#$)1InfrastructureDataRepresentation#)!InfrastructureDataImport!")-InfrastructureThirdPartyClient!/!StatisticalMethodTimeCourse /StatisticalMethodSurvival(/5StatisticalMethodSupportVectorMachine,/=StatisticalMethodStructuralEquationModels/!StatisticalMethodRegression&/1StatisticalMethodPrincipalComponent /%StatisticalMethodPatternLogic!/'StatisticalMethodNeuralNetwork+/;StatisticalMethodMultidimensionalScaling%//StatisticalMethodHiddenMarkovModel#/+StatisticalMethodGraphAndNetwork%//StatisticalMethodFeatureExtraction&/1StatisticalMethodDimensionReduction /%StatisticalMethodDecisionTree/!StatisticalMethodClustering"/)StatisticalMethodClassification/StatisticalMethodBayesian%)WorkflowStepGenomeBrowsers%'WorkflowStepVisualization%'WorkflowStepReportWriting %)WorkflowStepQualityControl %'WorkflowStepPreprocessing %WorkflowStepPathways %'WorkflowStepNormalization! %1WorkflowStepMultipleComparison%#WorkflowStepBatchEffect%!WorkflowStepAnnotation%WorkflowStepAlignment!%1WorkflowStepExperimentalDesign$1+BiologicalQuestionDenovoAssembler/1ABiologicalQuestionDemethylateRegionDetection1BiologicalQuestionCoverage(13BiologicalQuestionAlternativeSplicing%1-BiologicalQuestionVariantDetection&1/BiologicalQuestionVariantAnnotation)~15BiologicalQuestionTranscriptomeVariant(}13BiologicalQuestionStructuralVariation%|1-BiologicalQuestionSplicedAlignment${1+BiologicalQuestionSomaticMutation%z1-BiologicalQuestionSequenceMatching y1#BiologicalQuestionScaffolding+x19BiologicalQuestionQuantitativeTrailLocus"w1'BiologicalQuestionPeakDetection*v17BiologicalQuestionNucleosomePositioning —Fܼža:!üܹ›€\C) ê É ­ ‰ h E ) è È § ˆ [ 9   Ú ³ œ Œ t ^ E ,   î Ù Ã ® ™ € l V B .   í Ö ¿ ¨ ‘ z a L 2  íÖ¯›ˆkN1÷ÚÁ¨xcN9 õáË·¡‰r[F1êÓ¼¥ŽwcO;$ ðÖ¸£ŽydP<(ü鯳Ÿx]I6 öÝɲžfP7! ôØÃ¬—y`Fƒ)SpecimenSourceTissueƒ#PackageTypeEuPathDBƒ#'PackageTypeAnnotationHubƒ#PackageTypeFRMAƒ#PackageTypeMeSHDbƒ#PackageTypeTxDb‚##PackageTypeXtraSNPlocs‚~#PackageTypeSNPlocs‚}#PackageTypeSIFT‚|#PackageTypeprobe‚{#PackageTypePolyPhen‚z#PackageTypeOrgDb‚y#!PackageTypeOrganismDb‚x#%PackageTypeInparanoidDb‚w#PackageTypedb0‚v#PackageTypeChipDb‚u#PackageTypecdf‚t#PackageTypeBSgenome‚sChipNamehcgi8k‚rChipNamehcgi12k‚qChipNamezebrafish‚pChipNameygs98‚oChipNameyeast2‚n'ChipNamexenopuslaevis‚mChipNameu133x3p‚lChipNameSHDZ‚kChipNamerwgcod‚jChipNamertu34 ‚i7ChipNameRoberts2005Annotation‚hChipNamernu34‚gChipNameri16cod‚fChipNamergug4130a‚eChipNamergu34c‚dChipNamergu34b‚cChipNamergu34a‚bChipNamerat2302‚aChipNamerae230b‚`ChipNamerae230a‚_ChipNamer10kcod‚^-ChipNamePartheenMetaData‚]%ChipNamepedbarrayv10‚\#ChipNamepedbarrayv9‚['ChipNameOperonHumanV3‚ZChipNameNorway981‚YChipNamemwgcod‚XChipNameMu22v3‚WChipNameMu15v1‚VChipNamemu19ksubc‚UChipNamemu19ksubb‚TChipNamemu19ksuba‚SChipNamemu11ksubb‚RChipNamemu11ksuba‚Q!ChipNamempedbarray‚P!ChipNamemouse430a2‚OChipNamemouse4302‚NChipNamemoe430b‚MChipNamemoe430a‚LChipNamemgug4122a‚KChipNamemgug4121a‚J!ChipNamemguatlas5k‚IChipNamemgu74cv2‚HChipNamemgu74c‚GChipNamemgu74bv2‚FChipNamemgu74b‚EChipNamemgu74av2‚DChipNamemgu74a‚C%ChipNamemm24kresogen‚BChipNamemi16cod‚AChipNamem20kcod‚@ChipNamem10kcod‚?ChipNamelumiRatV1‚>#ChipNamelumiHumanV2‚=#ChipNamelumiMouseV1‚<#ChipNamelumiHumanV1‚;+ChipNameJazaerimetaData‚:'ChipNameilluminaRatv1‚9/ChipNameilluminaMousev1p1‚8+ChipNameilluminaMousev1‚7+ChipNameilluminaHumanv2‚6+ChipNameilluminaHumanv1‚5ChipNameindac‚4ChipNamehwgcod‚3ChipNameHuO22‚2ChipNamehu6800‚1ChipNamehu35ksubd‚0ChipNamehu35ksubc‚/ChipNamehu35ksubb‚.ChipNamehu35ksuba‚-%ChipNamehs25kresogen‚,ChipNamehi16cod‚+#ChipNamehguqiagenv3‚*ChipNamehgug4112a‚)ChipNamehgug4111a‚(ChipNamehgug4110b‚'ChipNamehgug4101a‚&ChipNamehgug4100a‚%#ChipNamehguatlas13k‚$ChipNamehgu95e‚#ChipNamehgu95d‚"ChipNamehgu95c‚!ChipNamehgu95b‚ ChipNamehgu95av2‚ChipNamehgu95a‚#ChipNamehgu133plus2‚ChipNamehgu133b‚ChipNamehgu133a‚ChipNamehgu133a2‚ChipNamehgfocus‚ChipNamehcg110‚ChipNameh20kcod‚ChipNameh10kcod‚#ChipNamedrosophila2‚#ChipNamedrosgenome1‚ChipNamecelegans‚!ChipNameath1121501 ‚ChipNameag‚ChipNameadme16cod$‚1+SequenceAnnotationGenomicSequence&‚)7CustomDBSchemaGeneCardsCustomSchema‚'CustomCDFMBNICustomCDF‚ #CustomCDFGACustomCDF‚ -%ChipManufacturerCodelinkChip*‚ -;ChipManufacturerUniversityHealthNetwork‚ -ChipManufacturerRocheChip‚ -#ChipManufacturerRNG_MRCChip‚-!ChipManufacturerQiagenChip‚-%ChipManufacturerIlluminaChip‚-ChipManufacturerINDACChip‚-ChipManufacturerGEChip ‚-'ChipManufacturerClonetechChip‚-#ChipManufacturerAgilentChip!‚-)ChipManufacturerAffymetrixChip‚)OrganismMacaca_mulatta‚3OrganismMacaca_fascicularis5OrganismKluyveromyces_lactis~+OrganismHordeum_vulgare}%OrganismHomo_sapiens|#OrganismGlycine_max!{9OrganismGasterosteus_aculeatusz'OrganismGallus_gallusy-OrganismEscherichia_coli x7OrganismEremothecium_gossypiiw1OrganismDrosophila_virilis"v;OrganismDrosophila_melanogasteru#OrganismDanio_rerio$t?OrganismChlamydomonas_reinhardtiis1OrganismCiona_intestinalisr+OrganismCicer_arietinumq-OrganismCanis_familiarisp1OrganismCallithrix_jacchus!o9OrganismCaenorhabditis_elegans kçäÊ®sX4åœqL# ú Î « ƒ Y 6  í Á ” l =  á µ ” j B  ø Ï ° ˆ c :  ç Æ ™ p I þЧ{T8ೋoC' êÈœz^;! êÓ¥eCüݽ›}\:çɪŒkK. íË©ŠfD"úÓ®k;ç)ƒp)=MicroarrayDataProprietaryPlatformsData%ƒo)5MicroarrayDataTissueMicroarrayData-ƒn)EMicroarrayDataReversePhaseProteinArrayDataƒm))MicroarrayDataChipOnChipDataƒl)'MicroarrayDatamRNAArrayData"ƒk)/MicroarrayDataMicroRNAArrayData$ƒj)3MicroarrayDataGenotypingArrayData%ƒi)5MicroarrayDataMethylationArrayDataƒh))MicroarrayDataTwoChannelDataƒg))MicroarrayDataOneChannelData!ƒf)-MicroarrayDataMultiChannelDataƒe)#SequencingDataSpatialDataƒd))SequencingDataSingleCellDataƒc))SequencingDataMicrobiomeDataƒb)%SequencingDataSmallRNADataƒa)'SequencingDataSangerSeqDataƒ`)SequencingDatamiRNADataƒ_)%SequencingDataExomeSeqDataƒ^)'SequencingDataMethylSeqDataƒ])!SequencingDataRIPSeqDataƒ\)#SequencingDataChIPSeqDataƒ[)!SequencingDataRNASeqDataƒZ)!SequencingDataDNASeqData2ƒY5CMassSpectrometryDataImagingMassSpectrometryDataƒX!1CancerDataProstateCancerDataƒW!/CancerDataOvarianCancerDataƒV!)CancerDataLungCancerDataƒU!1CancerDataLeukemiaCancerDataƒT!-CancerDataKidneyCancerDataƒS!+CancerDataColonCancerDataƒR!-CancerDataBreastCancerData$ƒQ+1PackageTypeDataImmunoOncologyDataƒP+'PackageTypeDataExperimentHubƒO)RepositoryDataENCODE#ƒN)1RepositoryDataProject1000genomes+ƒM)ARepositoryDataPathwayInteractionDatabaseƒL)RepositoryDataNCIƒK)%RepositoryDataArrayExpressƒJ)RepositoryDataGEOƒI)RepositoryDataHapMap ƒH+)AssayDomainDataExpressionDataƒG+AssayDomainDataSNPDataƒF+'AssayDomainDataCpGIslandData)ƒE+;AssayDomainDataCopyNumberVariationDataƒD))TechnologyDataMicroarrayDataƒC))TechnologyDataSequencingDataƒB)TechnologyDataCGHDataƒA)TechnologyDataSAGEData)ƒ@)=TechnologyDataMicrotitrePlateAssayDataƒ?)TechnologyDataqPCRData%ƒ>)5TechnologyDataMassSpectrometryData*ƒ=)?TechnologyDataHighThroughputImagingData"ƒ<)/TechnologyDataFlowCytometryDataƒ;%DiseaseModelCOPDDataƒ:%DiseaseModelHIVDataƒ9%!DiseaseModelCancerData$ƒ8%7OrganismDataEscherichia_coli_Data)ƒ7%AOrganismDataEremothecium_gossypii_Data&ƒ6%;OrganismDataDrosophila_virilis_Data+ƒ5%EOrganismDataDrosophila_melanogaster_Dataƒ4%-OrganismDataDanio_rerio_Data&ƒ3%;OrganismDataCiona_intestinalis_Data$ƒ2%7OrganismDataCanis_familiaris_Data&ƒ1%;OrganismDataCallithrix_jacchus_Data*ƒ0%COrganismDataCaenorhabditis_elegans_Dataƒ/%+OrganismDataBos_taurus_Data%ƒ.%9OrganismDataBacillus_subtilis_Data(ƒ-%?OrganismDataArabidopsis_thaliana_Data&ƒ,%;OrganismDataArabidopsis_lyrata_Data"ƒ+%3OrganismDataApis_mellifera_Data%ƒ*%9OrganismDataAnopheles_gambiae_Dataƒ)%'OrganismDataZea_mays_Data&ƒ(%;OrganismDataXenopus_tropicalis_Data"ƒ'%3OrganismDataXenopus_laevis_Data"ƒ&%3OrganismDataVitis_vinifera_Data%ƒ%%9OrganismDataTriticum_aestivum_Data'ƒ$%=OrganismDataTaeniopygia_guttata_Dataƒ#%+OrganismDataSus_scrofa_Data)ƒ"%AOrganismDataStaphylococcus_aureus_Data-ƒ!%IOrganismDataSchizosaccharomyces_pombe_Data)ƒ %AOrganismDataSaccharum_officinarum_Data,ƒ%GOrganismDataSaccharomyces_cerevisiae_Data%ƒ%9OrganismDataRattus_norvegicus_Data*ƒ%COrganismDataPseudomonas_aeruginosa_Data)ƒ%AOrganismDataPlasmodium_falciparum_Data#ƒ%5OrganismDataPan_troglodytes_Data ƒ%/OrganismDataPan_paniscus_Data ƒ%/OrganismDataOryza_sativa_Data'ƒ%=OrganismDataOncorhynchus_mykiss_Data%ƒ%9OrganismDataNeurospora_crassa_Data ƒ%/OrganismDataMus_musculus_Data)ƒ%AOrganismDataMonodelphis_domestica_Data&ƒ%;OrganismDataMedicago_truncatul_Data&ƒ%;OrganismDataMagnaporthe_grisea_Data"ƒ%3OrganismDataMacaca_mulatta_Data(ƒ%?OrganismDataKluyveromyces_lactis_Data#ƒ%5OrganismDataHordeum_vulgare_Data ƒ%/OrganismDataHomo_sapiens_Dataƒ%-OrganismDataGlycine_max_Data*ƒ %COrganismDataGasterosteus_aculeatus_Data!ƒ %1OrganismDataGallus_gallus_Dataƒ )SpecimenSourceSomaticƒ )SpecimenSourceGermlineƒ )#SpecimenSourceCellCultureƒ)SpecimenSourceStemCellƒ)SpecimenSourceGenomeƒ)SpecimenSourceProteomebiocViews/inst/htmlfrags/0000755000175200017520000000000014710217211016466 5ustar00biocbuildbiocbuildbiocViews/inst/htmlfrags/topfrag.html0000644000175200017520000000044314710217211021017 0ustar00biocbuildbiocbuild Bioconductor Task View: top level views

Bioconductor Task View: top level views

Maintainer: None

Has subviews:

    biocViews/inst/script/0000755000175200017520000000000014710217211016003 5ustar00biocbuildbiocbuildbiocViews/inst/script/recommend_biocViews_rpacks.R0000644000175200017520000001255314710217211023462 0ustar00biocbuildbiocbuildrm(list=ls()) readPathFromManifest <- function(rpacks, manifest) { pkgs <- readLines(file.path(rpacks, manifest)) pkgs <- sub("Package:[[:space:]]*([[:alnum:]\\.]+)[[:space:]]*$", "\\1", pkgs[grepl("Package:", pkgs)]) fls <- sprintf(file.path(rpacks, "%s/DESCRIPTION"), pkgs) names(fls) <- pkgs fls <- fls[file.exists(fls)] } readDot <- function(fl) { dot <- readLines(fl) dot <- dot[seq(grep("BiocViews -> Software", dot), grep("BiocViews -> AnnotationData", dot) - 1)] sub(" *; *$", "", dot[grepl("^[[:space:][:alpha:]]+->", dot)]) } findbiocViews<- function(file, dotterms, terms) { ## strategy 1- parse the words in the DESCRIPTION file to get ## biocViews dcf <- read.dcf(file, c("Description", "Title", "Package")) words1 <- unique(unlist(strsplit(dcf, " "))) ## strategy 2- get biocViews of packages in depends field. pkgs <- read.dcf(file, "Depends") pkgs <- unlist(strsplit(gsub("[0-9.()>= ]", "", pkgs), ",")) x <- readLines(url("http://bioconductor.org/js/versions.js")) dv <- x[grep("develVersion", x)] devel_version <- strsplit(dv, '"')[[1]][2] repos <- c("bioc", "data/annotation", "data/experiment") urls <- paste0("http://bioconductor.org/packages/", devel_version, "/bioc/VIEWS") words2 <- character() con <- url(urls) biocpkgs <- read.dcf(con,"Package") idx <- which(biocpkgs %in% pkgs) if (length(idx)!=0) { wrd <- read.dcf(con, "biocViews")[idx] wrd <- unique(unlist(strsplit(wrd, ", "))) words2 <- c(words2,wrd) } close(con) ##stragegy -3 man pages parsing. manfls <- list.files(file.path(gsub("/DESCRIPTION","",file),"man"), full.names=TRUE,pattern="\\.Rd$") ##stragegy -4 vignette pages parsing. vinfls <- list.files(file.path(gsub("/DESCRIPTION","",file),"vignettes"), full.names=TRUE, pattern="\\.Rnw$") allfls <- c(manfls,vinfls) if(length(allfls)==0){ all_words <- NA }else{ q <- lapply(allfls, readLines) temp <- unlist(strsplit(q[[1]], "[[:punct:]]", perl = TRUE)) temp <- unlist(strsplit(temp, "[[:space:]]", perl = TRUE)) all_words <- unique(temp[temp != ""]) } # combine words from all sources and map if (length(words2)!=0) { words <- c(words1, words2,all_words) } else { words <- c(words1,all_words) } words <- unique(unlist(strsplit(words,"\n"))) ## match against biocViews. idx <- which(tolower(dotterms) %in% tolower(words)) temp <- dotterms[idx] ## only if both "decision" and "tree" are found add biocView "DecisionTree" split_word <- mapply(FUN= function(x,y){ i <- which(tolower(x) %in% tolower(words)) ifelse(length(i)==length(x), y, NA) }, terms, names(terms), USE.NAMES=FALSE) suggest_bioc <- unique(c(split_word[complete.cases(split_word)], temp)) commonbiocViews <- c("Infrastructure","Software", "AssayDomain","BiologicalQuestion","Infrastructure", "ResearchField","StatisticalMethod","Technology", "Annotation","Visualization","DataRepresentation", "miRNA","SNP","qPCR","SAGE","Genetics" ) suggest_bioc <- setdiff(suggest_bioc,commonbiocViews) ## existing biocView in test package? current <- read.dcf(file, c("biocViews","BiocViews")) current <- current[!is.na(current)] ## setdiff between current and suggested biocViews. if(length(current)!=0){ current <- strsplit(current, "[[:space:]]*,[[:space:]]*")[[1]] new_bioc <- setdiff(suggest_bioc, current) }else{ new_bioc <- NA_character_ } ## some pkgs have terms which do not belong to software branch. remove <- setdiff(current, dotterms) ##maintainer - email email <- read.dcf(file, "Maintainer") list(current = paste(current, collapse=", "), new = paste(new_bioc, collapse=", "), remove = paste(remove, collapse=", "), email = paste(unlist(strsplit(email,"\n")),collapse=" ") ) } library(BiocParallel) rpacks <- file.path("~/Rpacks") #rpacks <- file.path("home","sarora","Rpacks") # on rhino manifest <- "bioc_3.0.manifest" biocViewdotfile <- system.file("dot","biocViewsVocab.dot", package="biocViews") # read path from Rpacks fls <- readPathFromManifest(rpacks, manifest) cat("Total no of packages :",length(fls) ) #read biocViews from dot file. dot <- readDot(biocViewdotfile) dotterms <- unique(unlist(strsplit(dot, " *-> *"))) ### split "DecsisionTree" to "decision" , "tree" terms <- sapply(dotterms, function(x){ m <- gregexpr(pattern= "[[:upper:]]", text = x, ignore.case=FALSE) s1 <- unlist(regmatches(x,m)) s2 <- unlist(strsplit(x, "[[:upper:]]")) s2 <- s2[-1] word<-function(s1,s2) paste0(s1,s2) mapply(word, s1,s2, USE.NAMES=FALSE) }, simplify = TRUE) ## suggest biocViews. system.time(result <- lapply(fls[1:20], findbiocViews, dotterms, terms)) newbioc2 <- do.call(rbind.data.frame,result) write.table(newbioc2,"suggestedbiocViews_rpacks.txt",sep="\t", quote=FALSE) biocViews/inst/script/reviseBiocViews.R0000644000175200017520000002523514710217211021245 0ustar00biocbuildbiocbuild## this script contains functions used in devel -2.14 version ##-------------helper functions rm(list=ls()) biocViewMap <- function() { webmap <- c( AssayDomains=NA_character_, AssayTechnologies="Technology", Bioinformatics=NA_character_, BiologicalDomains=NA_character_, ConnectTools="ThirdPartyClient", Enrichment=NA_character_, GraphsAndNetworks="GraphAndNetwork", HighThroughputSequencing="Sequencing", Methylseq="MethylSeq", MultipleComparisons="MultipleComparison", NetworkAnalysis="Network", Networks="Network", NetworkVisualization="Visualization", Regulation=NA_character_, RNAseq="RNASeq", Sequences=NA_character_, Signaling= NA_character_ ) usermap <- c( AffymetrixChip="OneChannel", Affymetrix="OneChannel", BatchEffectAssessment="BatchEffect", ChiPseq="ChIPSeq", ChIPseq="ChIPSeq", ClusterValidation="Clustering", CopyNumberVariants="CopyNumberVariation", CNV="CopyNumberVariation", DataPreprocessing="Preprocessing", Design="ExperimentalDesign", DNAmethylation="DifferentialMethylation", DualChannel="TwoChannel", Flowcytometry="FlowCytometry", FlowCytData="FlowCytometry", `Flow cytometry`="FlowCytometry", `High Throughput Sequencing`="Sequencing", genetics="Genetics", HighTroughputSequencingData="Sequencing", HighThroughputSequencingData="Sequencing", Microarrays="Microarray", MicroArray="Microarray", microRNA="miRNA", MRNAMicroarray="mRNAMicroarray", `Multiple Comparisons`="MultipleComparison", RIPseq="RIPSeq", RNAExpressionData="DifferentialExpression", SequenceAnnotation="GenomeAnnotation", SequencingMatching="SequenceMatching", `SNP.`="SNP", Statistics="StatisticalMethod", Technology=NA_character_, Visualisation="Visualization", visualization="Visualization" ) c(webmap,usermap) } readPathFromManifest <- function(rpacks, manifest) { pkgs <- readLines(file.path(rpacks, manifest)) pkgs <- sub("Package:[[:space:]]*([[:alnum:]\\.]+)[[:space:]]*$", "\\1", pkgs[grepl("Package:", pkgs)]) fls <- sprintf(file.path(rpacks, "%s/DESCRIPTION"), pkgs) names(fls) <- pkgs fls <- fls[file.exists(fls)] } readbiocViewsFromRpacks <- function(fls) { otermsl <- lapply(fls, function(fl) { term <- read.dcf(fl, c("biocViews","BiocViews")) term <- term[!is.na(term)] if(length(term!=0)) strsplit(term, "[[:space:]]*,[[:space:]]*")[[1]] else NA_character_ }) pkgterm <- data.frame(pkg = rep(names(otermsl), sapply(otermsl, length)), term = unlist(unname(otermsl)), stringsAsFactors=FALSE) } generatebiocViewsMap <- function(pkgterm, map) { pkgterm$newterm <- pkgterm$term idx <- match(pkgterm$newterm, names(map)) pkgterm$newterm[!is.na(idx)] <- unname(map[pkgterm$newterm[!is.na(idx)]]) pkgterm } readVersionFromRpacks <- function(versionPath) { otermslVersion <- lapply(versionPath, function(ver) { dcf <- read.dcf(ver ) v <- package_version(dcf[, "Version"]) v0 = unclass(v) v0$Version[3] = v0$Version[3] +1 class(v0) = class(v) c(as.character(v),as.character(v0)) }) ver <- data.frame(matrix(unlist(otermslVersion), nrow=length(otermslVersion), byrow=T, dimnames=list(names(otermslVersion),c("oldVer","newVer")))) ver <- cbind(rownames(ver),ver ) names(ver)<- c("pkg","oldVer","newVer") rownames(ver) <- NULL ver } readDot <- function(fl) { dot <- readLines(fl) dot <- dot[seq(grep("BiocViews -> Software", dot), grep("BiocViews -> AnnotationData", dot) - 1)] sub(" *; *$", "", dot[grepl("^[[:space:][:alpha:]]+->", dot)]) } getPathfromPkgName<- function(fls, pkglist) { fls[which(names(fls) %in% pkglist)] } suggestbiocViews <- function(pkgterm, mer, biocViewdotfile, flag=TRUE,fls) { ##read in dot file to get new terms dot <- readDot(biocViewdotfile) dotterms <- unique(unlist(strsplit(dot, " *-> *"))) ##no biocViews? xx = sapply(split(is.na(pkgterm$newterm), pkgterm$pkg), function(elt) sum(elt) == length(elt)) any(xx) nobiocView <- xx[xx] names(nobiocView) pkgterm[which(pkgterm$pkg %in% names(xx[xx])),] #get the path for packages that do not have biocViews nobiocViewPath <- getPathfromPkgName(fls, names(nobiocView)) sugbiocView <- lapply(nobiocViewPath, function(x){ words <- unique(unlist(strsplit(read.dcf(x,c("Description","Title","Package"))," "))) idx <- which(tolower(dotterms) %in% tolower(words)) dotterms[idx] }) if(flag) { ##packages that have biocViews now! found <- sugbiocView[lapply(sugbiocView,length)>0] found <- lapply(found, function(x) paste(unlist(x),collapse=", " )) #add the suggested biocViews to mer. idx <- match(names(found), mer$pkg) mer[idx,3]<- as.character(found) }else{ #still do not have biocViews! realbad <- sugbiocView[lapply(sugbiocView,length)==0] #these files have no biocViews - manually add biocViews for them. mer <- mer[which(mer[,1] %in% names(realbad)),] } mer } ##--------main function newBiocViews <- function(manifest,rpacks,biocViewdotfile, makeChanges=FALSE, resfilename) { #The manifest file contains all the packages list. # Read in all package names from here. fls <- readPathFromManifest(rpacks, manifest) cat("Total no of packages :",length(fls) ) #get the biocViews from all packages in the repository pkgterm <- readbiocViewsFromRpacks(fls) ##read in changes map <- biocViewMap() ##map the new/suggested biocViews to existing biocViews pkgterm <- generatebiocViewsMap(pkgterm, map) ## comma sepearated biocViews yy = lapply(split(pkgterm, pkgterm$pkg), function(elt) { elt$term <- paste(elt$term,collapse=", ") elt$newterm <- paste(na.omit(elt$newterm),collapse=", ") unique(elt) }) #represnt as a data.frame yes <- do.call(rbind.data.frame,yy) ## which packages had no change in their biocViews? nochange2 <- yes[which(yes$term==yes$newterm),] cat("no of packages notchanges at all :",length(nochange2[,1]) ) ## which package had changes in their biocViews modified2 <- yes[which(yes$term!=yes$newterm),] cat("no of packages changed :",length(modified2[,2]) ) #get packages whose version has to be bumped versionfls<- modified2[,1] #get the path for each of these packages versionPath <- getPathfromPkgName(fls, versionfls) # data.frame with package name, old followed by new version number. versiondf <- readVersionFromRpacks(versionPath) #merging mer <- merge(modified2,versiondf, by="pkg") ##suggest biocViews for packages with no biocViews ## returns a data.frame for modified mer <- suggestbiocViews(pkgterm, mer, biocViewdotfile,flag=TRUE,fls) ## which packages are realbad? still do not have biocViews - just write to file badmer <- suggestbiocViews(pkgterm,mer, biocViewdotfile,flag=FALSE,fls) write.table(badmer,"badbiocViews.txt",sep="\t",quote=FALSE,row.names=FALSE) if(makeChanges) { ##how do we make the changes here? }else{ write.table(mer, resfilename, sep="\t",quote=FALSE,row.names=FALSE) } } makechanges<- function(filename) { #filename <- "revisebiocViews.txt" revisemat <- read.table(filename, sep="\t",header=TRUE, stringsAsFactors=FALSE) # no of packages to be changes pkglist <- nrow(revisemat) # first get the path for each package in file pkgpath <- file.path(rpacks,revisemat[,1],"DESCRIPTION") for (x in 1:nrow(revisemat)){ cat(x,"\n") # open the description file data <- read.dcf(pkgpath[x]) #bump the version number data[,"Version"] <- revisemat[x,"newVer"] ## four cases possible #1 - no biocViews eg:which(revisemat[,1]=="vtpnet") -476 #2 - BiocViews eg: which(revisemat[,1]=="PSICQUIC") -348 #3 - biocViews eg: which(revisemat[,1]=="a4") - 1 #4- bioViews eg: which(revisemat[,1]=="EBSeq") -139 wrongidx <- which(colnames(data) %in% c("BiocViews","bioViews","biocViews")) ## contains BiocViews or bioViews ( remove it!) if(length(wrongidx) != 0){ cat("I am in !") data <- data[1, -wrongidx,drop=FALSE] } ## add biocViews to pkg data <- cbind(data,"biocViews"=revisemat[x,"newterm"]) ##write to package write.dcf(data,file=pkgpath[x]) } } # usage # ## on rhino01 # ## devel # # rpacks <- file.path("~/biosrc/Rpacks") # manifest <- "bioc_2.14.manifest" # biocViewdotfile <- "biocViewsVocab.dot" # newBiocViews(manifest, rpacks, biocViewdotfile, # makeChanges=FALSE,"revisebiocViews-devel.txt") # # makechanges("revisebiocViews-devel.txt") # # ## on rhino01 # ## release # # rpacks <- file.path("~/Rpacks") # manifest <- "bioc_2.14.manifest" # biocViewdotfile <- "biocViewsVocab.dot" # newBiocViews(manifest, rpacks, biocViewdotfile, # makeChanges=FALSE,"revisebiocViews-release.txt") # # makechanges("revisebiocViews-release.txt") ##Modify biocViews to remove duplicate biocViews duplicatedbiocViews <- function(rpacks, filename) { revisemat <- read.table(filename, sep="\t", header=TRUE, stringsAsFactors=FALSE) pkglist <- nrow(revisemat) pkgpath <- file.path(rpacks,revisemat[,1],"DESCRIPTION") result <- lapply(pkgpath, function(fl) { u <- unique(unlist(strsplit(read.dcf(fl,"biocViews"),", "))) o <- unlist(strsplit(read.dcf(fl,"biocViews"),", ")) identical(o,u) }) pkgpath[which(result==FALSE)] } ##This function reads a character conatining old biocViews and returns ## the correspoponding new biocView terms. old2newbiocViews <- function(file) { terms <- read.dcf(file, c("biocViews","BiocViews")) old <- strsplit(terms, "[[:space:]]*,[[:space:]]*")[[1]] map <- biocViewMap() idx <- match(old, names(map)) newbiocView <- old newbiocView[!is.na(idx)] <- unname(map[newbiocView[!is.na(idx)]]) paste(newbiocView[complete.cases(newbiocView)],collapse=", ") } biocViews/inst/script/revise_expt_biocViews.R0000644000175200017520000001062114710217211022475 0ustar00biocbuildbiocbuild## Rscript for updating Experiment Data biocViews ## Dec 5th 2014. library(biocViews) rm(list=ls()) dirname <- "pkgs" ## read in all files and recommend new biocViews. pkgnames <- list.files(dirname) pkgnames <- pkgnames[!grepl("add_data.py",pkgnames)] pkgnames <- pkgnames[!grepl(".manifest$",pkgnames)] pkgnames <- pkgnames[!grepl("README.txt",pkgnames)] pkgnames <- pkgnames[!grepl("-meat.sh$",pkgnames)] genome_tbl <- rtracklayer::ucscGenomes(organism=TRUE) result <- lapply(pkgnames, function(x) { pkgdir <- file.path(dirname,x) message(x) ## add tryCatch! tryCatch({ a <- recommendBiocViews(pkgdir, branch = "ExperimentData") message(a) a }, error=function(err) { warning(x, ": ", conditionMessage(err)) }) }) current <- sapply(result, "[[", "current") recommended <- sapply(result, "[[", "recommended") remove <- sapply(result, "[[", "remove") df<- data.frame(pkgnames=pkgnames, current=current, recommended=recommended, remove=remove, stringsAsFactors =FALSE) webmap <- c( FlowCytometry="FlowCytometryData", RNAExpressionData="RNASeqData", miRNAoverexpression="miRNAData", NormalTissue="Tissue" ) final <- apply(df,1, function(z){ c1 <- unlist(strsplit(as.character(z[2]),", ")) c1 <- c(c1, as.character(webmap[c1][complete.cases(webmap[c1])])) rec <- unlist(strsplit(as.character(z[3]),", ")) rem <- unlist(strsplit(as.character(z[4]),", ")) fi <- unique(setdiff(c(c1,rec),rem)) paste(fi, collapse=", ") }) df2 <- data.frame(df, final=final, stringsAsFactors = FALSE ) terms <- getCurrentbiocViews() expt <- terms$ExperimentData nf <- lapply(as.character(df2$final), function(z) unlist(strsplit(z,", "))) qr <- table(unlist(nf)) mat <- data.frame(names(qr), as.integer(qr)) mat <- mat[order(mat[,2]), ] colnames(mat) <- c("Expt_biocViews", "occurence_in_pkgs") write.table(mat, "count_of_biocViews_dec5.txt", sep="\t", quote=FALSE, row.names=FALSE) ### update in svn rm(list=ls()) df2 <- read.table("df2_dec5.txt", sep="\t", header=TRUE, stringsAsFactors = FALSE) df2[64,5]<-"GEO" dirname <- file.path(getwd(),"pkgs") pkgnames <- list.files(dirname) pkgnames <- pkgnames[!grepl("add_data.py",pkgnames)] pkgnames <- pkgnames[!grepl(".manifest$",pkgnames)] pkgnames <- pkgnames[!grepl("README.txt",pkgnames)] pkgnames <- pkgnames[!grepl("-meat.sh$",pkgnames)] changemat <- matrix(ncol=5, nrow=length(pkgnames)) reviseVersions <- function(v) { vsp <- strsplit(v,"[.]") vsp$Version[3] <- as.integer(vsp$Version[3])+1 paste(vsp$Version,collapse=".") } change=TRUE for (i in 1:length(pkgnames)){ pkg <- pkgnames[i] pkgdir <- file.path(dirname, pkg,"DESCRIPTION") data <- read.dcf(pkgdir, keep.white = TRUE) fi <- colnames(data) rm(data) data <- read.dcf(pkgdir, keep.white = fi) b_ind <- which(colnames(data)=="biocViews") if(length(b_ind)==0){ oldbiocView <-"" message(pkg) message("No biocViews in this package!!") mat=matrix(df2[i,"final"],nrow=1,ncol=1) newbiocView <- mat colnames(mat)<-"biocViews" data <- cbind(data,mat) oldVersion <- data[,"Version"] newVersion <- reviseVersions(oldVersion) data[,"Version"] <- newVersion } else{ oldbiocView <- gsub("\n","",data[,"biocViews"]) newbiocView <- df2[i,"final"] if(oldbiocView!=newbiocView){ data[,"biocViews"] <- newbiocView } oldVersion <- data[,"Version"] newVersion <- reviseVersions(oldVersion) data[,"Version"] <- newVersion } changemat[i,1] <- pkg changemat[i,2] <- oldbiocView changemat[i,3] <- newbiocView changemat[i,4] <- oldVersion changemat[i,5] <- newVersion if(change) write.dcf(data, pkgdir, keep.white=fi) } write.table(changemat, "changemat_dec5.txt",sep="\t", col.names=c("pkg","oldbiocView","newbiocView","oldVer","newVer"), quote=FALSE, row.names=FALSE) ##get email id of maintainer to email emailist <- lapply(pkgnames, function(p){ message(p) pkgdir <- file.path(dirname, p,"DESCRIPTION") data <- read.dcf(pkgdir) data[,"Maintainer"] }) em <- unique(unlist(emailist)) em <- gsub("\n","",em) em2 <- paste(em, collapse=", ") biocViews/inst/script/revisebiocViews2014.R0000644000175200017520000002012414710217211021604 0ustar00biocbuildbiocbuild ## ----style, eval=TRUE, echo=FALSE, results="asis"------------------------ BiocStyle::latex() ## ----preliminaries, echo=FALSE------------------------------------------- rm(list=ls()) biocViewMap <- function() { webmap <- c( AssayDomains=NA_character_, AssayTechnologies="Technology", Bioinformatics=NA_character_, BiologicalDomains=NA_character_, ConnectTools="ThirdPartyClient", Enrichment=NA_character_, GraphsAndNetworks="GraphAndNetwork", HighThroughputSequencing="Sequencing", Methylseq="MethylSeq", MultipleComparisons="MultipleComparison", NetworkAnalysis="Network", Networks="Network", NetworkVisualization="Visualization", Regulation=NA_character_, RNAseq="RNASeq", Sequences=NA_character_, Signaling= NA_character_ ) usermap <- c( AffymetrixChip="OneChannel", Affymetrix="OneChannel", BatchEffectAssessment="BatchEffect", ChiPseq="ChIPSeq", ChIPseq="ChIPSeq", ClusterValidation="Clustering", CopyNumberVariants="CopyNumberVariation", CNV="CopyNumberVariation", DataPreprocessing="Preprocessing", Design="ExperimentalDesign", DNAmethylation="DifferentialMethylation", DualChannel="TwoChannel", Flowcytometry="FlowCytometry", FlowCytData="FlowCytometry", `Flow cytometry`="FlowCytometry", `High Throughput Sequencing`="Sequencing", genetics="Genetics", HighTroughputSequencingData="Sequencing", HighThroughputSequencingData="Sequencing", Microarrays="Microarray", MicroArray="Microarray", microRNA="miRNA", MRNAMicroarray="mRNAMicroarray", `Multiple Comparisons`="MultipleComparison", RIPseq="RIPSeq", RNAExpressionData="DifferentialExpression", SequenceAnnotation="GenomeAnnotation", SequencingMatching="SequenceMatching", `SNP.`="SNP", Statistics="StatisticalMethod", Technology=NA_character_, Visualisation="Visualization", visualization="Visualization" ) c(webmap,usermap) } readPathFromManifest <- function(rpacks, manifest) { pkgs <- readLines(file.path(rpacks, manifest)) pkgs <- sub("Package:[[:space:]]*([[:alnum:]\\.]+)[[:space:]]*$", "\\1", pkgs[grepl("Package:", pkgs)]) fls <- sprintf(file.path(rpacks, "%s/DESCRIPTION"), pkgs) names(fls) <- pkgs fls <- fls[file.exists(fls)] } readbiocViewsFromRpacks <- function(fls) { otermsl <- lapply(fls, function(fl) { term <- read.dcf(fl, c("biocViews","BiocViews")) term <- term[!is.na(term)] if(length(term!=0)) strsplit(term, "[[:space:]]*,[[:space:]]*")[[1]] else NA_character_ }) pkgterm <- data.frame(pkg = rep(names(otermsl), sapply(otermsl, length)), term = unlist(unname(otermsl)), stringsAsFactors=FALSE) } generatebiocViewsMap <- function(pkgterm, map) { pkgterm$newterm <- pkgterm$term idx <- match(pkgterm$newterm, names(map)) pkgterm$newterm[!is.na(idx)] <- unname(map[pkgterm$newterm[!is.na(idx)]]) pkgterm } readVersionFromRpacks <- function(versionPath) { otermslVersion <- lapply(versionPath, function(ver) { dcf <- read.dcf(ver ) v <- package_version(dcf[, "Version"]) v0 = unclass(v) v0$Version[3] = v0$Version[3] +1 class(v0) = class(v) c(as.character(v),as.character(v0)) }) ver <- data.frame(matrix(unlist(otermslVersion), nrow=length(otermslVersion), byrow=T, dimnames=list(names(otermslVersion),c("oldVer","newVer")))) ver <- cbind(rownames(ver),ver ) names(ver)<- c("pkg","oldVer","newVer") rownames(ver) <- NULL ver } readDot <- function(fl) { dot <- readLines(fl) dot <- dot[seq(grep("BiocViews -> Software", dot), grep("BiocViews -> AnnotationData", dot) - 1)] sub(" *; *$", "", dot[grepl("^[[:space:][:alpha:]]+->", dot)]) } getPathfromPkgName<- function(pkglist) { fls[which(names(fls) %in% pkglist)] } ## ----code-1-------------------------------------------------------------- ##get the listof packages from manifest file in Rpacks rpacks <- file.path("C:","Users","sarora.FHCRC","Documents","Rpacks") manifest <- "bioc_2.14.manifest" fls <- readPathFromManifest(rpacks, manifest) ## ----code2--------------------------------------------------------------- #this will read in all the biocViews from each package pkgterm <- readbiocViewsFromRpacks(fls) ## ----code3--------------------------------------------------------------- ## read in biocViews map map <- biocViewMap() as.data.frame(map) ## ----code-4-------------------------------------------------------------- ## revise biocViews pkgterm <- generatebiocViewsMap(pkgterm, map) ## ----Danfile------------------------------------------------------------- ## comma sepearated biocViews yy = lapply(split(pkgterm, pkgterm$pkg), function(elt) { elt$term <- paste(elt$term,collapse=", ") elt$newterm <- paste(na.omit(elt$newterm),collapse=", ") unique(elt) }) #represnt as a data.frame yes <- do.call(rbind.data.frame,yy) ## ----code-5-------------------------------------------------------------- ## which packages had no change in their biocViews? nochange2 <- yes[which(yes$term==yes$newterm),] length(nochange2[,1]) ## ----modified------------------------------------------------------------ ## which package had changes in their biocViews modified2 <- yes[which(yes$term!=yes$newterm),] length(modified2[,2]) ## ----version------------------------------------------------------------- #get packages whose version has to be bumped versionfls<- modified2[,1] #get the path for each of these packages versionPath <- getPathfromPkgName(versionfls) # data.frame with package name, old followed by new version number. versiondf <- readVersionFromRpacks(versionPath) #merging mer <- merge(modified2,versiondf, by="pkg") ## ----nobiocViews------------------------------------------------------------------ xx = sapply(split(is.na(pkgterm$newterm), pkgterm$pkg), function(elt) sum(elt) == length(elt)) any(xx) nobiocView <- xx[xx] names(nobiocView) pkgterm[which(pkgterm$pkg %in% names(xx[xx])),] ## ----suggest------------------------------------------------------------- ##read in the biocViews from dot file. dirpath <- file.path("C:","Users","sarora.FHCRC","Documents","sandbox", "project biocviews","19feb2014") dot <- readDot(file.path(dirpath, "biocViewsVocab.dot")) dotterms <- unique(unlist(strsplit(dot, " *-> *"))) nobiocViewPath <- getPathfromPkgName(names(nobiocView)) getDescription <- function(package) { lapply(package, function(x) read.dcf(x,"Description")) } sugbiocView <- lapply(nobiocViewPath, function(x){ words <- unique(unlist(strsplit(read.dcf(x,c("Description","Title","Package"))," "))) idx <- which(tolower(dotterms) %in% tolower(words)) dotterms[idx] }) ##packages that have biocViews now! found <- sugbiocView[lapply(sugbiocView,length)>0] found <- lapply(found, function(x) paste(unlist(x),collapse=", " )) #add the suggested biocViews to mer. idx <- match(names(found), mer$pkg) mer[idx,3]<- as.character(found) #still do not have biocViews! realbad <- sugbiocView[lapply(sugbiocView,length)==0] #these files have no biocViews - manually add biocViews for them. badmer <- mer[which(mer[,1] %in% names(realbad)),] ## ----write--------------------------------------------------------------- #write file for manual analysis setwd(file.path("C:","Users","sarora.FHCRC","Documents","sandbox", "project biocviews","19feb2014")) write.table(nochange2[1:2], "nochangebiocViews.txt",quote=FALSE, sep="\t",row.names=FALSE) write.table(badmer, "badbiocViews.txt",quote=FALSE,sep="\t",row.names=FALSE) write.table(mer, "revisebiocViews.txt",quote=FALSE,sep="\t",row.names=FALSE) ## ----sessionInfo--------------------------------------------------------- sessionInfo() biocViews/inst/unitTests/0000755000175200017520000000000014710217211016501 5ustar00biocbuildbiocbuildbiocViews/inst/unitTests/CITATION-tmpl0000644000175200017520000000121214710217211020604 0ustar00biocbuildbiocbuildcitEntry(entry="Article", author ="Robert C Gentleman and Vincent J. Carey and Douglas M. Bates and others", title ="Bioconductor: Open software development for computational biology and bioinformatics", journal = "Genome Biology", volume = "5", year = "2004", pages = "R80", url = "http://genomebiology.com/2004/5/10/R80", textVersion = paste( "Bioconductor: Open software development for computational biology", "and bioinformatics", "R. Gentleman, V. J. Carey, D. M. Bates, B.Bolstad, M. Dettling, S. Dudoit, B. Ellis, L. Gautier, Y. Ge, and others", "2004, Genome Biology, Vol. 5, R80") ) biocViews/inst/unitTests/test_biocViews.R0000644000175200017520000000350214710217211021615 0ustar00biocbuildbiocbuildtest_findBranchReadDot <- function() { checkException(.findBranchReadDot(current=c("ChipName"), branch="Software")) checkException(.findBranchReadDot(current=c("RNASeq","ChipName"), branch="Software")) checkException(.findBranchReadDot(current=c("Software"))) checkException(.findBranchReadDot( current=c("GUI, DNAMethylation, MethylationArray, IlluminaChip"), branch=c("Software","AnnotationData","ExperimentData"))) } test_recommendPackages <- function() { checkException(recommendPackages("")) checkException(recommendPackages(c("foo"))) checkException(recommendPackages(c("aCGH","Agilentchip"))) checkException(recommendPackages(c("aCGH","Agilentchip", "CancerData"))) pca <- recommendPackages(c("PrincipalComponent")) dr <- recommendPackages(c("DimensionReduction")) ans <- intersect(dr,pca) test <- recommendPackages(c("PrincipalComponent", "DimensionReduction")) checkEquals(length(test), length(ans)) checkIdentical(test, ans) test2 <- recommendPackages(c("PrincipalComponent", "DimensionReduction"), intersect.views=FALSE) checkEquals(length(unique(c(pca,dr))), length(test2)) ans <- recommendPackages(c("Principal")) checkEquals(length(ans), 0L) } test_guessPackageType <- function(){ checkIdentical(guessPackageType(character()), "Software") checkIdentical(guessPackageType(c("Clustering", "Classification")), "Software") checkIdentical(guessPackageType(c("Organism", "Homo_sapien")), "AnnotationData") checkIdentical(guessPackageType(c("TechnologyData", "SequencingData")), "ExperimentData") checkIdentical(guessPackageType(c("TechnologyData", "SequencingData", "Software")), "ExperimentData") } biocViews/inst/unitTests/test_citations.R0000644000175200017520000000530214710217211021660 0ustar00biocbuildbiocbuild setup1 <- function() { t <- file.path(tempdir(), "testing") if (file.exists(t)) unlink(t, recursive=TRUE) dir.create(t) dir.create(file.path(t, "testrepos", "src", "contrib"), recursive=TRUE) dir.create(file.path(t, "maketarballs", "biocViews"), recursive=TRUE) dir.create(file.path(t, "destdir")) file.copy(system.file("DESCRIPTION", package="biocViews"), file.path(t, "maketarballs", "biocViews")) vers <- as.character(packageVersion("biocViews")) oldwd <- getwd() on.exit(setwd(oldwd)) setwd(file.path(t, "maketarballs")) tar(file.path(t, "testrepos", "src", "contrib", paste0("biocViews_", vers, ".tar.gz")), "biocViews", compression="gzip" ) } test_citation_from_description <- function() { setup1() t <- file.path(tempdir(), "testing") unlink(file.path(t, "destdir"), recursive=TRUE) dir.create(file.path(t, "destdir")) extractCitations(file.path(t, "testrepos"), "src/contrib", file.path(t, "destdir")) checkTrue(file.exists(file.path(t, "destdir", "biocViews", "citation.html"))) lines <- readLines(file.path(t, "destdir", "biocViews", "citation.html")) #browser() checkTrue(any(grepl("Categorized views", lines))) } setup2 <- function() { t <- file.path(tempdir(), "testing") if (file.exists(t)) unlink(t, recursive=TRUE) dir.create(t) dir.create(file.path(t, "testrepos", "src", "contrib"), recursive=TRUE) dir.create(file.path(t, "maketarballs", "biocViews2", "inst"), recursive=TRUE) dir.create(file.path(t, "destdir")) file.copy(system.file("DESCRIPTION", package="biocViews"), file.path(t, "maketarballs", "biocViews2")) file.copy(system.file("unitTests", "CITATION-tmpl", package="biocViews"), file.path(t, "maketarballs", "biocViews2", "inst", "CITATION")) vers <- as.character(packageVersion("biocViews")) oldwd <- getwd() on.exit(setwd(oldwd)) setwd(file.path(t, "maketarballs")) tar(file.path(t, "testrepos", "src", "contrib", paste0("biocViews2_", vers, ".tar.gz")), "biocViews2", compression="gzip" ) } test_citation_from_citation <- function() { setup2() t <- file.path(tempdir(), "testing") unlink(file.path(t, "destdir"), recursive=TRUE) dir.create(file.path(t, "destdir")) extractCitations(file.path(t, "testrepos"), "src/contrib", file.path(t, "destdir")) checkTrue(file.exists(file.path(t, "destdir", "biocViews2", "citation.html"))) lines <- readLines(file.path(t, "destdir", "biocViews2", "citation.html")) checkTrue(any(grepl("Open software development", lines))) } biocViews/man/0000755000175200017520000000000014710217211014275 5ustar00biocbuildbiocbuildbiocViews/man/BiocView-class.Rd0000644000175200017520000000363014710217211017400 0ustar00biocbuildbiocbuild\name{BiocView-class} \docType{class} \alias{BiocView-class} \alias{bvTitle-class} \alias{bvPackageTable-class} \alias{bvSubViews-class} \alias{bvParentViews-class} \alias{coerce,BiocView,rdPackageTable-method} \alias{htmlDoc,BiocView-method} \alias{htmlFilename,BiocView-method} \alias{htmlValue,BiocView-method} \alias{htmlValue,bvSubViews-method} \alias{htmlValue,bvParentViews-method} \alias{show,BiocView-method} \title{Class "BiocView" } \description{Representation of of Bioconductor "view".} \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("BiocView", ...)}. } \section{Slots}{ \describe{ \item{\code{name}:}{Object of class \code{"character"} giving the name of the view. } \item{\code{subViews}:}{Object of class \code{"character"} giving the names of the subviews of this view.} \item{\code{parentViews}:}{Object of class \code{"character"} giving the names of the views that are this view's parents.} \item{\code{Title}:}{Object of class \code{"character"} giving longer description of view?} \item{\code{reposRoot}:}{Object of class \code{"character"} URL for repository } \item{\code{homeUrl}:}{Object of class \code{"character"} ? } \item{\code{htmlDir}:}{Object of class \code{"character"} ? } \item{\code{packageList}:}{Object of class \code{"list"} consisting of \code{PackageDetail-class} objects } } } \section{Extends}{ Class \code{"RepositoryDetail"}, directly. Class \code{"Htmlized"}, directly. } \section{Methods}{ \describe{ \item{coerce}{\code{signature(from = "BiocView", to = "rdPackageTable")}: ... } \item{htmlDoc}{\code{signature(object = "BiocView")}: ... } \item{htmlFilename}{\code{signature(object = "BiocView")}: ... } \item{htmlValue}{\code{signature(object = "BiocView")}: ... } \item{show}{\code{signature(object = "BiocView")}: ... } } } \author{Seth Falcon} \keyword{classes} biocViews/man/Htmlized-class.Rd0000644000175200017520000000076214710217211017454 0ustar00biocbuildbiocbuild\name{Htmlized-class} \docType{class} \alias{Htmlized-class} \alias{htmlDoc,Htmlized-method} \title{Class "Htmlized"} \description{A virtual class for HTML serialization method dispatch. } \section{Objects from the Class}{A virtual Class: No objects may be created from it.} \section{Methods}{ \describe{ \item{htmlDoc}{\code{signature(object = "Htmlized")}: Return the html-ized representation of \code{object} as a complete HTML document.} } } \author{Seth Falcon} \keyword{classes} biocViews/man/PackageDetail-class.Rd0000644000175200017520000001503714710217211020353 0ustar00biocbuildbiocbuild\name{PackageDetail-class} \docType{class} \alias{PackageDetail-class} \alias{pdAuthorMaintainerInfo-class} \alias{pdVignetteInfo-class} \alias{pdDownloadInfo-class} \alias{pdDetailsInfo-class} \alias{pdDescriptionInfo-class} \alias{pdVigsAndDownloads-class} \alias{htmlDoc,PackageDetail-method} \alias{htmlFilename,PackageDetail-method} \alias{htmlValue,PackageDetail-method} \alias{htmlValue,pdAuthorMaintainerInfo-method} \alias{htmlValue,pdVignetteInfo-method} \alias{htmlValue,pdDownloadInfo-method} \alias{htmlValue,pdDetailsInfo-method} \alias{htmlValue,pdDescriptionInfo-method} \alias{htmlValue,pdVigsAndDownloads-method} \title{Class "PackageDetail"} \description{Representation of R package metadata. Most slots correspond to fields in a package's DESCRIPTION file.} \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("PackageDetail", ...)}. } \section{Slots}{ \describe{ \item{\code{Package}:}{Object of class \code{"character"} see DESCRIPTION } \item{\code{Version}:}{Object of class \code{"character"} see DESCRIPTION } \item{\code{Title}:}{Object of class \code{"character"} see DESCRIPTION } \item{\code{Description}:}{Object of class \code{"character"} see DESCRIPTION } \item{\code{Author}:}{Object of class \code{"character"} see DESCRIPTION } \item{\code{Maintainer}:}{Object of class \code{"character"} see DESCRIPTION } \item{\code{Depends}:}{Object of class \code{"character"} see DESCRIPTION } \item{\code{Imports}:}{Object of class \code{"character"} see DESCRIPTION } \item{\code{Suggests}:}{Object of class \code{"character"} see DESCRIPTION } \item{\code{SystemRequirements}:}{Object of class \code{"character"} see DESCRIPTION } \item{\code{License}:}{Object of class \code{"character"} see DESCRIPTION } \item{\code{URL}:}{Object of class \code{"character"} see DESCRIPTION } \item{\code{biocViews}:}{Object of class \code{"character"} see DESCRIPTION } \item{\code{vignettes}:}{Object of class \code{"character"} giving paths to vignette pdf files in the repository } \item{\code{vignetteScripts}:}{Object of class \code{"character"} giving paths to vignette Stangled R files in the repository } \item{\code{vignetteTitles}:}{Object of class \code{"character"} giving the titles of the vignette files in the repository } \item{\code{source.ver}:}{Object of class \code{"character"} version string for the source package} \item{\code{win.binary.ver}:}{Object of class \code{"character"} version string for the 32-bit Windows binary package } \item{\code{mac.binary}:}{Object of class \code{"character"} version string for the macOS High Sierra binary package } \item{\code{mac.binary.mavericks.ver}:}{Object of class \code{"character"} version string for the OS X Mavericks binary package } \item{\code{mac.binary.el-capitan.ver}:}{Object of class \code{"character"} version string for the OS X El Capitan binary package } \item{\code{downloadStatsUrl}:}{Object of class \code{"character"} An optional URL for the download history statistics. } \item{\code{manuals}:}{Object of class \code{"character"} giving paths to reference manual pdf files in the repository} \item{\code{dependsOnMe}:}{Object of class \code{"character"} giving packages found in the repository that depend on this package} \item{\code{importsMe}:}{Object of class \code{"character"} giving packages found in the repository that imports this package} \item{\code{suggestsMe}:}{Object of class \code{"character"} giving packages found in the repository that suggest this package} \item{\code{functionIndex}:}{Object of class \code{"character"} Not used. Intended to hold function index data. } \item{\code{reposFullUrl}:}{Object of class \code{"character"} The URL for the full URL of the root of the repository. } \item{\code{reposRoot}:}{Object of class \code{"character"} The URL for the root of the repository. } \item{\code{viewRoot}:}{Object of class \code{"character"} The URL for the view of the repository. } \item{\code{devHistoryUrl}:}{Object of class \code{"character"} The URL for the development changelog. } } } \section{Extends}{ Class \code{"Htmlized"}, directly. } \section{Methods}{ \describe{ \item{htmlDoc}{\code{signature(object = "PackageDetail")}: Return an \code{XMLNode} instance containg a complete HTML document representation of the package.} \item{htmlFilename}{\code{signature(object = "PackageDetail")}: Return a filename appropriate for the HTML document representation. } \item{htmlValue}{\code{signature(object = "PackageDetail")}: Return \code{XMLNode} instance containing an HTML representation of the package. } } } \section{Details}{ \code{pdAuthorMaintainerInfo-class} \code{pdVignetteInfo-class} \code{pdDownloadInfo-class} \code{pdDetailsInfo-class} \code{pdDescriptionInfo-class} \code{pdVigsAndDownloads-class} Dummy classes for HTML generation. Each dummy class is a simple extension (it does not add any slots). The purpose of each dummy class is to allow for method dispatch to generate HTML via the \code{\link{htmlValue}} method. You can convert convert a \code{PackageDetail} instance to one of the dummy classes like this: \code{descInfo <- as(pdObj, "pdDescriptionInfo")} } \author{Seth Falcon} \examples{ pd <- new("PackageDetail", Package="MyFancyPackage", Version="1.2.3", Title="A Fancy Package", Description="This package does fancy things", Author="A. Coder", Maintainer="A. Coder ", Depends="methods", Imports="ASimplePackage", Suggests="MyDataPackage", biocViews="Infrastructure", vignettes="vignettes/MyFancyPackage/inst/doc/MFP1.pdf,\nvignettes/MyFancyPackage/inst/doc/MFP2.pdf", vignetteScripts="vignettes/MyFancyPackage/inst/doc/MFP1.R\nvignettes/MyFancyPackage/inst/doc/MFP2.R", vignetteTitles="MFP1 Document,\nMFP2 Document", source.ver="src/contrib/MyFancyPackage_1.2.3.tar.gz", win.binary.ver="bin/windows/contrib/4.0/MyFancyPackage_1.2.2.zip", mac.binary.ver="bin/macosx/contrib/4.0/MyFancyPackage_1.2.3.tgz", dependsOnMe=c("PackageThatExposesMe"), importsMe=c("AnEvenFancierPackage","AMuchFancierPackage"), suggestsMe="PackageThatUsesMeInVignette", reposRoot="http://foo.bar.org") html <- htmlValue(pd) pd } \keyword{classes} biocViews/man/RepositoryDetail-class.Rd0000644000175200017520000000247714710217211021203 0ustar00biocbuildbiocbuild\name{RepositoryDetail-class} \docType{class} \alias{RepositoryDetail-class} \alias{rdPackageTable-class} \alias{htmlDoc,RepositoryDetail-method} \alias{htmlFilename,RepositoryDetail-method} \alias{htmlValue,RepositoryDetail-method} \alias{htmlValue,rdPackageTable-method} \title{Class "RepositoryDetail"} \description{Representation of R package repository index} \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("RepositoryDetail", ...)}. } \section{Slots}{ \describe{ \item{\code{Title}:}{Object of class \code{"character"} giving the title for the repository.} \item{\code{reposRoot}:}{Object of class \code{"character"} giving the root URL of the repository} \item{\code{homeUrl}:}{Object of class \code{"character"} ?} \item{\code{htmlDir}:}{Object of class \code{"character"} ? } \item{\code{packageList}:}{Object of class \code{"list"} consisting of objects of class \code{PackageDetail-class} } } } \section{Extends}{ Class \code{"Htmlized"}, directly. } \section{Methods}{ \describe{ \item{htmlDoc}{\code{signature(object = "RepositoryDetail")}: ... } \item{htmlFilename}{\code{signature(object = "RepositoryDetail")}: ... } \item{htmlValue}{\code{signature(object = "RepositoryDetail")}: ... } } } \author{Seth Falcon} \keyword{classes} biocViews/man/biocViews-package.Rd0000644000175200017520000000616614710217211020120 0ustar00biocbuildbiocbuild\name{biocViews-package} \alias{biocViews-package} \alias{biocViews} \docType{package} \title{ Categorized views of R package repositories } \description{ Structures for vocabularies and narratives of views. This can be used to create HTML views of the package structure in a Bioconductor repository. } \details{ \tabular{ll}{ Package: \tab biocViews\cr Version: \tab 1.11.4\cr Depends: \tab R (>= 2.4.0), methods, utils\cr Imports: \tab tools, Biobase, graph (>= 1.9.26), RBGL (>= 1.13.5), XML\cr Suggests: \tab Biobase\cr License: \tab Artistic-2.0\cr URL: \tab http://www.bioconductor.org/packages/release/BiocViews.html\cr biocViews: \tab Infrastructure\cr } Index: \preformatted{ BiocView-class Class "BiocView" Htmlized-class Class "Htmlized" PackageDetail-class Class "PackageDetail" RepositoryDetail-class Class "RepositoryDetail" biocViewsVocab Bioconductor Task Views Vocabulary Data extractVignettes Extract pdf vignettes from local package repository genReposControlFiles Generate CRAN-style repository control files getBiocSubViews Build a list of BiocView objects from a package repository getBiocViews Build a list of BiocView objects from a package repository getPacksAndViews Parse VIEWS file for views and packages getSubTerms Retrieve a term and its children from a vocab DAG htmlDoc Create a complete HTML document representation of an object htmlFilename Return a filename for an object's HTML representation htmlValue HTML Representation of an Object writeBiocViews Write a list of BiocView objects to HTML writeHtmlDoc Write an XML DOM containing HTML to a file writePackageDetailHtml Write HTML files for packages in a CRAN-style repository writeRepositoryHtml Write package descriptions and a repository index as HTML writeTopLevelView Write the view for the root of a vocabulary to disk write_REPOSITORY Write a REPOSITORY control file for a CRAN-style package repository write_SYMBOLS Write a SYMBOLS file write_VIEWS Write a VIEWS control file for a CRAN-style package repository } The terms of the vocabulary are stored in a DAG, which can be loaded as the serialized data object \code{biocViewsVocab}. For listing of available terms use function \code{getSubTerms}. Further information is available in the following two vignettes: \tabular{ll}{ \code{HOWTO-BCV} \tab Basic package usage\cr \code{createReposHtml} \tab Further information for repository admins\cr } } \author{ VJ Carey , BJ Harshfield , S Falcon Maintainer: Biocore Team c/o BioC user list } \keyword{ package } \examples{ data(biocViewsVocab) getSubTerms(biocViewsVocab, "Technology") } biocViews/man/biocViewsVocab.Rd0000644000175200017520000000144014710217211017470 0ustar00biocbuildbiocbuild\name{biocViewsVocab} \alias{biocViewsVocab} \docType{data} \title{Bioconductor Task Views Vocabulary Data} \description{ A \code{\link[graph]{graphNEL-class}} instance representing the Bioconductor Task Views as a directed graph. } \usage{data(biocViewsVocab)} \format{ The format is: graphNEL instance } \details{ The source for the vocabulary data is in the dot directory of the package in file biocViewsVocab.dot. This is transformed to GXL using the dot2gxl command line utility from the graphviz package. Then the \code{fromGXL} function from the \code{graph} package is used to convert to \code{graphNEL-class}. } \examples{ data(biocViewsVocab) biocViewsVocab ## If you have Rgraphviz available, you can ## plot the vocabulary with plot(biocViewsVocab) } \keyword{datasets} biocViews/man/dump_concept.Rd0000644000175200017520000000131414710217211017243 0ustar00biocbuildbiocbuild% Generated by roxygen2: do not edit by hand % Please edit documentation in R/dump_concept.R \name{dump_concept} \alias{dump_concept} \title{produce character stream for use with Protege entities/class hierarchy ingestion based on biocViews subgraphs} \usage{ dump_concept(x, edob = edges(biocViewsVocab)) } \arguments{ \item{x}{character(1) name of a node in the biocViewsVocab graph} \item{edob}{a list as produced by graph::edges} } \value{ a character atom with x abutting left and edge targets tab-indented } \description{ produce character stream for use with Protege entities/class hierarchy ingestion based on biocViews subgraphs } \examples{ cat(substring(dump_concept("ResearchField"), 1, 152), "\n") } biocViews/man/extractManuals.Rd0000644000175200017520000000262214710217211017561 0ustar00biocbuildbiocbuild\name{extractManuals} \alias{extractManuals} \alias{extractCitations} \title{Extract Rd man pages and build pdf reference manuals from local package repository} \description{ This function extracts Rd man pages and builds pdf reference manuals from the \code{man} subdirectory of R source packages archives (\code{.tar.gz}) found in a local package repository. All Rd files found in \code{man} will be extracted and used during the pdf construction process. Only source package archives will be processed. The constructed pdf files will be extracted under \code{destDir} and will be found in \code{PKGNAME/man/*.pdf}. Prior to extraction, all Rd and pdf files in \code{destDir/PKGNAME/man} will be removed. } \usage{ extractManuals(reposRoot, srcContrib, destDir) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{reposRoot}{character vector giving the path to the root of the local CRAN-style package repository} \item{srcContrib}{character vector giving the relative path from the \code{reposRoot} to the source packages. In a standard CRAN-style repository, this will be \code{src/contrib}.} \item{destDir}{character vector specifying the directory in which the extracted files will be written. If missing, files will be written to \code{/manuals}.} } \author{Patrick Aboyoun} \keyword{utilities} biocViews/man/extractNEWS.Rd0000644000175200017520000000070514710217211016735 0ustar00biocbuildbiocbuild\name{extractNEWS} \alias{extractNEWS} \title{Extract NEWS files from source package tarballs} \description{ Extracts NEWS files from source tarballs of packages. } \usage{ extractNEWS(reposRoot, srcContrib, destDir) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{reposRoot}{Top level path for CRAN-style repos} \item{srcContrib}{Location of source packages} \item{destDir}{where to extract} } \keyword{utilities} biocViews/man/extractTopLevelFiles.Rd0000644000175200017520000000103414710217211020672 0ustar00biocbuildbiocbuild\name{extractTopLevelFiles} \alias{extractTopLevelFiles} \title{Extract files from the top level of source package tarballs} \description{ Extracts files from source tarballs of packages. } \usage{ extractTopLevelFiles(reposRoot, srcContrib, destDir, fileName) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{reposRoot}{Top level path for CRAN-style repos} \item{srcContrib}{Location of source packages} \item{destDir}{where to extract} \item{fileName}{name of file to extract} } \keyword{utilities} biocViews/man/extractVignettes.Rd0000644000175200017520000000267514710217211020141 0ustar00biocbuildbiocbuild\name{extractVignettes} \alias{extractVignettes} \alias{extractHTMLDocuments} \title{Extract pdf vignettes from local package repository} \description{ These functions extract pdf or HTML files from the \code{inst/doc} subdirectory of R source packages archives (\code{.tar.gz}) found in a local package repository. All pdf files found in \code{inst/doc} will be extracted. With \code{extractHTMLDocuments}, all HTML files except \code{index.html} will be extracted. Only source package archives will be processed. The extracted pdf or HTML files will be extracted under \code{destDir} and will be found in \code{PKGNAME/inst/doc/}. Prior to extraction, all pdf files in \code{destDir/PKGNAME/inst/doc} will be removed. } \usage{ extractVignettes(reposRoot, srcContrib, destDir) extractHTMLDocuments(reposRoot, srcContrib, destDir) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{reposRoot}{character vector giving the path to the root of the local CRAN-style package repository} \item{srcContrib}{character vector giving the relative path from the \code{reposRoot} to the source packages. In a standard CRAN-style repository, this will be \code{src/contrib}.} \item{destDir}{character vector specifying the directory in which the extracted files will be written. If missing, files will be written to \code{/vignettes}.} } \author{Seth Falcon} \keyword{utilities} biocViews/man/genReposControlFiles.Rd0000644000175200017520000000437114710217211020677 0ustar00biocbuildbiocbuild\name{genReposControlFiles} \alias{genReposControlFiles} \title{Generate CRAN-style repository control files} \description{ This function generates control files for CRAN-style repositories. For each path specified in \code{contribPaths} a \code{PACKAGES} file is written. In addition, two top-level control files are created: \code{REPOSITORY} contains information about the specified contrib paths. \code{VIEWS} contains metadata for all packages in the repository including the paths to any extracted vignettes, if found. This file is useful for generating HTML views of the repository. } \usage{ genReposControlFiles(reposRoot, contribPaths, manifestFile = NA, meatPath = NA) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{reposRoot}{character vector containing the path to the CRAN-style repository root directory.} \item{contribPaths}{A named character vector. Valid names are \code{source}, \code{win.binary}, \code{mac.binary}, \code{mac.binary.mavericks}, and \code{mac.binary.el-capitan}. Values indicate the paths to the package archives relative to the \code{reposRoot}.} \item{manifestFile}{character(1). File path location to Bioconductor formatted manifest file that lists all current packages. This file will be used in the write_VIEWS function to cross check successfully built packages with all expected packages. Packages that have not built will be given dummy entry for complete listing in bioc_VIEWS. If NA cross check is skipped and packages not built on any system will be missing from biocVIEWS} \item{meatPath}{character(1). File path location to the directory containing cloned repositories of Bioconductor packages. If manifestFile is used for cross checking and the meatPath is provided, entries from the DESCRIPTION file are manually entered into biocVIEWS information. If NA dummy values for minimal fields for landing page generation are included with ERROR. This attempts to fill in as much information as possible for packages that have failed to build.} } \author{Seth Falcon} \seealso{ \code{\link[tools:writePACKAGES]{write_PACKAGES}}, \code{\link{extractVignettes}}, \code{\link{write_REPOSITORY}}, \code{\link{write_VIEWS}} } \keyword{utilities} biocViews/man/getBiocSubViews.Rd0000644000175200017520000000434514710217211017636 0ustar00biocbuildbiocbuild\name{getBiocSubViews} \alias{getBiocSubViews} \title{Build a list of BiocView objects from a package repository} \description{ This function returns a list of \code{\link{BiocView-class}} objects corresponding to the subgraph of the views DAG induced by \code{topTerm}. In short, this does the same thing as \code{\link{getBiocViews}}, but limits the vocabulary to \code{topTerm} and all of its decendents. } \usage{ getBiocSubViews(reposUrl, vocab, topTerm, local = FALSE, htmlDir = "") } %- maybe also 'usage' for other objects documented here. \arguments{ \item{reposUrl}{URL for a CRAN-style repository that hosts a \code{VIEWS} file at the top-level.} \item{vocab}{A \code{\link[graph]{graph-class}} object representing the ontologyof views. This graph should be a directed acyclic graph (DAG).} \item{topTerm}{A string giving the name of the subview DAG. This view and all of its decendents will be included in the result.} \item{local}{logical indicating whether to assume a local package repository. The default is \code{FALSE} in which case absolute links to package detail pages are created.} \item{htmlDir}{if the \code{local} argument is \code{TRUE}, this will be used as the relative path for package HTML files.} } \details{ The root of the vocabulary DAG is implicitly included in the view creation process order to build views with a link back to the top. It is removed from the return list. This function is tailored to generation of Bioconductor Task Views. With the current vocabulary, it probably only makes sense to call it with \code{topView} set to one of \code{"Software"}, \code{"AnnotationData"}, or \code{"ExperimentData"}. This is a hack to allow the biocViews code to manage HTML views across more than one repository. } \value{ A list of \code{BiocView-class} objects. The names of the list give the name of the corresponding view. } \author{Seth Falcon} \seealso{ \code{\link{write_VIEWS}}, \code{\link{writeBiocViews}} } \examples{ data(biocViewsVocab) reposPath <- system.file("doc", package="biocViews") reposUrl <- paste("file://", reposPath, sep="") biocViews <- getBiocSubViews(reposUrl, biocViewsVocab, "Software") print(biocViews[1:2]) } \keyword{utilities} biocViews/man/getBiocViews.Rd0000644000175200017520000000330214710217211017154 0ustar00biocbuildbiocbuild\name{getBiocViews} \alias{getBiocViews} \title{Build a list of BiocView objects from a package repository} \description{ Given the URL to a CRAN-style package repository containing a \code{VIEWS} file at the top-level and a \code{\link[graph]{graph-class}} object representing a DAG of views, this function returns a list of \code{\link{BiocView-class}} objects. } \usage{ getBiocViews(reposUrl, vocab, defaultView, local = FALSE, htmlDir = "") } %- maybe also 'usage' for other objects documented here. \arguments{ \item{reposUrl}{URL for a CRAN-style repository that hosts a \code{VIEWS} file at the top-level.} \item{vocab}{A \code{\link[graph]{graph-class}} object representing the ontology of views. This graph should be a directed acyclic graph (DAG).} \item{defaultView}{A string giving the term to use for packages that do not list a term of their own via the \code{biocViews} field in the \file{DESCRIPTION} file.} \item{local}{logical indicating whether to assume a local package repository. The default is \code{FALSE} in which case absolute links to package detail pages are created.} \item{htmlDir}{if the \code{local} argument is \code{TRUE}, this will be used as the relative path for package HTML files.} } \value{ A list of \code{BiocView-class} objects. The names of the list give the name of the corresponding view. } \author{Seth Falcon} \seealso{ \code{\link{write_VIEWS}}, \code{\link{writeBiocViews}} } \examples{ data(biocViewsVocab) reposPath <- system.file("doc", package="biocViews") reposUrl <- paste("file://", reposPath, sep="") biocViews <- getBiocViews(reposUrl, biocViewsVocab, "NoViewProvided") print(biocViews[1:2]) } \keyword{utilities} biocViews/man/getCurrentbiocViews.Rd0000644000175200017520000000134714710217211020566 0ustar00biocbuildbiocbuild\name{getCurrentbiocViews} \alias{getCurrentbiocViews} \title{ Get a list of biocViews for each branch } \description{ This function looks returns a list containing all the biocViews that are present on the Bioconductor website. } \usage{ getCurrentbiocViews() } \details{ It parses the dot file present inside the biocViews package. } \value{ It returns a named list with 3 components. \item{Software}{biocViews from the software branch} \item{ExperimentData}{biocViews from the ExperimentData branch} \item{AnnotationData}{biocViews from the AnnotationData branch} } \author{ Sonali Arora } \examples{ ans <- getCurrentbiocViews() ## only the first 6 from each branch are shown here. lapply(ans, head) }biocViews/man/getPackageNEWS.Rd0000644000175200017520000000410214710217211017311 0ustar00biocbuildbiocbuild\name{getPackageNEWS} \alias{getPackageNEWS} \alias{printNEWS} \title{ Retrieve and print package NEWS } \description{ These functions visit two Bioconductor releases, identifying packages that are present in the \sQuote{current} repository and have NEWS since the base version of the same package in the \sQuote{previous} release. All NEWS is reported for packages only in the current repository. } \usage{ getPackageNEWS(prevRepos="3.6", currRepos="3.7", repo=c("bioc", "data/experiment", "workflows"), srcdir = NULL) printNEWS(dbs, destfile, overwrite = FALSE, width = 68, output=c("md", "text"), relativeLink=FALSE, ...) } \arguments{ \item{prevRepos}{\code{character(1)} Bioconductor version from which NEWS starts.} \item{currRepos}{\code{character(1)} Bioconductor version for current packages.} \item{repo}{\code{character(1)} Which repository to get NEWS for. bioc is software packages, data/experiment is for data experiment packages and workflows for workflow packages} \item{srcdir}{Path to local checkout of package repositories, if NULL will try and use files on main builders} \item{dbs}{A list of \code{news_db} elements, as returned by \code{getPackageNEWS}.} \item{destfile}{\code{character(1)} file path to the location where NEWS will be printed.} \item{overwrite}{\code{logical(1)} indicating whether \code{destfile} can be over-written, if it exists.} \item{width}{\code{numeric(1)} number of characters news items are to be wrapped to, excluding indent.} \item{output}{\code{character(1)} output to text or markdown format.} \item{relativeLink}{Should links to packages be relative links on bioconductor.org website or include full url 'https//bioconductor.org'. default: FALSE is full url.} \item{...}{additional arguments, unused.} } \value{ A list of \code{news_db} files, as returned by \code{utils::news}, for each package for which relevant NEWS is available. } \author{ Martin Morgan \url{mtmorgan@fhcrc.org} and Lori Shepherd } \keyword{manip}% __ONLY ONE__ keyword per line biocViews/man/getPackageTitles.Rd0000644000175200017520000000476614710217211020021 0ustar00biocbuildbiocbuild\name{getPackageTitles} \alias{getPackageTitles} \alias{getPackageTitles} \alias{getPackageDescriptions} \title{ Retrieve list of package titles and print package Description } \description{ These functions visit two Bioconductor releases branches, identifying differnt packages that are present in the \sQuote{current} repository from the \sQuote{previous} release. Utilizes the devel branch of bioconductor to retrieve description. } \usage{ getPackageTitles(prevBranch="RELEASE_3_6", currBranch="devel", manifest=c("software.txt", "data-experiment.txt", "workflows.txt", "data-annotation.txt", "books.txt"), status = c("new", "removed")) getPackageDescriptions(pkgs, outfile, output=c("md", "text"), relativeLink=FALSE) } \arguments{ \item{prevBranch}{\code{character(1)} Bioconductor branch to compare to} \item{currBranch}{\code{character(1)} Bioconductor branch for current packages.} \item{manifest}{\code{character(1)} Which repository of pakcages to compare. software.txt is software packages, data-experiment.txt is for data experiment packages and workflows.txt for workflow packages} \item{status}{get new or removed package list comparing currBranch to prevBranch} \item{pkgs}{character() A list of packages to retrieve DESCRIPTION} \item{outfile}{\code{character(1)} file path to the location where DESCRIPTIONS will be printed.} \item{output}{\code{character(1)} output to text or markdown format.} \item{relativeLink}{Should links to packages be relative links on bioconductor.org website or include full url 'https//bioconductor.org'. default: FALSE is full url.} } \value{ A list of package titles. } \author{ Martin Morgan \url{mtmorgan@fhcrc.org} and Lori Shepherd } \examples{ \dontrun{ # At release time get a list of new or removed or deprecated packages # get new packages in release 3.7 that are not in 3.6 newSoft = getPackageTitles() # get removed packages from 3.6 rmSoft = getPackageTitles(currBranch="RELEASE_3_7", status="removed") # get depreacted package for 3.7 deprecatedSoft = setdiff(getPackageTitles(status="removed"), rmSoft) # repeated above for data-experiment packages newData = getPackageTitles(manifest="data-experiment.txt") rmData = getPackageTitles(currBranch="RELEASE_3_7", manifest="data-experiment.txt", status="removed") deprecatedData = setdiff(getPackageTitles(manifest="data-experiment.txt", status="removed"), rmData) } } \keyword{manip}% __ONLY ONE__ keyword per line biocViews/man/getPacksAndViews.Rd0000644000175200017520000000234714710217211017774 0ustar00biocbuildbiocbuild\name{getPacksAndViews} \alias{getPacksAndViews} \alias{permulist} %Undocumented code objects: % makeVocInfo pump tellSubTop tellSuperTop %Undocumented data sets: % gg oct05 \alias{makeVocInfo} \alias{pump} \alias{tellSubTop} \alias{tellSuperTop} \title{Parse VIEWS file for views and packages} \description{ Given a repository URL, download and parse the VIEWS file. } \usage{ getPacksAndViews(reposURL, vocab, defaultView, local=FALSE) } \arguments{ \item{reposURL}{character vector giving the URL of a CRAN-style repository containing a VIEWS file at the top-level.} \item{vocab}{A \code{\link[graph]{graph-class}} object representing the ontologyof views. This graph should be a directed acyclic graph (DAG).} \item{defaultView}{A string giving the term to use for packages that do not list a term of their own via the \code{biocViews} field in the \file{DESCRIPTION} file.} \item{local}{logical indicating whether certain links should be absolute (using \code{reposURL}) or relative.} } \value{ A list with named elements: \code{views}: Vector of view memberships. Names are package names. \code{pkgList}: A list of \code{\link{PackageDetail-class}} objects. } \author{Seth Falcon} \keyword{utilities} biocViews/man/getSubTerms.Rd0000644000175200017520000000131414710217211017027 0ustar00biocbuildbiocbuild\name{getSubTerms} \alias{getSubTerms} \title{Retrieve a term and its children from a vocab DAG} \description{ Given a Directed Acyclic Graph (DAG) represented as a \code{graphNEL} instance, return a character vector consisting of the specified \code{term} and all of its descendants. That is, give the list of terms for which a path exists starting at \code{term}. } \usage{ getSubTerms(dag, term) } \arguments{ \item{dag}{A \code{graphNEL} representing a DAG} \item{term}{A string giving a term in the vocabulary (a node in \code{dag})} } \value{ A character vector of term names. } \author{S. Falcon} \examples{ data(biocViewsVocab) getSubTerms(biocViewsVocab, "Software") } \keyword{utilities} biocViews/man/guessPackageType.Rd0000644000175200017520000000203514710217211020030 0ustar00biocbuildbiocbuild\name{guessPackageType} \alias{guessPackageType} \title{ Guess Package Type (Software, ExperimentData, AnnotationData) using existing biocViews. } \description{ biocViews are "keywords" which are used to describe a given package. They are broadly divided into three categories, representing the type of packages present in the Bioconductor Project - Software, Annotation Data and Experiment Data. biocViews are supposed to come from only one of the three fields, but this function will check the list of biocViews and guess the package type based on how many biocViews came from each field. } \usage{ guessPackageType(biocViews) } \arguments{ \item{biocViews}{ A character vector containing a list of biocViews.} } \value{ A character(1) of package type: either "Software", "ExperperimentData", or "AnnotationData". } \author{ Lori Shepherd } \examples{ guessPackageType(c("clustering", "classification")) guessPackageType(c("Organism", "Homo Sapien")) } biocViews/man/htmlDoc.Rd0000644000175200017520000000111714710217211016156 0ustar00biocbuildbiocbuild\name{htmlDoc} \alias{htmlDoc} \title{Create a complete HTML document representation of an object} \description{ This generic function should return an \code{XMLNode} instance representing the specified object in HTML as a complete HTML document. } \usage{ htmlDoc(object, ...) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{object}{An object} \item{\dots}{Not currently used.} } \value{ An instance of \code{XMLNode} from the \code{XML} package. } \author{Seth Falcon} \seealso{\code{\link{htmlValue}}, \code{\link{htmlFilename}}} \keyword{methods} biocViews/man/htmlFilename.Rd0000644000175200017520000000114314710217211017170 0ustar00biocbuildbiocbuild\name{htmlFilename} \alias{htmlFilename} \alias{htmlFilename,character-method} \title{Return a filename for an object's HTML representation} \description{ This function returns a string containing an appropriate filename for storing the object's HTML representation. } \usage{ htmlFilename(object, ...) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{object}{An object.} \item{\dots}{Not currently used} } \value{ A character vector of length one containing the filename. } \author{Seth Falcon} \seealso{\code{\link{htmlValue}}, \code{\link{htmlDoc}} } \keyword{methods} biocViews/man/htmlValue.Rd0000644000175200017520000000076314710217211016533 0ustar00biocbuildbiocbuild\name{htmlValue} \alias{htmlValue} \title{HTML Representation of an Object} \description{ This generic function should return an \code{XMLNode} instance representing the specified object in HTML } \usage{ htmlValue(object) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{object}{An object} } \value{ An instance of \code{XMLNode} from the \code{XML} package. } \author{Seth Falcon} \seealso{\code{\link{htmlDoc}}, \code{\link{htmlFilename}}} \keyword{methods} biocViews/man/recommendBiocViews.Rd0000644000175200017520000000463614710217211020361 0ustar00biocbuildbiocbuild\name{recommendBiocViews} \alias{recommendBiocViews} \title{ Recommend biocViews for an existing Package. } \description{ Packages being added to the Bioconductor Project require biocViews in their DESCRIPTION file.(Note that the field name "biocViews" is case-sensitive and must begin with a lower-case 'b'.)biocViews are "keywords" which are used to describe a given package. They are broadly divided into three categories, representing the type of packages present in the Bioconductor Project - Software, Annotation Data and Experiment Data. } \usage{ recommendBiocViews(pkgdir, branch) } \arguments{ \item{pkgdir}{ The path of the package Directory. } \item{branch}{ The branch which your package will belong to. It can be either 'Software', 'AnnotationData' or 'ExperimentData'. } } \details{ This function parses the package directory provided by the user to recommend biocViews to the user. The output is a suggested list - the user of this function is expected to go through this list and find which biocViews best describe his or her package. It uses the following strategies. \itemize{ \item It parses the "Description", "Title", "Package" of the DESCRIPTION page to find biocViews. \item It looks up the biocViews of the packages in the "Depends" field of the given package to recommend biocViews \item It parses the text from the man pages and the vignettes to suggest biocViews. } Please note the following: \itemize{ \item Do not make up your own biocViews. \item Double check the spelling and case of the biocViews added. \item Please add biocViews only from the appropriate branch. eg: Software packages should have only Software biocViews. } } \value{ A list is returned with 3 characters - current , recommended and remove. \itemize{ \item "current" contains the biocViews from the package's DESCRIPTION file. \item "recommended" are the recommended biocViews - This is a suggested list which the user can add in addition to "current" biocViews - the user is expected to go through this list and find which biocViews best describe their package. \item "remove" are those biocViews which are inconsistent with the Bioconductor biocViews. (Hint - check for spelling, cases and plural) } } \author{ Sonali Arora. } biocViews/man/recommendPackages.Rd0000644000175200017520000000252614710217211020201 0ustar00biocbuildbiocbuild\name{recommendPackages} \alias{recommendPackages} \title{ Recommend Packages using existing biocViews. } \description{ biocViews are "keywords" which are used to describe a given package. They are broadly divided into three categories, representing the type of packages present in the Bioconductor Project - Software, Annotation Data and Experiment Data. One can find packages which are tagged with biocViews using this function. } \usage{ recommendPackages(biocViews, use.release=TRUE, intersect.views=TRUE) } \arguments{ \item{biocViews}{ A character vector containing a list of biocViews. Currently only biocViews from the software branch are supported. } \item{use.release}{ A logical character indicating if you want packages recommended from the release branch of Biocondutor. } \item{intersect.views}{ A logical character indicating if you want packages which are tagged with all the input biocViews or packages tagged with any one or more of the biocViews. } } \value{ A character vector containing a list of packages. If multiple biocViews are given as input, the result returns packages tagged with all or atleast one of the input biocViews. } \author{ Sonali Arora. } \examples{ recommendPackages(c("clustering", "classification")) } biocViews/man/validation_tests.Rd0000644000175200017520000000112014710217211020132 0ustar00biocbuildbiocbuild\name{validate_bioc_views} \alias{validate_bioc_views} \alias{validation_tests} \title{ Validate a package's biocViews. } \description{ Ensures that a package has biocViews and that they are valid. Function is designed to be called from the unit tests of another package. } \usage{ validate_bioc_views(pkg) } \arguments{ \item{pkg}{\code{character(1)} Name of package to validate.} } \value{ \code{invisible(NULL)} if tests pass. } \author{ Dan Tenenbaum \url{dtenenba@fhcrc.org} } \examples{ validate_bioc_views("biocViews") } \keyword{manip}% __ONLY ONE__ keyword per line biocViews/man/writeBiocViews.Rd0000644000175200017520000000130314710217211017526 0ustar00biocbuildbiocbuild\name{writeBiocViews} \alias{writeBiocViews} \title{Write a list of BiocView objects to HTML} \description{ This function serializes a list of \code{\link{BiocView-class}} objects to a series of HTML files. } \usage{ writeBiocViews(bvList, dir, backgroundColor="transparent") } \arguments{ \item{bvList}{A list of \code{BiocView-class} objects} \item{dir}{A character vector giving the directory where the HTML files will be written.} \item{backgroundColor}{A character vector giving the background color for the body in the CSS file.} } \author{Seth Falcon} \seealso{ \code{\link{getBiocViews}}, \code{\link{genReposControlFiles}}, \code{\link{write_VIEWS}} } \keyword{utilities} biocViews/man/writeHtmlDoc.Rd0000644000175200017520000000070414710217211017172 0ustar00biocbuildbiocbuild\name{writeHtmlDoc} \alias{writeHtmlDoc} \title{Write an XML DOM containing HTML to a file} \description{ Given a DOM tree from the XML package and a filename, write the DOM to disk creating an HTML file. } \usage{ writeHtmlDoc(html, file) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{html}{A DOM object from the XML package} \item{file}{A string giving the filename} } \author{S. Falcon} \keyword{ utilities } biocViews/man/writePackageDetailHtml.Rd0000644000175200017520000000137314710217211021146 0ustar00biocbuildbiocbuild\name{writePackageDetailHtml} \alias{writePackageDetailHtml} \title{Write HTML files for packages in a CRAN-style repository} \description{ This function creates package "homepages" that describe the package and provide links to download package artifacts in the repository. } \usage{ writePackageDetailHtml(pkgList, htmlDir = "html", backgroundColor="transparent") } %- maybe also 'usage' for other objects documented here. \arguments{ \item{pkgList}{A list of \code{PackageDescription} objects.} \item{htmlDir}{The files will be written to this directory.} \item{backgroundColor}{A character vector giving the background color for the body in the CSS file.} } \author{Seth Falcon} \seealso{\code{\link{writeRepositoryHtml}}} \keyword{utilities} biocViews/man/writeRFilesFromVignettes.Rd0000644000175200017520000000140114710217211021534 0ustar00biocbuildbiocbuild\name{writeRFilesFromVignettes} \alias{writeRFilesFromVignettes} \title{Write R files from vignettes} \description{ Ensures that .R files from vignette code chunks are written out. } \usage{ writeRFilesFromVignettes(reposRoot, reposUrl="..", viewUrl="../..", reposFullUrl=reposUrl, downloadStatsUrl="", devHistoryUrl="") } %- maybe also 'usage' for other objects documented here. \arguments{ \item{reposRoot}{Root directory of a CRAN-style repository} \item{reposUrl}{URL of repository} \item{viewUrl}{url of VIEWS file} \item{reposFullUrl}{Full URL of VIEWS file} \item{downloadStatsUrl}{URL to download stats page} \item{devHistoryUrl}{Dev history URL} } \keyword{utilities} biocViews/man/writeRepositoryHtml.Rd0000644000175200017520000000363214710217211020647 0ustar00biocbuildbiocbuild\name{writeRepositoryHtml} \alias{writeRepositoryHtml} \title{Write package descriptions and a repository index as HTML} \description{ This function generates an HTML file for each package in a repository and generates an \code{index.html} file that provides an alphabetized listing of the packages. } \usage{ writeRepositoryHtml(reposRoot, title, reposUrl = "..", viewUrl = "../..", reposFullUrl=reposUrl, downloadStatsUrl="", devHistoryUrl="", link.rel = TRUE, backgroundColor="transparent") } \arguments{ \item{reposRoot}{string specifying the path to the root of the CRAN-style package repository.} \item{title}{string giving the title for the repository} \item{reposUrl}{string giving the prefix for URL in links generated on the package description pages. The default is \code{"..."} which works well if the package description HTML files are written to an \code{html} subdirectory under the root of the repository.} \item{viewUrl}{string giving the prefix for the URL in links to the view pages. The biocViews terms will be linked to views summary pages with this prefix.} \item{reposFullUrl}{string giving the full prefix for URL in links generated on the package description pages. The default is \code{reposUrl}.} \item{downloadStatsUrl}{string giving the prefix for the URL in links to the download history statistics pages.} \item{devHistoryUrl}{string giving the prefix for the URL in links to the development changelog.} \item{link.rel}{logical indicating whether the index page should generate relative URL links. The default is \code{TRUE}. If you are generating HTML for a remote repository, you will want to set this to \code{FALSE}.} \item{backgroundColor}{A character vector giving the background color for the body in the CSS file.} } \author{Seth Falcon} \keyword{utilities} biocViews/man/writeTopLevelView.Rd0000644000175200017520000000133514710217211020226 0ustar00biocbuildbiocbuild\name{writeTopLevelView} \alias{writeTopLevelView} \title{Write the view for the root of a vocabulary to disk} \description{ Given a directory and a vocabulary represented as a \code{graphNEL} containing a DAG of terms, write the top-level term to disk as HTML. This assumes your vocabulary has a single term with no parents. } \usage{ writeTopLevelView(dir, vocab) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{dir}{A string giving a directory in which to write the HTML file} \item{vocab}{A \code{graphNEL} instance giving the DAG of terms. It should have a root node. That is, there should be exactly one node with no incoming edges.} } \author{S. Falcon} \keyword{utilities } biocViews/man/write_REPOSITORY.Rd0000644000175200017520000000237614710217211017525 0ustar00biocbuildbiocbuild\name{write_REPOSITORY} \alias{write_REPOSITORY} \title{Write a REPOSITORY control file for a CRAN-style package repository} \description{ This function writes a \code{REPOSITORY} file at the top-level of a CRAN-style repository. This file is DCF formatted and describes the location of packages available in the repository. Here is an example for a repository containing source packages, and Windows and Mac binary packages: \preformatted{ source: src/contrib win.binary: bin/windows/contrib/4.0 mac.binary: bin/macosx/contrib/4.0 provides: source, win.binary, mac.binary } } \usage{ write_REPOSITORY(reposRootPath, contribPaths) } \arguments{ \item{reposRootPath}{character vector containing the path to the CRAN-style repository root directory.} \item{contribPaths}{A named character vector. Valid names are \code{source}, \code{win.binary}, \code{mac.binary}, \code{mac.binary.mavericks}, and \code{mac.binary.el-capitan}. Values indicate the paths to the package archives relative to the \code{reposRoot}.} } \author{Seth Falcon} \seealso{ \code{\link[tools:writePACKAGES]{write_PACKAGES}}, \code{\link{extractVignettes}}, \code{\link{genReposControlFiles}}, \code{\link{write_VIEWS}} } \keyword{utilities} biocViews/man/write_SYMBOLS.Rd0000644000175200017520000000223714710217211017132 0ustar00biocbuildbiocbuild\name{write_SYMBOLS} \alias{write_SYMBOLS} \title{Write a SYMBOLS file} \description{ Writes a DCF formatted file, SYMBOLS, containing the symbols exported by each package in a directory containg R package source directories. } \usage{ write_SYMBOLS(dir, verbose = FALSE, source.dirs=FALSE) } \arguments{ \item{dir}{The root of a CRAN-style package repository containing source packages. When \code{source.dirs} is \code{TRUE}, \code{dir} should be a directory containing R package source directories} \item{verbose}{Logical. When \code{TRUE}, progress is printed to the standard output.} \item{source.dirs}{Logical. When \code{TRUE}, interpret \code{dir} as a directory containing source package directories. When \code{FALSE}, the default, \code{dir} is assumed to be the root of a CRAN-style package repository and the function will operate on the source package tarballs in \code{dir/src/contrib}.} } \value{ Returns \code{NULL}. Called for the side-effect of creating a SYMBOLS file in \code{dir}. } \author{S. Falcon} \seealso{ \code{\link[tools:writePACKAGES]{write_PACKAGES}} \code{\link{write_VIEWS}} } \keyword{utilities} biocViews/man/write_VIEWS.Rd0000644000175200017520000000464614710217211016705 0ustar00biocbuildbiocbuild\name{write_VIEWS} \alias{write_VIEWS} \title{Write a VIEWS control file for a CRAN-style package repository} \description{ This function writes a \code{VIEWS} file to the top-level of a CRAN-style package repository. The \code{VIEWS} file is in DCF format and describes all packages found in the repository. The \code{VIEWS} file contains the complete \code{DESCRIPTION} file for each source package in the repository. In addition, metadata for available binary packages and vignettes is centralized here. } \usage{ write_VIEWS(reposRootPath, fields = NULL, verbose = FALSE, vignette.dir = "vignettes", manifestFile = NA, meatPath = NA) } \arguments{ \item{reposRootPath}{character vector containing the path to the CRAN-style repository root directory.} \item{fields}{Any additional fields to include. You shouldn't need this, but if you have added fields to the DESCRIPTION files of the packages in the repository, you may want it.} \item{verbose}{logical, if \code{TRUE}, print progress messages.} \item{vignette.dir}{character specifying where to look for vignettes.} \item{manifestFile}{character(1). File path location to Bioconductor formatted manifest file that lists all current packages. This file will be used in the write_VIEWS function to cross check successfully built packages with all expected packages. Packages that have not built will be given dummy entry for complete listing in bioc_VIEWS. If NA cross check is skipped and packages not built on any system will be missing from biocVIEWS} \item{meatPath}{character(1). File path location to the directory containing cloned repositories of Bioconductor packages. If manifestFile is used for cross checking and the meatPath is provided, entries from the DESCRIPTION file are manually entered into biocVIEWS information. If NA dummy values for minimal fields for landing page generation are included with ERROR. This attempts to fill in as much information as possible for packages that have failed to build.} } \author{Seth Falcon} \section{Warning}{ This function uses a private function from the \code{tools} package: \code{tools:::.build_repository_package_db}. } \seealso{ \code{\link[tools:writePACKAGES]{write_PACKAGES}}, \code{\link{extractVignettes}}, \code{\link{genReposControlFiles}}, \code{\link{write_REPOSITORY}} } \keyword{utilities} biocViews/tests/0000755000175200017520000000000014710217211014664 5ustar00biocbuildbiocbuildbiocViews/tests/runTests.R0000644000175200017520000000004714710217211016637 0ustar00biocbuildbiocbuildBiocGenerics:::testPackage("biocViews")biocViews/updateVocab.sh0000755000175200017520000000210114710217211016310 0ustar00biocbuildbiocbuild#!/usr/bin/env bash if test -z "${R_HOME}"; then echo "usage:" echo " R CMD ./updateVocab.sh" exit 1 fi DOT2GXL=dot2gxl DOT=inst/dot/biocViewsVocab.dot GXL=inst/dot/biocViewsVocab.gxl RDA=data/biocViewsVocab.rda SQLITE=inst/extdata/biocViewsVocab.sqlite rm -f $RDA $SQLITE $DOT2GXL $DOT > $GXL echo "library('graph') con <- file('$GXL', open='r') biocViewsVocab <- fromGXL(con) save(biocViewsVocab, compress=TRUE, file='$RDA') close(con) edges <- t(sapply(strsplit(edgeNames(biocViewsVocab), '~'), c)) colnames(edges) <- c('edgeFrom', 'edgeTo') if(!require(RSQLite)) { warning('DBI and RSQLite are required to dump onthology to database') } else { m <- dbDriver('SQLite') con <- dbConnect(m, dbname='$SQLITE') res <- dbWriteTable(con, 'biocViews', as.data.frame(edges, stringsAsFactors=FALSE), row.names=FALSE, overwrite=TRUE) if(!res) warning('Failed writing data to database') res <- dbDisconnect(con) }" | "${R_HOME}/bin/R" --slave rm -f $GXL echo "DONE" biocViews/vignettes/0000755000175200017520000000000014710271425015541 5ustar00biocbuildbiocbuildbiocViews/vignettes/HOWTO-BCV.Rmd0000644000175200017520000001221214710217211017504 0ustar00biocbuildbiocbuild--- title: "HOWTO generate biocViews HTML" author: "S. Falcon and V.J. Carey" date: "`r format(Sys.time(), '%B %d, %Y')`" vignette: > %\VignetteIndexEntry{biocViews-HOWTO} %\VignetteEncoding{UTF-8} %\VignetteEngine{knitr::rmarkdown} output: BiocStyle::html_document: number_sections: true toc: yes toc_depth: 2 editor_options: markdown: wrap: 72 --- ```{r include=FALSE} library(biocViews) ``` # Overview The purpose of *biocViews* is create HTML pages that categorize packages in a Bioconductor package repository according to terms, or *views*, in a controlled vocabulary. The fundamental resource is the VIEWS file placed at the root of a repository. This file contains the complete DESCRIPTION file contents for each package along with additional meta data describing the location of package artifacts such as archive files for different platforms and vignettes. The standard behavior of the view generation program is to query the repository over the internet. This package includes a static sample VIEWS file so that the examples in this document can run without internet access. # Establishing a vocabulary of terms We use `dot` to describe the vocabulary. For details on the `dot` syntax, see . ```{r Establishing a vocabulary of terms, echo=TRUE, message=FALSE, warning=FALSE} vocabFile <- system.file("dot/biocViewsVocab.dot", package="biocViews") cat(readLines(vocabFile)[1:20], sep="\n") cat("...\n") ``` The dot description is transformed to a GXL document using `dot2gxl`, a tool included in the graphviz distribution. The GXL is then converted to a *graphNEL* instance using `fromGXL` from the *graph* package. There is a helper script in the root of the *biocViews* package called `updateVocab.sh` that automates the update process if the required tools are available. The script will also attempt to dump the ontology graph into a local SQLite database using tools from *DBI* and *RSQLite*. The information in this database can be used to create a dynamic HTML representation of the graph by means of a PHP script. The definition of the vocabulary lacks a notion of order. Since the purpose of the vocabulary is primarily for display, a valuable improvement would be to use graph attributes to allow the ordering of the terms. Another missing piece is a place to put a text description of each term. This could also be achieved using graph attributes. ## Use Case: adding a term to the vocabulary To add a new term to the vocabulary: 1. edit the *dot* file `dot/biocViewsVocab.dot` and add the desired term. Note that terms cannot contain spaces and that the underscore character, `_`, should be used instead. 2. ensure that R and dot2gxl are on your PATH. 3. cd into the biocViews working copy directory. 4. run the updateVocab.sh script. 5. reinstall the package and test that the new term is part of the vocabulary. In short, you will load the data using `data(biocViewsVocab)` and check that the term is a node of the graph instance. 6. commit changes to svn. ## Use Case: updating BioConductor website This is for BioConductor web administrator: 1. update local copy of biocViews using `svn update`. 2. find the correct instance R that is used to generate HTML pages on BioConductor website, and install the updated `biocViews`. 3. re-generate the related HTML packages by using `/home/biocadmin/bin/prepareRepos-*.sh` and `/home/biocadmin/bin/pushRepos-*.sh`. # Querying a repository To generate a list of *BiocViews* objects that can be used to generate HTML views, you will need the repository URL and a graph representation of the vocabulary. There are three main Bioconductor package repositories: a software repository containing analytic packages, an annotation data repository, and an experiment data repository. The vocabulary of terms has a single top-level node, all other nodes have at least one parent. The top-level node, *BiocViews*, has three children that correspond to the three main Bioconductor repositories: *Software*, *AnnotationData*, and *ExperimentData*. Views for each repository are created separately using `getBiocSubViews`. Below, we demonstrate how to build the *Software* set of views. ```{r Querying a repository, echo=TRUE, message=FALSE, warning=FALSE} data(biocViewsVocab) reposPath <- system.file("doc", package="biocViews") reposUrl <- paste("file://", reposPath, sep="") biocViews <- getBiocSubViews(reposUrl, biocViewsVocab, topTerm="Software") print(biocViews[1:2]) ``` To query the currently available vocabulary terms, use function `getSubTerms` on the *graphNEL* object `biocViewsVocab`. The second argument of this function takes a character of the base term for which all subterms should be returned. For a complete list use `term="BiocViews"`. ```{r getSubTerms, message=FALSE, warning=FALSE} getSubTerms(biocViewsVocab, term="Technology") ``` # Generating HTML By default, the set of HTML views will link to package description pages located in the html subdirectory of the remote repository. ```{r Generating HTML, echo=TRUE, message=FALSE, warning=FALSE} viewsDir <- file.path(tempdir(), "biocViews") dir.create(viewsDir) writeBiocViews(biocViews, dir=viewsDir) dir(viewsDir)[1:2] ``` biocViews/vignettes/createReposHtml.Rmd0000644000175200017520000001372514710217211021307 0ustar00biocbuildbiocbuild--- title: "HOWTO generate repository HTML" author: "S. Falcon" date: "`r format(Sys.time(), '%B %d, %Y')`" vignette: > %\VignetteEngine{knitr::rmarkdown} %\VignetteIndexEntry{biocViews-CreateRepositoryHTML} %\VignetteEncoding{UTF-8} output: BiocStyle::html_document: number_sections: yes toc: yes toc_depth: 4 --- # Overview This document assumes you have a collection of R packages on local disk that you would like to prepare for publishing to the web. The end result we are going for is: 1. Packages organized per CRAN-style repository standard. 2. PACKAGES files created for install.packages access. 3. VIEWS file created for generating biocViews. 4. A vignette directory created containing the extracted vignette pdf files from each source package in the repository. 5. An html directory created containing html descriptions of each package with links for downloading available artifacts. 6. A simple alphabetical listing index.html file. # CRAN-style Layout Establish a top-level directory for the repository, we will refer to this directory as reposRoot. Place your packages as follows: **src/contrib** Contains all source packages (*.tar.gz). **bin/windows/contrib/x.y** Contains all win.binary packages (*.zip). Where x.y is the major.minor version number of R. **bin/macosx/contrib/x.y** Contains the mac.binary (High Sierra) (*.tgz) packages. You will need the following parameters: ```{r eval=FALSE} reposRoot <- "path/to/reposRoot" ## The names are essential contribPaths <- c(source="src/contrib", win.binary="bin/windows/contrib/4.0", mac.binary="bin/macosx/contrib/4.0") ``` # Extracting vignettes The `extractVignettes` function extracts pdf files from inst/doc. The default is to extract to a reposRoot/vignettes. ```{r eval=FALSE} extractVignettes(reposRoot, contribPaths["source"]) ``` # Generating the control files The `genReposControlFiles` function will generate the PACKAGES files for each contrib path and also create a VIEWS file with complete info for later use by biocViews. ```{r eval=FALSE} genReposControlFiles(reposRoot, contribPaths) ``` # Generating the HTML The `writeRepositoryHtml` will generate HTML detail files for each package in reposRoot/html. The function will also create an index.html file at the top level. Two CSS files are included with *biocViews* that are automatically copied along side the appropriate HTML files during the HTML generation process. These CSS files are: ``` reposRoot/repository-detail.css reposRoot/html/package-detail.css ``` # Design and extension notes The basic idea is that using the VIEWS file and the known repository structure (location of packages and extracted vignettes), we represent the details for each package in the repository in a *PackageDetail-class* instance. *packageDetail-class* objects know how to write themselves to HTML using the `htmlValue` method. We used the *XML* package's `xmlOutputDOM` function to build up the HTML documents. Each HTML producing class extends *Htmlized-class* which contains a slot to hold the DOM tree and provides a place to put methods that are not specific to any given HTML outputting class. In terms of extending this to generate the biocViews, have a look at `setDependsOnMeImportsMeSuggeswhich` builds up an adjacency matrix representing package dependencies, importations, and suggestions. The matrix is square with rows and columns labeled with the names of the packages. The entries are 0/1 with a*ij* = 1 meaning that package *j* depends on package *i*. ## Details on HTML generation I started by breaking the `htmlValue` method for *PackageDetail-class* into one helper function for each logical section of the HTML we produce (author, description, details, downloads, and vignettes). That made the long method short enough to be readable. In order to be able to mix and match the different chunks and be able to more easily create new renderings, it seemed that it would be easiest to be able to render to HTML each chunk with a method. One possibility is a function `htmlChunk(object, "descriptions")` where the dispatch would be done using a switch statement or similar. A more flexible approach is to create dummy classes for each output "chunk". Each dummy class contains (subclasses) *PackageDescription* and that's it. We then can take advantage of the behavior of the as method to convert. ```{r eval=FALSE} ## Define classes like this for each logical document chunk setClass("pdAuthorMaintainerInfo", contains="PackageDetail") setClass("pdVignetteInfo", contains="PackageDetail") ## Then define a htmlValue method setMethod("htmlValue", signature(object="pdDescriptionInfo"), function(object) { node <- xmlNode("p", cleanText(object@Description), attrs=c(class="description")) node }) ## Then you can make use of all this... ## Assume object contains a PackageDetail instance authorInfo <- as(object, "pdAuthorMaintainerInfo") dom$addNode(htmlValue(authorInfo)) ``` One advantage of this setup is that we can now define a method to generate complete HTML documents that will work for all the dummy classes. Hence mix and match. ## A note on the htmlValue method for PackageDetail We could parameterize as follows. Not sure this makes things easier to follow, but it does demonstrate how you could start building up documents in a more programatic fashion. ```{r eval=FALSE} details <- list(heading=list(tag="h3", text="Details"), content="pdDetailsInfo") downloads <- list(heading=list(tag="h3", text="Download Package"), content="pdDownloadInfo") vignettes <- list(heading=list(tag="h3", text="Vignettes (Documentation)"), content="pdVignetteInfo") doSection <- function(sec) { dom$addTag(sec$heading$tag, sec$heading$text) secObj <- as(object, sec$content) dom$addNode(htmlValue(secObj)) } lapply(list(details, downloads, vignettes), doSection) ```