Skip to content

Commit 2468d83

Browse files
authored
Merge branch 'devel' into rm_news_funs
2 parents b48511e + c737240 commit 2468d83

17 files changed

+358
-23
lines changed

DESCRIPTION

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,27 @@ Description: Infrastructure to support 'views' used to classify
66
major classifications, corresponding to 'software', 'annotation',
77
and 'experiment data' packages.
88
biocViews: Infrastructure
9-
URL: http://bioconductor.org/packages/BiocViews
10-
BugReports: https://github.com/Bioconductor/BiocViews/issues
11-
Version: 1.67.2
9+
URL: http://bioconductor.org/packages/biocViews
10+
BugReports: https://github.com/Bioconductor/biocViews/issues
11+
Version: 1.79.0
1212
License: Artistic-2.0
13-
Author: VJ Carey <stvjc@channing.harvard.edu>,
14-
BJ Harshfield <rebjh@channing.harvard.edu>,
15-
S Falcon <sfalcon@fhcrc.org> ,
16-
Sonali Arora,
17-
Lori Shepherd <lori.shepherd@roswellpark.org>
18-
Maintainer: Bioconductor Package Maintainer <maintainer@bioconductor.org>
13+
Authors@R: c(
14+
person("Vincent", "Carey", role = "aut"),
15+
person("Benjamin", "Harshfield", role = "aut"),
16+
person("Seth", "Falcon", role = "aut"),
17+
person("Sonali", "Arora", role = "aut"),
18+
person("Lori", "Shepherd", role = "aut"),
19+
person("Bioconductor Package", "Maintainer", ,
20+
"maintainer@bioconductor.org", "cre"))
1921
Depends: R (>= 3.6.0)
2022
Imports: Biobase, graph (>= 1.9.26), methods, RBGL (>= 1.13.5), tools,
2123
utils, XML, RCurl, RUnit, BiocManager
22-
Suggests: BiocGenerics, knitr, commonmark, BiocStyle
24+
Suggests: BiocGenerics, BiocPkgTools, knitr, commonmark, BiocStyle
2325
Collate: AllClasses.R AllGenerics.R as-methods.R htmlDoc-methods.R
2426
htmlFilename-methods.R htmlValue-methods.R show-methods.R
2527
getPackNames.R packageDetails.R pump.R repository.R showvoc.R
2628
getPackageNEWS.R validation_tests.R recommendBiocViews.R
29+
dump_concept.R build_dbs.R
2730
VignetteBuilder: knitr
31+
RoxygenNote: 7.3.2
32+
Encoding: UTF-8

NAMESPACE

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ exportMethods("coerce", "show", "htmlDoc", "htmlValue", "htmlFilename")
3939

4040
export("writeBiocViews", "getBiocViews", "write_VIEWS", "write_REPOSITORY",
4141
"genReposControlFiles", "extractVignettes", "extractManuals",
42+
## build db functions
43+
"build_db_from_source", "build_meta_aliases_db", "build_meta_rdxrefs_db",
44+
##
4245
"extractCitations", "getCurrentbiocViews",
4346
"extractNEWS", "extractHTMLDocuments", "extractTopLevelFiles",
4447
"writeRepositoryHtml", "writePackageDetailHtml", "getSubTerms",
4548
"getBiocSubViews", "validate_bioc_views", "writeTopLevelView",
4649
"writeHtmlDoc", "write_SYMBOLS", "writeRFilesFromVignettes",
4750
"getPackageNEWS", "printNEWS","recommendBiocViews",
48-
"recommendPackages", "guessPackageType")
51+
"recommendPackages", "guessPackageType", "dump_concept")

NEWS

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
1-
CHANGES IN VERSION 1.68.0
1+
2+
CHANGES IN VERSION 1.78.0
23
-------------------------
34

45
NEW FEATURES
56

67
o getPackageNEWS and printNEWS are deprecated from biocViews.
78
See help('biocViews-deprecated') for more details.
89

10+
CHANGES IN VERSION 1.77.2
11+
-------------------------
12+
13+
ENHANCEMENT
14+
15+
o (1.77.2) Add build_db_from_source, build_meta_aliases_db, build_meta_rdxrefs_db
16+
o (1.77.3) Add biocViews term GPU
17+
918
CHANGES IN VERSION 1.67.0
1019
-------------------------
1120

1221
ENHANCEMENT
1322

1423
o (1.67.1) Add biocViews term WorkflowManagement
15-
24+
o (1.67.3) Add biocViews term LongRead
1625

