From 0102b2a4695975649f157269447e8aa28dbbdbb7 Mon Sep 17 00:00:00 2001 From: J Wokaty Date: Tue, 6 Feb 2024 19:44:45 -0500 Subject: [PATCH] Update for uniform first-letter capitalization --- DESCRIPTION | 4 ++-- NEWS.md | 4 ++++ R/bugsigdb.R | 6 +++--- R/getSignatures.R | 4 ++-- man/getMetaSignatures.Rd | 4 ++-- man/importBugSigDB.Rd | 6 +++--- tests/testthat/test-getMetaSignatures.R | 2 +- tests/testthat/test-getSignatures.R | 1 - tests/testthat/test-ontology.R | 24 ++++++++++++------------ 9 files changed, 29 insertions(+), 26 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 7857a11..b2a3515 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: bugsigdbr -Version: 1.8.1 +Version: 1.8.2 Title: R-side access to published microbial signatures from BugSigDB Authors@R: c( person(given = "Ludwig", @@ -37,4 +37,4 @@ License: GPL-3 VignetteBuilder: knitr biocViews: DataImport, GeneSetEnrichment, Metagenomics, Microbiome Encoding: UTF-8 -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 diff --git a/NEWS.md b/NEWS.md index 506bad0..93513bb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # bugsigdbr +## Changes in version 1.9.1 + +* Uniform first-letter capitalization for Body site and Condition terms + ## Changes in version 1.2.0 * `importBugSigDB` accepts Zenodo DOIs and Github hashes to obtain diff --git a/R/bugsigdb.R b/R/bugsigdb.R index e2e03c9..1794ce0 100644 --- a/R/bugsigdb.R +++ b/R/bugsigdb.R @@ -37,20 +37,20 @@ #' @return a \code{\link{data.frame}}. #' @references BugSigDB: \url{https://bugsigdb.org} #' -#' Stable release: \url{https://doi.org/10.5281/zenodo.5606165} +#' Stable release: \url{https://doi.org/10.5281/zenodo.10627578} #' #' Latest version (incl. not reviewed content): #' \url{https://github.com/waldronlab/BugSigDBExports} #' #' BugSigDBExports commits page: -#' \url{https://github.com/waldronlab/BugSigDBExports/commits/main} +#' \url{https://github.com/waldronlab/BugSigDBExports/commits/devel} #' @examples #' #' df <- importBugSigDB() #' #' @importFrom utils read.csv #' @export -importBugSigDB <- function(version = "10.5281/zenodo.6468009", cache = TRUE) +importBugSigDB <- function(version = "10.5281/zenodo.10627578", cache = TRUE) { version <- tolower(version) diff --git a/R/getSignatures.R b/R/getSignatures.R index 9ff6ddb..c72239c 100644 --- a/R/getSignatures.R +++ b/R/getSignatures.R @@ -97,13 +97,13 @@ getSignatures <- function(df, #' #' # Condition-specific meta-signatures from fecal samples, increased #' # in conditions of study. Use taxonomic names instead of the default NCBI IDs: -#' df.feces <- df[df$`Body site` == "feces", ] +#' df.feces <- df[df$`Body site` == "Feces", ] #' cond.meta.sigs <- getMetaSignatures(df.feces, column = "Condition", #' direction = "UP", tax.id.type = "taxname") #' #' # Inspect the results #' names(cond.meta.sigs) -#' cond.meta.sigs["bipolar disorder"] +#' cond.meta.sigs["Bipolar disorder"] #' @export getMetaSignatures <- function(df, column, diff --git a/man/getMetaSignatures.Rd b/man/getMetaSignatures.Rd index b2b08c5..798b3ff 100644 --- a/man/getMetaSignatures.Rd +++ b/man/getMetaSignatures.Rd @@ -59,13 +59,13 @@ interest # Condition-specific meta-signatures from fecal samples, increased # in conditions of study. Use taxonomic names instead of the default NCBI IDs: - df.feces <- df[df$`Body site` == "feces", ] + df.feces <- df[df$`Body site` == "Feces", ] cond.meta.sigs <- getMetaSignatures(df.feces, column = "Condition", direction = "UP", tax.id.type = "taxname") # Inspect the results names(cond.meta.sigs) - cond.meta.sigs["bipolar disorder"] + cond.meta.sigs["Bipolar disorder"] } \seealso{ getSignatures diff --git a/man/importBugSigDB.Rd b/man/importBugSigDB.Rd index 3517c39..5a7d8d1 100644 --- a/man/importBugSigDB.Rd +++ b/man/importBugSigDB.Rd @@ -4,7 +4,7 @@ \alias{importBugSigDB} \title{Obtain published microbial signatures from bugsigdb.org} \usage{ -importBugSigDB(version = "10.5281/zenodo.6468009", cache = TRUE) +importBugSigDB(version = "10.5281/zenodo.10627578", cache = TRUE) } \arguments{ \item{version}{character. A Zenodo DOI, git commit hash, or "devel". @@ -57,11 +57,11 @@ SHA code of the export version you want to use. \references{ BugSigDB: \url{https://bugsigdb.org} -Stable release: \url{https://doi.org/10.5281/zenodo.5606165} +Stable release: \url{https://doi.org/10.5281/zenodo.10627578} Latest version (incl. not reviewed content): \url{https://github.com/waldronlab/BugSigDBExports} BugSigDBExports commits page: - \url{https://github.com/waldronlab/BugSigDBExports/commits/main} + \url{https://github.com/waldronlab/BugSigDBExports/commits/devel} } diff --git a/tests/testthat/test-getMetaSignatures.R b/tests/testthat/test-getMetaSignatures.R index fa69d43..f6973d2 100644 --- a/tests/testthat/test-getMetaSignatures.R +++ b/tests/testthat/test-getMetaSignatures.R @@ -1,5 +1,5 @@ bsdb <- importBugSigDB() -df.feces <- subset(bsdb, `Body site` == "feces") +df.feces <- subset(bsdb, `Body site` == "Feces") bs.msigs <- getMetaSignatures(bsdb, "Body site") co.msigs <- getMetaSignatures(df.feces, "Condition") diff --git a/tests/testthat/test-getSignatures.R b/tests/testthat/test-getSignatures.R index 3df7c20..61e1885 100644 --- a/tests/testthat/test-getSignatures.R +++ b/tests/testthat/test-getSignatures.R @@ -2,7 +2,6 @@ bsdb <- importBugSigDB() checkSigs <- function(sigs, tax.id.type) { - sigs <- getSignatures(bsdb) expect_true(is.list(sigs)) expect_true(is.character(sigs[[1]])) expect_true(grepl("^bsdb", names(sigs)[1])) diff --git a/tests/testthat/test-ontology.R b/tests/testthat/test-ontology.R index 0c23d88..3ccc2c2 100644 --- a/tests/testthat/test-ontology.R +++ b/tests/testthat/test-ontology.R @@ -36,21 +36,21 @@ test_that("getOntology", { test_that("subsetByOntology", { bterms <- c("excreta", "digestive system", "reproductive system") - bpos <- list( c("feces", "meconium", "urine"), - c("stomach", "colon", "mouth"), - c("vagina", "uterus", "uterine cervix")) - bneg <- list( c("stomach", "colon", "mouth"), - c("feces", "meconium", "urine"), - c("feces", "meconium", "urine")) + bpos <- list( c("Feces", "Meconium", "Urine"), + c("Stomach", "Colon", "Mouth"), + c("Vagina", "Uterus", "Uterine cervix")) + bneg <- list( c("Stomach", "Colon", "Mouth"), + c("Feces", "Meconium", "Urine"), + c("Feces", "Meconium", "Urine")) names(bpos) <- names(bneg) <- bterms cterms <- c("cancer", "nervous system disease", "metabolic disease") - cpos <- list( c("gastric cancer", "cervical cancer", "breast cancer"), - c("autism", "unipolar depression", "schizophrenia"), - c("obesity", "type II diabetes mellitus", "gestational diabetes")) - cneg <- list( c("obesity", "anorexia nervosa", "gestational diabetes"), - c("gastric cancer", "cervical cancer", "breast cancer"), - c("gastric cancer", "cervical cancer", "breast cancer")) + cpos <- list( c("Gastric cancer", "Cervical cancer", "Breast cancer"), + c("Autism", "Unipolar depression", "Schizophrenia"), + c("Obesity", "Type II diabetes mellitus", "Gestational diabetes")) + cneg <- list( c("Obesity", "Anorexia nervosa", "Gestational diabetes"), + c("Gastric cancer", "Cervical cancer", "Breast cancer"), + c("Gastric cancer", "Cervical cancer", "Breast cancer")) names(cpos) <- names(cneg) <- cterms for(b in bterms)