Skip to content

Commit 721b906

Browse files
authored
Merge pull request #42 from josschavezf/devel
fix issue with database link
2 parents 327f7aa + 9d93eeb commit 721b906

33 files changed

Lines changed: 134 additions & 127 deletions

DESCRIPTION

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: regutools
22
Title: regutools: an R package for data extraction from RegulonDB
33
Version: 1.23.0
4-
Date: 2021-11-15
4+
Date: 2026-04-01
55
Authors@R: c(
66
person ("Joselyn", "Chavez", email = "joselynchavezf@gmail.com",
77
role = c("aut", "cre"), comment = c(ORCID = "0000-0002-4974-4591")),
@@ -35,7 +35,7 @@ Description: RegulonDB has collected, harmonized and centralized data
3535
to further our understanding of gene regulatory networks.
3636
License: Artistic-2.0
3737
Encoding: UTF-8
38-
Depends: R (>= 4.0)
38+
Depends: R (>= 4.5.0)
3939
Imports:
4040
AnnotationDbi,
4141
AnnotationHub,
@@ -51,8 +51,8 @@ Imports:
5151
stats,
5252
utils,
5353
BiocFileCache
54-
LazyData: true
55-
RoxygenNote: 7.1.1
54+
LazyData: false
55+
RoxygenNote: 7.3.3
5656
Suggests:
5757
BiocStyle,
5858
knitr,

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# regutools 1.23.0
2+
3+
BUG FIXES
4+
5+
* Fixed URL for the database
6+
17
# regutools 1.3.2
28

39
SIGNIFICANT USER-VISIBLE CHANGES

R/build_condition.R

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@
4747
#' @export
4848

4949
build_condition <-
50-
function(regulondb,
51-
dataset,
52-
filters,
53-
operator,
54-
interval,
55-
partialmatch) {
50+
function(
51+
regulondb,
52+
dataset,
53+
filters,
54+
operator,
55+
interval,
56+
partialmatch
57+
) {
5658
if (is(filters, "list")) {
5759
if (!all(names(filters) %in% list_attributes(regulondb, dataset))) {
5860
non.existing.attrs.index <-

R/connect_database.R

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
#' regulondb_conn_noAH <- connect_database(ah = NULL)
2727
connect_database <-
2828
function(
29-
ah = AnnotationHub::AnnotationHub(),
30-
bfc = BiocFileCache::BiocFileCache()) {
29+
ah = AnnotationHub::AnnotationHub(),
30+
bfc = BiocFileCache::BiocFileCache()
31+
) {
3132
if (!is.null(ah)) {
3233
## Check input
3334
stopifnot(methods::is(ah, "AnnotationHub"))
@@ -50,13 +51,8 @@ connect_database <-
5051
}
5152
}
5253

53-
5454
## Otherwise, use the Dropbox version and cache it with BiocFileCache
55-
url <-
56-
paste0(
57-
"https://www.dropbox.com/s/ufp6wqcv5211v1w/",
58-
"regulondb_v10.8_sqlite.db?dl=1"
59-
)
55+
url <- "https://github.com/ComunidadBioInfo/regutoolsData/raw/refs/heads/main/regulondb_v10.8_sqlite.db"
6056
destfile <- BiocFileCache::bfcrpath(bfc, url)
6157
AnnotationDbi::dbFileConnect(destfile)
6258
}

R/get_binding_sites.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525
#' ## Get the binding sites for AraC
2626
#' get_binding_sites(e_coli_regulondb, transcription_factor = "AraC")
2727
#' @export
28-
get_binding_sites <- function(regulondb, transcription_factor,
29-
output_format = "GRanges") {
28+
get_binding_sites <- function(
29+
regulondb, transcription_factor,
30+
output_format = "GRanges"
31+
) {
3032
## For a BiocCheck NOTE
3133
left <- right <- NULL
3234
if (!output_format %in% c("GRanges", "Biostrings")) {
@@ -49,7 +51,7 @@ get_binding_sites <- function(regulondb, transcription_factor,
4951
)
5052
tfbs_table <- strsplit(
5153
as.character(tfbs_table$res),
52-
split = "\t"
54+
split = "\t"
5355
)
5456
tfbs_table <- as.data.frame(do.call(rbind, tfbs_table))
5557
colnames(tfbs_table) <-

R/get_dataset.R

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,16 @@
6363
#' @importFrom S4Vectors DataFrame
6464
#' @importFrom Biostrings DNAStringSet BStringSet
6565
get_dataset <-
66-
function(regulondb,
67-
dataset = NULL,
68-
attributes = NULL,
69-
filters = NULL,
70-
and = TRUE,
71-
interval = NULL,
72-
partialmatch = NULL,
73-
output_format = "regulondb_result") {
66+
function(
67+
regulondb,
68+
dataset = NULL,
69+
attributes = NULL,
70+
filters = NULL,
71+
and = TRUE,
72+
interval = NULL,
73+
partialmatch = NULL,
74+
output_format = "regulondb_result"
75+
) {
7476
# Check if format specification is valid
7577
if (!output_format %in% c(
7678
"regulondb_result",
@@ -244,8 +246,8 @@ get_dataset <-
244246
#' convert_to_granges(get_dataset(e_coli_regulondb, dataset = "GENE"))
245247
convert_to_granges <- function(regulondb_result) {
246248
if (!is(regulondb_result, "regulondb_result")) {
247-
stop("The input is not a 'regulondb_result' object.")
248-
}
249+
stop("The input is not a 'regulondb_result' object.")
250+
}
249251
dataset <- regulondb_result@dataset
250252
if (dataset %in% c("GENE", "DNA_OBJECTS")) {
251253
posLeft <- "posleft"
@@ -292,11 +294,11 @@ convert_to_granges <- function(regulondb_result) {
292294
DataFrame(regulondb_result[keep, !colnames(regulondb_result) %in%
293295
c(posLeft, posRight, "strand"), drop = FALSE])
294296
if (sum(!keep) > 0) {
295-
warning(sprintf(
296-
"Dropped %s entries where genomic coordinates were NAs",
297-
sum(!keep)
298-
))
299-
}
297+
warning(sprintf(
298+
"Dropped %s entries where genomic coordinates were NAs",
299+
sum(!keep)
300+
))
301+
}
300302
grdata
301303
} else {
302304
stop(
@@ -349,11 +351,11 @@ convert_to_granges <- function(regulondb_result) {
349351
convert_to_biostrings <-
350352
function(regulondb_result, seq_type = "DNA") {
351353
if (!is(regulondb_result, "regulondb_result")) {
352-
stop("The input is not a 'regulondb_result' object.")
353-
}
354+
stop("The input is not a 'regulondb_result' object.")
355+
}
354356
if (!seq_type %in% c("DNA", "product")) {
355-
stop("'seq_type' must be either 'DNA' or 'product'")
356-
}
357+
stop("'seq_type' must be either 'DNA' or 'product'")
358+
}
357359
dataset <- regulondb_result@dataset
358360
if (dataset == "GENE") {
359361
if (seq_type == "DNA") {

R/get_dna_objects.R

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#' @examples
1717
#' ## Connect to the RegulonDB database if necessary
1818
#' if (!exists("regulondb_conn")) {
19-
#' regulondb_conn <- connect_database()
20-
#' }
19+
#' regulondb_conn <- connect_database()
20+
#' }
2121
#'
2222
#' ## Build the regulondb object
2323
#' e_coli_regulondb <-
@@ -45,10 +45,12 @@
4545
#' )
4646
#' @export
4747
get_dna_objects <-
48-
function(regulondb,
49-
genome = "eschColi_K12",
50-
grange = GRanges("chr", IRanges(1, 5000)),
51-
elements = "gene") {
48+
function(
49+
regulondb,
50+
genome = "eschColi_K12",
51+
grange = GRanges("chr", IRanges(1, 5000)),
52+
elements = "gene"
53+
) {
5254
valid_elements <- c(
5355
"-10 promoter box",
5456
"-35 promoter box",

R/get_gene_regulators.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@
4242
#' @export
4343

4444
get_gene_regulators <-
45-
function(regulondb,
46-
genes,
47-
format = "multirow",
48-
output.type = "TF") {
45+
function(
46+
regulondb,
47+
genes,
48+
format = "multirow",
49+
output.type = "TF"
50+
) {
4951
stopifnot(validObject(regulondb))
5052
# Check genes parameter class
5153
## if (!class(genes) %in% c("vector", "list", "character")) {

R/get_gene_synonyms.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@
3232
#' @export
3333

3434
get_gene_synonyms <-
35-
function(regulondb,
36-
genes,
37-
from = "name",
38-
to = c("id", "name", "bnumber", "gi")) {
35+
function(
36+
regulondb,
37+
genes,
38+
from = "name",
39+
to = c("id", "name", "bnumber", "gi")
40+
) {
3941
# Function checks
4042
stopifnot(validObject(regulondb))
4143

R/get_regulatory_network.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@
5252
#' setEdgeColorMapping setVisualStyle
5353

5454
get_regulatory_network <-
55-
function(regulondb,
56-
regulator = NULL,
57-
type = "TF-GENE",
58-
cytograph = FALSE) {
55+
function(
56+
regulondb,
57+
regulator = NULL,
58+
type = "TF-GENE",
59+
cytograph = FALSE
60+
) {
5961
# Check type parameter
6062
if (!type %in% c("GENE-GENE", "TF-GENE", "TF-TF")) {
6163
stop("Parameter 'type' must be TF-GENE, TF-TF, or GENE-GENE.",

0 commit comments

Comments
 (0)