Skip to content

Commit

Permalink
Add tests for accepting GRanges object
Browse files Browse the repository at this point in the history
  • Loading branch information
HDash committed Jun 21, 2024
1 parent 1e08c65 commit ba21145
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ package-lock\.json$
package\.json$
^inst/markdown/.*\.html$
^data-raw$
^codecov.yml
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ vignettes/*.R
.Renviron
# MotifPeeker specific
inst/markdown/*.html
.gitignore
codecov.yml
7 changes: 7 additions & 0 deletions tests/testthat/test-read_peak_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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))
})

0 comments on commit ba21145

Please sign in to comment.