Skip to content

Commit

Permalink
tests pass for center fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
jrboyd committed Dec 11, 2024
1 parent bbc1704 commit 6008fa0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion man/ct2-flip.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions tests/testthat/test_center_signal.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ p.sample.c = plotSignalHeatmap(ct2.sample.c, heatmap_format_FUN = function(p) p
ct2.sample.c2 = centerProfilesAndRefetch(ct2.sample, view_size = 500, use_cache = FALSE)
p.sample.c2 = plotSignalHeatmap(ct2.sample.c2, heatmap_format_FUN = function(p) p + labs(title = "centered 500") + geom_vline(xintercept = 0), sort_strategy = "left")

all(rowRanges(ct2.sample.c) == rowRanges(ct2.sample))
all(rowRanges(ct2.sample.c) == rowRanges(ct2.sample.c2))
#these are dumb tests, the plots are the real key
#for now, functions running without error and doing something is sufficient
test_that("centering does something", {
expect_true(!all(rowRanges(ct2.sample.c) == rowRanges(ct2.sample)))
expect_true(!all(rowRanges(ct2.sample.c) == rowRanges(ct2.sample.c2)))
})

rowRanges(ct2.summary)
#flipping profiles adds strand information
Expand Down Expand Up @@ -98,3 +102,13 @@ plotSignalHeatmap(
rowRanges(ct2.sample.flip[1:5,])

flipProfilesToMatch(ct2.sample[1:5,])

#these are dumb tests, the plots are the real key
#for now, functions running without error and doing something is sufficient
test_that("centering does something after flip", {
expect_true(!all(rowRanges(ct2.sample.flip.c) == rowRanges(ct2.sample.flip)))
expect_true(!all(rowRanges(ct2.sample) == rowRanges(ct2.sample.flip)))

expect_true(!all(rowRanges(ct2.summary.flip.c) == rowRanges(ct2.summary.flip)))
expect_true(!all(rowRanges(ct2.summary) == rowRanges(ct2.summary.flip)))
})

0 comments on commit 6008fa0

Please sign in to comment.