1726
CHANGES IN VERSION 1.65.0
1827
-------------------------

R/build_dbs.R

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
#' @name build-dbs
2+
#'
3+
#' @title Helper functions to generate HTML pages for reference manuals
4+
#'
5+
#' @param package_dir `character(1)` The local path to a package for which to
6+
#' build the aliases and cross-ref databases (`rds` files).
7+
#'
8+
#' @param reposRoot `character(1)` The path to the base hosting directory for
9+
#' the package repository. This is typically a location on the BBS server.
10+
#'
11+
#' @details
12+
#' These functions are used to generate the `aliases.rds` and `rdxrefs.rds`
13+
#' files for each package. These files are used to generate a metadata database
14+
#' `Rds` file via the `build_meta_aliases_db` and `build_meta_rdxrefs_db`
15+
#' functions for all packages. The `aliases.rds` file is a list of aliases
16+
#' within each `.Rd` page in the package. The `rdxrefs.rds` file is a matrix of
17+
#' cross-references between an external topic and the originating `.Rd` page.
18+
#' The individual package databases are then combined into a single database
19+
#' file for the entire repository. Each package's database is stored in the
20+
#' `web/packages` directory in `reposRoot`. The collective metadata database
21+
#' files are stored in the `src/contrib/Meta` directory in `reposRoot`.
22+
#'
23+
#' The alias and cross-reference files are generated from the package source
24+
#' directory but may also be generated from a built package tarball
25+
#' (functionality not included). The code is meant to run on the BBS, typically
26+
#' after a package has been built or updated.
27+
#'
28+
#' @examples
29+
#' if (interactive()) {
30+
#' library(BiocPkgTools)
31+
#' bioc_sub <- pkgBiocDeps(
32+
#' "SummarizedExperiment", pkgType = "software",
33+
#' recursive = TRUE, only.bioc = TRUE
34+
#' )
35+
#' bioc_sub <- unlist(bioc_sub, use.names = FALSE)
36+
#'
37+
#' ## generate from Bioc package source dirs
38+
#' packages <- file.path(normalizePath("~/bioc"), bioc_sub)
39+
#' reposRoot <- "~/minibioc/packages/3.20/bioc"
40+
#'
41+
#' for (package in packages) {
42+
#' build_db_from_source(package, reposRoot)
43+
#' }
44+
#' }
45+
#' @export
46+
build_db_from_source <- function(package_dir, reposRoot) {
47+
tmp_dir <- tempdir()
48+
package <- basename(package_dir)
49+
package_web_dir <- file.path(reposRoot, "web", "packages", package)
50+
if (!dir.exists(package_web_dir))
51+
dir.create(package_web_dir, recursive = TRUE)
52+
db <- tools::Rd_db(dir = package_dir)
53+
54+
## aliases.rds
55+
aliases <- lapply(db, tools:::.Rd_get_metadata, "alias")
56+
afile <- file.path(tmp_dir, "aliases.rds")
57+
saveRDS(aliases, file = afile, version = 2)
58+
atofile <- file.path(package_web_dir, "aliases.rds")
59+
file.copy(
60+
from = afile,
61+
to = atofile
62+
)
63+
message(atofile)
64+
65+
## rdxrefs.rds
66+
rdxrefs <- lapply(db, tools:::.Rd_get_xrefs)
67+
rdxrefs <- cbind(do.call(rbind, rdxrefs),
68+
Source = rep.int(names(rdxrefs), sapply(rdxrefs, NROW)))
69+
xfile <- file.path(tmp_dir, "rdxrefs.rds")
70+
saveRDS(rdxrefs, file = xfile, version = 2)
71+
xtofile <- file.path(package_web_dir, "rdxrefs.rds")
72+
file.copy(
73+
from = xfile,
74+
to = xtofile
75+
)
76+
message(xtofile)
77+
}
78+
79+
#' @rdname build-dbs
80+
#'
81+
#' @param web_dir `character(1)` The `web/packages` local directory that is
82+
#' also hosted on the website e.g., for CRAN
83+
#' \url{https://cran.r-project.org/web/packages/}
84+
#'
85+
#' @param aliases_db_file `character(1)` The file path to `aliases.rds` file
86+
#' generated by the `build_db_from_source` function.
87+
#'
88+
#' @param force `logical(1)` If `FALSE`, the function will only update the
89+
#' database entries for which the aliases/rdxrefs file is more recent than the
90+
#' database file. If `TRUE`, the function will read all aliases/rdxrefs files.
91+
#'
92+
#' @examples
93+
#' if (interactive()) {
94+
#' reposRoot <- "~/minibioc/packages/3.20/bioc/"
95+
#' web_dir <- file.path(reposRoot, "web", "packages")
96+
#'
97+
#' meta_folder <- file.path(contrib.url(reposRoot), "Meta")
98+
#' if (!dir.exists(meta_folder)) dir.create(meta_folder, recursive = TRUE)
99+
#' aliases_db_file <- file.path(meta_folder, "aliases.rds")
100+
#'
101+
#' meta_aliases_db <- build_meta_aliases_db(web_dir, aliases_db_file)
102+
#'
103+
#' saveRDS(meta_aliases_db, aliases_db_file, version = 2)
104+
#' }
105+
#' @export
106+
build_meta_aliases_db <-
107+
function(web_dir, aliases_db_file, force = FALSE)
108+
{
109+
files <- Sys.glob(file.path(web_dir, "*", "aliases.rds"))
110+
packages <- basename(dirname(files))
111+
if (force || !is_file(aliases_db_file)) {
112+
db <- lapply(files, readRDS)
113+
names(db) <- packages
114+
} else {
115+
db <- readRDS(aliases_db_file)
116+
## Drop entries in db not in package web area.
117+
db <- db[!is.na(match(names(db), packages))]
118+
## Update entries for which aliases file is more recent than the
119+
## db file.
120+
mtimes <- file.mtime(files)
121+
files <- files[mtimes >= file.mtime(aliases_db_file)]
122+
db[basename(dirname(files))] <- lapply(files, readRDS)
123+
}
124+
125+
db[sort(names(db))]
126+
}
127+
128+
is_file <- function(x) file.exists(x) && !file.info(x)[["isdir"]]
129+
130+
#' @rdname build-dbs
131+
#'
132+
#' @param rdxrefs_db_file `character(1)` The file path to `rdxrefs.rds` file
133+
#' generated by the `build_db_from_source` function.
134+
#'
135+
#' @examples
136+
#' if (interactive()) {
137+
#' reposRoot <- "~/minibioc/packages/3.20/bioc/"
138+
#' web_dir <- file.path(reposRoot, "web", "packages")
139+
#'
140+
#' meta_folder <- file.path(contrib.url(reposRoot), "Meta")
141+
#' if (!dir.exists(meta_folder)) dir.create(meta_folder, recursive = TRUE)
142+
#' rdxrefs_db_file <- file.path(meta_folder, "rdxrefs.rds")
143+
#'
144+
#' meta_rdxrefs_db <- build_meta_rdxrefs_db(web_dir, rdxrefs_db_file)
145+
#'
146+
#' saveRDS(meta_rdxrefs_db, rdxrefs_db_file, version = 2)
147+
#' }
148+
#' @export
149+
build_meta_rdxrefs_db <-
150+
function(web_dir, rdxrefs_db_file, force = FALSE)
151+
{
152+
files <- Sys.glob(file.path(web_dir, "*", "rdxrefs.rds"))
153+
packages <- basename(dirname(files))
154+
if(force || !is_file(rdxrefs_db_file)) {
155+
db <- lapply(files, readRDS)
156+
names(db) <- packages
157+
} else {
158+
db <- readRDS(rdxrefs_db_file)
159+
## Drop entries in db not in package web area.
160+
db <- db[!is.na(match(names(db), packages))]
161+
## Update entries for which rdxrefs file is more recent than the
162+
## db file.
163+
mtimes <- file.mtime(files)
164+
files <- files[mtimes >= file.mtime(rdxrefs_db_file)]
165+
db[basename(dirname(files))] <- lapply(files, readRDS)
166+
}
167+
168+
db[sort(names(db))]
169+
}

