Skip to content

Commit

Permalink
Update for uniform first-letter capitalization
Browse files Browse the repository at this point in the history
  • Loading branch information
jwokaty committed Feb 7, 2024
1 parent e04d985 commit 0102b2a
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 26 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions R/bugsigdb.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions R/getSignatures.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions man/getMetaSignatures.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/importBugSigDB.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/test-getMetaSignatures.R
Original file line number Diff line number Diff line change
@@ -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")

Expand Down
1 change: 0 additions & 1 deletion tests/testthat/test-getSignatures.R
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand Down
24 changes: 12 additions & 12 deletions tests/testthat/test-ontology.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0102b2a

Please sign in to comment.