diff --git a/.Rbuildignore b/.Rbuildignore index f6b8792..94655d7 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -17,3 +17,4 @@ package-lock\.json$ package\.json$ ^inst/markdown/.*\.html$ ^data-raw$ +^codecov.yml diff --git a/.gitignore b/.gitignore index b4f56bd..282f3e1 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,5 @@ vignettes/*.R .Renviron # MotifPeeker specific inst/markdown/*.html +.gitignore +codecov.yml diff --git a/tests/testthat/test-read_peak_file.R b/tests/testthat/test-read_peak_file.R index 5f9d8dd..5e1c99c 100644 --- a/tests/testthat/test-read_peak_file.R +++ b/tests/testthat/test-read_peak_file.R @@ -9,6 +9,7 @@ test_that("read_peak_file can read MACS3 peak file and auto-infer format", { package = "MotifPeeker") macs3_peak_read <- read_peak_file(macs3_peak_file) expect_length(macs3_peak_read, 209) + expect_identical(read_peak_file(macs3_peak_read), macs3_peak_read) }) test_that("read_peak_file fails with unknown file format forced", { invalid_peak_file <- system.file("extdata", "motif_MA1102.3.jaspar", @@ -17,3 +18,9 @@ test_that("read_peak_file fails with unknown file format forced", { expect_error(read_peak_file(invalid_peak_file, file_format = "bed")) expect_error(read_peak_file(invalid_peak_file)) }) +test_that("read_peak_file fails if GRanges without summit col is passed", { + macs3_peak_file <- system.file("extdata", "CTCF_ChIP_peaks.narrowPeak", + package = "MotifPeeker") + peak_gr <- rtracklayer::import(macs3_peak_file, format = "narrowPeak") + expect_error(read_peak_file(peak_gr)) +})