R/dump_concept.R

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#' produce character stream for use with Protege entities/class hierarchy ingestion
2+
#' based on biocViews subgraphs
3+
#' @param x character(1) name of a node in the biocViewsVocab graph
4+
#' @param edob a list as produced by graph::edges
5+
#' @return a character atom with x abutting left and edge targets tab-indented
6+
#' @examples
7+
#' cat(substring(dump_concept("ResearchField"), 1, 152), "\n")
8+
#' @export
9+
dump_concept <- function (x, edob = NULL)
10+
{
11+
if (is.null(edob)) {
12+
dataenv <- new.env(parent = emptyenv())
13+
data("biocViewsVocab", package = "biocViews", envir = dataenv)
14+
biocViewsVocab <- dataenv[["biocViewsVocab"]]
15+
edob <- edges(biocViewsVocab)
16+
}
17+
paste(x, "\n\t", paste(edob[[x]], collapse = "\n\t"), collapse = "\n\t",
18+
"\n", sep = "")
19+
}

R/getPackageNEWS.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ printNEWS <- function(dbs, destfile, overwrite=FALSE, width=68,
132132
# manifest: software.txt data-experiment.txt workflows.txt
133133
# status: new or removed
134134
getPackageTitles <- function(prevBranch="RELEASE_3_6",
135-
currBranch="master",
136-
manifest=c("software.txt", "data-experiment.txt", "workflows.txt"),
135+
currBranch="devel",
136+
manifest=c("software.txt", "data-experiment.txt",
137+
"workflows.txt", "data-annotation.txt", "books.txt"),
137138
status = c("new", "removed")){
138139

139140
manifest <- match.arg(manifest)
@@ -183,7 +184,7 @@ getPackageDescriptions <- function(pkgs, outfile, output=c("md", "text"),relativ
183184

184185
file <- tempfile()
185186
DESC_FILE <-
186-
"git archive --remote=ssh://git@git.bioconductor.org/packages/%s master DESCRIPTION|tar -xO > %s"
187+
"git archive --remote=ssh://git@git.bioconductor.org/packages/%s devel DESCRIPTION|tar -xO > %s"
187188

188189
urlBase <- ifelse(relativeLink, "/packages/","https://bioconductor.org/packages/")
189190
desc = lapply(pkgs, function(pkg) {

R/repository.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,7 @@ write_VIEWS <- function(reposRootPath, fields = NULL,
739739
'source'=".tar.gz",
740740
'win.binary'=".zip",
741741
'mac.binary'=,
742+
'mac.binary.big-sur-x86_64'=,
742743
'mac.binary.big-sur-arm64'=,
743744
'mac.binary.mavericks'=,
744745
'mac.binary.el-capitan'=".tgz",
@@ -916,7 +917,7 @@ getReverseDepends <- function(db, fieldName) {
916917
names(pkgNames) <- NULL
917918
df <- as.data.frame(db, stringsAsFactors=FALSE)
918919
depCols <- lapply(pkgNames, function(x) {
919-
pkgRecord <- subset(df, Package==x)
920+
pkgRecord <- subset(df, df$Package==x)
920921
pkgNames %in% getDcfValues(pkgRecord[fieldName])
921922
})
922923
depMat <- do.call(cbind, depCols)

data/biocViewsVocab.rda

53 Bytes
Binary file not shown.

inst/dot/biocViewsVocab.dot

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Sequencing -> MicrobialStrain;
5252
Sequencing -> HiC;
5353
Sequencing -> PooledScreens;
5454
Sequencing -> MNaseSeq;
55+
Sequencing -> LongRead;
5556
Technology -> Microarray;
5657
Microarray -> MultiChannel;
5758
Microarray -> OneChannel;
@@ -101,6 +102,8 @@ ResearchField -> SystemsBiology;
101102
ResearchField -> ComputationalChemistry;
102103
ResearchField -> Agroinformatics;
103104
ResearchField -> Transcriptomics;
105+
ResearchField -> Immunology;
106+
ResearchField -> Immunogenetics;
104107
ResearchField -> ImmunoOncology;
105108
ResearchField -> Epitranscriptomics;
106109

@@ -201,6 +204,7 @@ Infrastructure -> ThirdPartyClient
201204
Infrastructure -> DataImport;
202205
Infrastructure -> DataRepresentation;
203206
Infrastructure -> GUI;
207+
Infrastructure -> GPU;
204208

205209
/* Software -> ShinyApps */
206210
Software -> ShinyApps;
@@ -252,6 +256,7 @@ Organism -> Pseudomonas_aeruginosa;
252256
Organism -> Rattus_norvegicus;
253257
Organism -> Saccharomyces_cerevisiae;
254258
Organism -> Saccharum_officinarum;
259+
Organism -> Salmo_salar;
255260
Organism -> Schizosaccharomyces_pombe;
256261
Organism -> Staphylococcus_aureus;
257262
Organism -> Sus_scrofa;

inst/extdata/biocViewsVocab.sqlite

4 KB
Binary file not shown.

0 commit comments

Comments
 (0)