diff --git a/DESCRIPTION b/DESCRIPTION index 8864353..9ff1fc7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: regutools Title: regutools: an R package for data extraction from RegulonDB Version: 1.23.0 -Date: 2021-11-15 +Date: 2026-04-01 Authors@R: c( person ("Joselyn", "Chavez", email = "joselynchavezf@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-4974-4591")), @@ -35,7 +35,7 @@ Description: RegulonDB has collected, harmonized and centralized data to further our understanding of gene regulatory networks. License: Artistic-2.0 Encoding: UTF-8 -Depends: R (>= 4.0) +Depends: R (>= 4.5.0) Imports: AnnotationDbi, AnnotationHub, @@ -51,8 +51,8 @@ Imports: stats, utils, BiocFileCache -LazyData: true -RoxygenNote: 7.1.1 +LazyData: false +RoxygenNote: 7.3.3 Suggests: BiocStyle, knitr, diff --git a/NEWS.md b/NEWS.md index d916305..82f0f99 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# regutools 1.23.0 + +BUG FIXES + +* Fixed URL for the database + # regutools 1.3.2 SIGNIFICANT USER-VISIBLE CHANGES diff --git a/R/build_condition.R b/R/build_condition.R index ca209f0..3b3a3dd 100644 --- a/R/build_condition.R +++ b/R/build_condition.R @@ -47,12 +47,14 @@ #' @export build_condition <- - function(regulondb, - dataset, - filters, - operator, - interval, - partialmatch) { + function( + regulondb, + dataset, + filters, + operator, + interval, + partialmatch + ) { if (is(filters, "list")) { if (!all(names(filters) %in% list_attributes(regulondb, dataset))) { non.existing.attrs.index <- diff --git a/R/connect_database.R b/R/connect_database.R index e1e9a03..7fc7cf7 100644 --- a/R/connect_database.R +++ b/R/connect_database.R @@ -26,8 +26,9 @@ #' regulondb_conn_noAH <- connect_database(ah = NULL) connect_database <- function( - ah = AnnotationHub::AnnotationHub(), - bfc = BiocFileCache::BiocFileCache()) { + ah = AnnotationHub::AnnotationHub(), + bfc = BiocFileCache::BiocFileCache() + ) { if (!is.null(ah)) { ## Check input stopifnot(methods::is(ah, "AnnotationHub")) @@ -50,13 +51,8 @@ connect_database <- } } - ## Otherwise, use the Dropbox version and cache it with BiocFileCache - url <- - paste0( - "https://www.dropbox.com/s/ufp6wqcv5211v1w/", - "regulondb_v10.8_sqlite.db?dl=1" - ) + url <- "https://github.com/ComunidadBioInfo/regutoolsData/raw/refs/heads/main/regulondb_v10.8_sqlite.db" destfile <- BiocFileCache::bfcrpath(bfc, url) AnnotationDbi::dbFileConnect(destfile) } diff --git a/R/get_binding_sites.R b/R/get_binding_sites.R index fd94cbf..6160485 100644 --- a/R/get_binding_sites.R +++ b/R/get_binding_sites.R @@ -25,8 +25,10 @@ #' ## Get the binding sites for AraC #' get_binding_sites(e_coli_regulondb, transcription_factor = "AraC") #' @export -get_binding_sites <- function(regulondb, transcription_factor, - output_format = "GRanges") { +get_binding_sites <- function( + regulondb, transcription_factor, + output_format = "GRanges" +) { ## For a BiocCheck NOTE left <- right <- NULL if (!output_format %in% c("GRanges", "Biostrings")) { @@ -49,7 +51,7 @@ get_binding_sites <- function(regulondb, transcription_factor, ) tfbs_table <- strsplit( as.character(tfbs_table$res), - split = "\t" + split = "\t" ) tfbs_table <- as.data.frame(do.call(rbind, tfbs_table)) colnames(tfbs_table) <- diff --git a/R/get_dataset.R b/R/get_dataset.R index 91e8b97..0795e05 100644 --- a/R/get_dataset.R +++ b/R/get_dataset.R @@ -63,14 +63,16 @@ #' @importFrom S4Vectors DataFrame #' @importFrom Biostrings DNAStringSet BStringSet get_dataset <- - function(regulondb, - dataset = NULL, - attributes = NULL, - filters = NULL, - and = TRUE, - interval = NULL, - partialmatch = NULL, - output_format = "regulondb_result") { + function( + regulondb, + dataset = NULL, + attributes = NULL, + filters = NULL, + and = TRUE, + interval = NULL, + partialmatch = NULL, + output_format = "regulondb_result" + ) { # Check if format specification is valid if (!output_format %in% c( "regulondb_result", @@ -244,8 +246,8 @@ get_dataset <- #' convert_to_granges(get_dataset(e_coli_regulondb, dataset = "GENE")) convert_to_granges <- function(regulondb_result) { if (!is(regulondb_result, "regulondb_result")) { - stop("The input is not a 'regulondb_result' object.") - } + stop("The input is not a 'regulondb_result' object.") + } dataset <- regulondb_result@dataset if (dataset %in% c("GENE", "DNA_OBJECTS")) { posLeft <- "posleft" @@ -292,11 +294,11 @@ convert_to_granges <- function(regulondb_result) { DataFrame(regulondb_result[keep, !colnames(regulondb_result) %in% c(posLeft, posRight, "strand"), drop = FALSE]) if (sum(!keep) > 0) { - warning(sprintf( - "Dropped %s entries where genomic coordinates were NAs", - sum(!keep) - )) - } + warning(sprintf( + "Dropped %s entries where genomic coordinates were NAs", + sum(!keep) + )) + } grdata } else { stop( @@ -349,11 +351,11 @@ convert_to_granges <- function(regulondb_result) { convert_to_biostrings <- function(regulondb_result, seq_type = "DNA") { if (!is(regulondb_result, "regulondb_result")) { - stop("The input is not a 'regulondb_result' object.") - } + stop("The input is not a 'regulondb_result' object.") + } if (!seq_type %in% c("DNA", "product")) { - stop("'seq_type' must be either 'DNA' or 'product'") - } + stop("'seq_type' must be either 'DNA' or 'product'") + } dataset <- regulondb_result@dataset if (dataset == "GENE") { if (seq_type == "DNA") { diff --git a/R/get_dna_objects.R b/R/get_dna_objects.R index c09f61e..21e2186 100644 --- a/R/get_dna_objects.R +++ b/R/get_dna_objects.R @@ -16,8 +16,8 @@ #' @examples #' ## Connect to the RegulonDB database if necessary #' if (!exists("regulondb_conn")) { -#' regulondb_conn <- connect_database() -#' } +#' regulondb_conn <- connect_database() +#' } #' #' ## Build the regulondb object #' e_coli_regulondb <- @@ -45,10 +45,12 @@ #' ) #' @export get_dna_objects <- - function(regulondb, - genome = "eschColi_K12", - grange = GRanges("chr", IRanges(1, 5000)), - elements = "gene") { + function( + regulondb, + genome = "eschColi_K12", + grange = GRanges("chr", IRanges(1, 5000)), + elements = "gene" + ) { valid_elements <- c( "-10 promoter box", "-35 promoter box", diff --git a/R/get_gene_regulators.R b/R/get_gene_regulators.R index 95a8787..808b5fb 100644 --- a/R/get_gene_regulators.R +++ b/R/get_gene_regulators.R @@ -42,10 +42,12 @@ #' @export get_gene_regulators <- - function(regulondb, - genes, - format = "multirow", - output.type = "TF") { + function( + regulondb, + genes, + format = "multirow", + output.type = "TF" + ) { stopifnot(validObject(regulondb)) # Check genes parameter class ## if (!class(genes) %in% c("vector", "list", "character")) { diff --git a/R/get_gene_synonyms.R b/R/get_gene_synonyms.R index c871ec4..1554be4 100644 --- a/R/get_gene_synonyms.R +++ b/R/get_gene_synonyms.R @@ -32,10 +32,12 @@ #' @export get_gene_synonyms <- - function(regulondb, - genes, - from = "name", - to = c("id", "name", "bnumber", "gi")) { + function( + regulondb, + genes, + from = "name", + to = c("id", "name", "bnumber", "gi") + ) { # Function checks stopifnot(validObject(regulondb)) diff --git a/R/get_regulatory_network.R b/R/get_regulatory_network.R index f7496ca..dea4d8c 100644 --- a/R/get_regulatory_network.R +++ b/R/get_regulatory_network.R @@ -52,10 +52,12 @@ #' setEdgeColorMapping setVisualStyle get_regulatory_network <- - function(regulondb, - regulator = NULL, - type = "TF-GENE", - cytograph = FALSE) { + function( + regulondb, + regulator = NULL, + type = "TF-GENE", + cytograph = FALSE + ) { # Check type parameter if (!type %in% c("GENE-GENE", "TF-GENE", "TF-TF")) { stop("Parameter 'type' must be TF-GENE, TF-TF, or GENE-GENE.", diff --git a/R/list_attributes.R b/R/list_attributes.R index 64b600f..f804239 100644 --- a/R/list_attributes.R +++ b/R/list_attributes.R @@ -32,8 +32,8 @@ list_attributes <- function(regulondb, dataset) { if (missing(dataset)) { - stop("Parameter 'dataset' is missing, please specify\n") - } + stop("Parameter 'dataset' is missing, please specify\n") + } stopifnot(validObject(regulondb)) dbListFields(regulondb, dataset) } diff --git a/R/plot_dna_objects.R b/R/plot_dna_objects.R index 3337b7d..d98900c 100644 --- a/R/plot_dna_objects.R +++ b/R/plot_dna_objects.R @@ -18,8 +18,8 @@ #' @examples #' ## Connect to the RegulonDB database if necessary #' if (!exists("regulondb_conn")) { -#' regulondb_conn <- connect_database() -#' } +#' regulondb_conn <- connect_database() +#' } #' #' ## Build the regulondb object #' e_coli_regulondb <- @@ -47,10 +47,12 @@ #' ) #' @export plot_dna_objects <- - function(regulondb, - genome = "eschColi_K12", - grange = GRanges("chr", IRanges(1, 5000)), - elements = "gene") { + function( + regulondb, + genome = "eschColi_K12", + grange = GRanges("chr", IRanges(1, 5000)), + elements = "gene" + ) { valid_elements <- c( "-10 promoter box", "-35 promoter box", diff --git a/R/regulondb-classes.R b/R/regulondb-classes.R index a142ac6..e974fc9 100644 --- a/R/regulondb-classes.R +++ b/R/regulondb-classes.R @@ -86,10 +86,12 @@ setValidity("regulondb", function(object) { #' ) #' @export regulondb <- - function(database_conn, - organism, - genome_version, - database_version) { + function( + database_conn, + organism, + genome_version, + database_version + ) { stopifnot(is(database_conn, "SQLiteConnection")) stopifnot(is(organism, "character")) stopifnot(is(genome_version, "character")) diff --git a/README.Rmd b/README.Rmd index 031f5d0..a84fb7b 100644 --- a/README.Rmd +++ b/README.Rmd @@ -37,8 +37,8 @@ You can install the released version of `regutools` from [Bioconductor](http://b ```{r 'install release', eval = FALSE} if (!requireNamespace("BiocManager", quietly = TRUE)) { - install.packages("BiocManager") - } + install.packages("BiocManager") +} BiocManager::install("regutools") @@ -95,8 +95,8 @@ Get the latest stable `R` release from [CRAN](http://cran.r-project.org/). Then ```{r 'install', eval = FALSE} if (!requireNamespace("BiocManager", quietly = TRUE)) { - install.packages("BiocManager") - } + install.packages("BiocManager") +} BiocManager::install("regutools") ``` diff --git a/man/get_dna_objects.Rd b/man/get_dna_objects.Rd index b855bb5..b03d411 100644 --- a/man/get_dna_objects.Rd +++ b/man/get_dna_objects.Rd @@ -33,8 +33,8 @@ Retrieve genomic elements from regulonDB \examples{ ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() +} ## Build the regulondb object e_coli_regulondb <- diff --git a/man/plot_dna_objects.Rd b/man/plot_dna_objects.Rd index 9c6cc0d..0c9922b 100644 --- a/man/plot_dna_objects.Rd +++ b/man/plot_dna_objects.Rd @@ -34,8 +34,8 @@ Plot annotation elements within genomic region \examples{ ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() +} ## Build the regulondb object e_coli_regulondb <- diff --git a/man/regutools-package.Rd b/man/regutools-package.Rd index 31c90f4..0dc5b21 100644 --- a/man/regutools-package.Rd +++ b/man/regutools-package.Rd @@ -6,22 +6,9 @@ \alias{regutools-package} \title{regutools: regutools: an R package for data extraction from RegulonDB} \description{ -\if{html}{\figure{logo.png}{options: align='right' alt='logo' width='120'}} +\if{html}{\figure{logo.png}{options: style='float: right' alt='logo' width='120'}} -RegulonDB has collected, harmonized and centralized data - from hundreds of experiments for nearly two decades and is considered - a point of reference for transcriptional regulation in Escherichia coli K12. - Here, we present the regutools R package to facilitate programmatic - access to RegulonDB data in computational biology. regutools provides - researchers with the possibility of writing reproducible workflows - with automated queries to RegulonDB. The regutools package serves as - a bridge between RegulonDB data and the Bioconductor ecosystem by - reusing the data structures and statistical methods powered by other - Bioconductor packages. We demonstrate the integration of regutools - with Bioconductor by analyzing transcription factor DNA binding sites - and transcriptional regulatory networks from RegulonDB. We anticipate - that regutools will serve as a useful building block in our progress - to further our understanding of gene regulatory networks. +RegulonDB has collected, harmonized and centralized data from hundreds of experiments for nearly two decades and is considered a point of reference for transcriptional regulation in Escherichia coli K12. Here, we present the regutools R package to facilitate programmatic access to RegulonDB data in computational biology. regutools provides researchers with the possibility of writing reproducible workflows with automated queries to RegulonDB. The regutools package serves as a bridge between RegulonDB data and the Bioconductor ecosystem by reusing the data structures and statistical methods powered by other Bioconductor packages. We demonstrate the integration of regutools with Bioconductor by analyzing transcription factor DNA binding sites and transcriptional regulatory networks from RegulonDB. We anticipate that regutools will serve as a useful building block in our progress to further our understanding of gene regulatory networks. } \seealso{ Useful links: diff --git a/tests/testthat/test-build_condition.R b/tests/testthat/test-build_condition.R index 594f374..4a3e6e3 100644 --- a/tests/testthat/test-build_condition.R +++ b/tests/testthat/test-build_condition.R @@ -2,8 +2,8 @@ context("build_condition") test_that("Test that the logical conditions its made as expected", { ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() + } ## Build a regulondb object regdb <- diff --git a/tests/testthat/test-existing_intervals.R b/tests/testthat/test-existing_intervals.R index 8a1a8ad..b4ffc1d 100644 --- a/tests/testthat/test-existing_intervals.R +++ b/tests/testthat/test-existing_intervals.R @@ -3,8 +3,8 @@ context("build_condition") test_that("existing_intervals returns an expected value", { ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() + } ## Build a regulondb object regdb <- diff --git a/tests/testthat/test-existing_partial_match.R b/tests/testthat/test-existing_partial_match.R index 43ed837..74d994e 100644 --- a/tests/testthat/test-existing_partial_match.R +++ b/tests/testthat/test-existing_partial_match.R @@ -3,8 +3,8 @@ context("build_condition") test_that("existing_partial_match returns an expected value", { ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() + } ## Build a regulondb object regdb <- diff --git a/tests/testthat/test-get_binding_sites.R b/tests/testthat/test-get_binding_sites.R index dcf6ed8..ca2f868 100644 --- a/tests/testthat/test-get_binding_sites.R +++ b/tests/testthat/test-get_binding_sites.R @@ -2,8 +2,8 @@ context("Binding sites") test_that("Function to get transcription factor binding sites works as expected", { ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() + } ## Build a regulondb object regdb <- diff --git a/tests/testthat/test-get_dataset.R b/tests/testthat/test-get_dataset.R index 6a2ea12..24235f9 100644 --- a/tests/testthat/test-get_dataset.R +++ b/tests/testthat/test-get_dataset.R @@ -2,8 +2,8 @@ context("get_dataset") test_that("Function get dataset works as expected", { ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() + } ## Build a regulondb object regdb <- diff --git a/tests/testthat/test-get_dna_objects.R b/tests/testthat/test-get_dna_objects.R index 29db5b5..12ff04a 100644 --- a/tests/testthat/test-get_dna_objects.R +++ b/tests/testthat/test-get_dna_objects.R @@ -2,8 +2,8 @@ context("get_dna_objects") test_that("output is a GRanges object", { ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() + } ## Build a regulondb object regdb <- diff --git a/tests/testthat/test-get_gene_regulators.R b/tests/testthat/test-get_gene_regulators.R index 0b07b2b..fc3bc36 100644 --- a/tests/testthat/test-get_gene_regulators.R +++ b/tests/testthat/test-get_gene_regulators.R @@ -2,8 +2,8 @@ context("get_gene_regulators") test_that("function get_gene_regulators works as expected", { ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() + } ## Build a regulondb object regdb <- diff --git a/tests/testthat/test-get_gene_synonyms.R b/tests/testthat/test-get_gene_synonyms.R index 1545e7a..a4a6e29 100644 --- a/tests/testthat/test-get_gene_synonyms.R +++ b/tests/testthat/test-get_gene_synonyms.R @@ -1,8 +1,8 @@ test_that("get_gene_synonyms works ", { ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() + } ## Build a regulondb object regdb <- diff --git a/tests/testthat/test-guess_id.R b/tests/testthat/test-guess_id.R index f15a02b..1e13b8d 100644 --- a/tests/testthat/test-guess_id.R +++ b/tests/testthat/test-guess_id.R @@ -1,8 +1,8 @@ test_that("guess_id works ", { ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() + } ## Build a regulondb object regdb <- diff --git a/tests/testthat/test-list_attributes.R b/tests/testthat/test-list_attributes.R index 806d347..916a987 100644 --- a/tests/testthat/test-list_attributes.R +++ b/tests/testthat/test-list_attributes.R @@ -2,8 +2,8 @@ context("list_attributes") test_that("list_attributes works as expected ", { ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() + } ## Build a regulondb object regdb <- diff --git a/tests/testthat/test-list_datasets.R b/tests/testthat/test-list_datasets.R index 30b23e6..3c1d22c 100644 --- a/tests/testthat/test-list_datasets.R +++ b/tests/testthat/test-list_datasets.R @@ -2,8 +2,8 @@ context("list_datasets") test_that("function list_dataset works as expected", { ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() + } ## Build a regulondb object regdb <- diff --git a/tests/testthat/test-non_existing_intervals.R b/tests/testthat/test-non_existing_intervals.R index 1d267b9..cd682d0 100644 --- a/tests/testthat/test-non_existing_intervals.R +++ b/tests/testthat/test-non_existing_intervals.R @@ -3,8 +3,8 @@ context("build_condition") test_that("existing_partial_match returns an expected value", { ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() + } ## Build a regulondb object regdb <- diff --git a/tests/testthat/test-plot_dna_objects.R b/tests/testthat/test-plot_dna_objects.R index f501437..5df5874 100644 --- a/tests/testthat/test-plot_dna_objects.R +++ b/tests/testthat/test-plot_dna_objects.R @@ -2,8 +2,8 @@ context("plot_dna_objects") test_that("non-valid genomic elements causes error", { ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() + } ## Build a regulondb object regdb <- diff --git a/tests/testthat/test_convert_granges.R b/tests/testthat/test_convert_granges.R index 1fc9ef8..c026573 100644 --- a/tests/testthat/test_convert_granges.R +++ b/tests/testthat/test_convert_granges.R @@ -2,8 +2,8 @@ context("GRanges_convert") test_that("Results from regulondb queries can be converted to GRanges", { ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() + } ## Build a regulondb object regdb <- @@ -59,8 +59,8 @@ test_that("Results from regulondb queries can be converted to GRanges", { test_that("Results from regulondb queries can be converted to Biostrings", { ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() + } ## Build a regulondb object regdb <- diff --git a/tests/testthat/test_network_functions.R b/tests/testthat/test_network_functions.R index 24c5def..a230113 100644 --- a/tests/testthat/test_network_functions.R +++ b/tests/testthat/test_network_functions.R @@ -2,8 +2,8 @@ context("get_regulators") test_that("Functions to retrieve gene regulation work as expected", { ## Connect to the RegulonDB database if necessary if (!exists("regulondb_conn")) { - regulondb_conn <- connect_database() - } + regulondb_conn <- connect_database() + } ## Build a regulondb object regdb <- diff --git a/vignettes/regutools.Rmd b/vignettes/regutools.Rmd index 25664d3..6d1511e 100644 --- a/vignettes/regutools.Rmd +++ b/vignettes/regutools.Rmd @@ -95,8 +95,8 @@ bib <- c( ```{r 'install', eval = FALSE} if (!requireNamespace("BiocManager", quietly = TRUE)) { - install.packages("BiocManager") - } + install.packages("BiocManager") +} BiocManager::install("regutools")