From 6008fa0597e5e4422ee6814be0523967d5076654 Mon Sep 17 00:00:00 2001 From: jrboyd Date: Wed, 11 Dec 2024 15:08:52 -0500 Subject: [PATCH] tests pass for center fetch --- man/ct2-flip.Rd | 2 +- tests/testthat/test_center_signal.R | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/man/ct2-flip.Rd b/man/ct2-flip.Rd index 833c801..3c5a399 100644 --- a/man/ct2-flip.Rd +++ b/man/ct2-flip.Rd @@ -5,7 +5,7 @@ \alias{flipProfilesToMatch,ChIPtsne2_no_rowRanges-method} \title{flipProfilesToMatch} \usage{ -flipProfilesToMatch(ct2, highest_on_right = TRUE) +flipProfilesToMatch(ct2, highest_on_right = FALSE) \S4method{flipProfilesToMatch}{ChIPtsne2_no_rowRanges}(ct2, highest_on_right = FALSE) } diff --git a/tests/testthat/test_center_signal.R b/tests/testthat/test_center_signal.R index e1650ba..9910907 100644 --- a/tests/testthat/test_center_signal.R +++ b/tests/testthat/test_center_signal.R @@ -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 @@ -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))) +})