|
63 | 63 | #' @importFrom S4Vectors DataFrame |
64 | 64 | #' @importFrom Biostrings DNAStringSet BStringSet |
65 | 65 | 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 | + ) { |
74 | 76 | # Check if format specification is valid |
75 | 77 | if (!output_format %in% c( |
76 | 78 | "regulondb_result", |
@@ -244,8 +246,8 @@ get_dataset <- |
244 | 246 | #' convert_to_granges(get_dataset(e_coli_regulondb, dataset = "GENE")) |
245 | 247 | convert_to_granges <- function(regulondb_result) { |
246 | 248 | 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 | + } |
249 | 251 | dataset <- regulondb_result@dataset |
250 | 252 | if (dataset %in% c("GENE", "DNA_OBJECTS")) { |
251 | 253 | posLeft <- "posleft" |
@@ -292,11 +294,11 @@ convert_to_granges <- function(regulondb_result) { |
292 | 294 | DataFrame(regulondb_result[keep, !colnames(regulondb_result) %in% |
293 | 295 | c(posLeft, posRight, "strand"), drop = FALSE]) |
294 | 296 | 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 | + } |
300 | 302 | grdata |
301 | 303 | } else { |
302 | 304 | stop( |
@@ -349,11 +351,11 @@ convert_to_granges <- function(regulondb_result) { |
349 | 351 | convert_to_biostrings <- |
350 | 352 | function(regulondb_result, seq_type = "DNA") { |
351 | 353 | 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 | + } |
354 | 356 | 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 | + } |
357 | 359 | dataset <- regulondb_result@dataset |
358 | 360 | if (dataset == "GENE") { |
359 | 361 | if (seq_type == "DNA") { |
|
0 commit comments