From 48520780b23419e04f6a26d6a0a848f341252907 Mon Sep 17 00:00:00 2001 From: J Wokaty Date: Mon, 26 Aug 2024 10:13:25 -0400 Subject: [PATCH] Fix indent --- R/bedbaser.R | 15 +++++++++------ R/utils.R | 16 +++++++++------- tests/testthat/test-bedbaser.R | 6 ++++-- vignettes/bedbaser.Rmd | 6 ++++-- 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/R/bedbaser.R b/R/bedbaser.R index 60cb3d3..a27cba4 100644 --- a/R/bedbaser.R +++ b/R/bedbaser.R @@ -57,7 +57,7 @@ BEDbase <- function() { } #' Display API -#' +#' #' @param x BEDbase object #' @param ... other options #' @param .deprecated (default FALSE) if deprecated @@ -76,7 +76,8 @@ setMethod( "operations", "BEDbase", function(x, ..., .deprecated = FALSE) { callNextMethod(x, ..., .deprecated = .deprecated) - }) + } +) #' Get the example BED file or BEDset with metadata #' @@ -172,8 +173,9 @@ bb_metadata <- function(api, id, full = FALSE) { #' bb_list_beds(api) #' #' @export -bb_list_beds <- function(api, genome = NULL, bed_type = NULL, limit = 1000, - offset = 0) { +bb_list_beds <- function( + api, genome = NULL, bed_type = NULL, limit = 1000, + offset = 0) { rsp <- api$list_beds_v1_bed_list_get( genome = genome, bed_type = bed_type, limit = limit, offset = offset @@ -323,8 +325,9 @@ bb_bed_text_search <- function(api, query, limit = 10, offset = 0) { #' bb_to_granges(api, ex_bed$id) #' #' @export -bb_to_granges <- function(api, bed_id, file_type = "bed", extra_cols = NULL, - quietly = TRUE) { +bb_to_granges <- function( + api, bed_id, file_type = "bed", extra_cols = NULL, + quietly = TRUE) { stopifnot(file_type %in% c("bed", "bigbed")) metadata <- bb_metadata(api, bed_id, TRUE) file_path <- .get_file(metadata, file_type, "http", quietly) diff --git a/R/utils.R b/R/utils.R index 381abf0..8182573 100644 --- a/R/utils.R +++ b/R/utils.R @@ -39,8 +39,9 @@ #' .get_file(md, "bed", "http") #' #' @noRd -.get_file <- function(metadata, file_type = c("bed", "bigbed"), - access_type = c("s3", "http"), quietly = TRUE) { +.get_file <- function( + metadata, file_type = c("bed", "bigbed"), + access_type = c("s3", "http"), quietly = TRUE) { file_details <- .format_metadata_files(metadata$files) |> filter( name == paste(file_type, "file", sep = "_"), @@ -121,8 +122,9 @@ #' .bed_file_to_granges(file_path, md) #' #' @noRd -.bed_file_to_granges <- function(file_path, metadata, extra_cols = NULL, - quietly = TRUE) { +.bed_file_to_granges <- function( + file_path, metadata, extra_cols = NULL, + quietly = TRUE) { bed_format <- gsub("peak", "Peak", metadata$bed_format) nums <- str_replace(metadata$bed_type, "bed", "") |> str_split_1("\\+") |> @@ -140,9 +142,9 @@ extra_cols <- .get_extra_cols(file_path, nums[1], nums[2]) } import(file_path, - format = "bed", - extraCols = extra_cols, - genome = metadata$genome_alias + format = "bed", + extraCols = extra_cols, + genome = metadata$genome_alias ) } else { import(file_path, format = bed_format, genome = metadata$genome_alias) diff --git a/tests/testthat/test-bedbaser.R b/tests/testthat/test-bedbaser.R index 30e5641..8497106 100644 --- a/tests/testthat/test-bedbaser.R +++ b/tests/testthat/test-bedbaser.R @@ -102,8 +102,10 @@ test_that("bb_to_granges returns a GRanges object given a bigBed file", { gro <- bb_to_granges(api, ex_bed$id, "bigbed") expect_equal("GRanges", class(gro)[1]) } else { - expect_warning(rlang::warn("This feature does not work on Windows."), - bb_to_granges(api, ex_bed$id, "bigbed")) + expect_warning( + rlang::warn("This feature does not work on Windows."), + bb_to_granges(api, ex_bed$id, "bigbed") + ) } }) diff --git a/vignettes/bedbaser.Rmd b/vignettes/bedbaser.Rmd index a9ee3f7..830951b 100644 --- a/vignettes/bedbaser.Rmd +++ b/vignettes/bedbaser.Rmd @@ -191,8 +191,10 @@ Download the [chain file](https://hgdownload.cse.ucsc.edu/downloads.html#liftover) from UCSC. ```{r convertCoordinates_getTheChain, message=FALSE} -chain_url <- paste0("https://hgdownload.cse.ucsc.edu/goldenPath/mm10/liftOver/", - "mm10ToMm39.over.chain.gz") +chain_url <- paste0( + "https://hgdownload.cse.ucsc.edu/goldenPath/mm10/liftOver/", + "mm10ToMm39.over.chain.gz" +) tmpdir <- tempdir() gz <- file.path(tmpdir, "mm10ToMm39.over.chain.gz") download.file(chain_url, gz)