@@ -50,7 +50,8 @@ test_data_reduce <- peakCombiner:::crReduce(
5050# #
5151test_data_overlap <- peakCombiner ::: crOverlapWithSummits(
5252 data = test_data_reduce ,
53- input = test_data_filtered
53+ input = test_data_filtered ,
54+ removeFlankOverlaps = TRUE
5455)
5556# #
5657# ## -----------------------------------------------------------------------###
@@ -90,6 +91,57 @@ test_that("Input data frame has the expected structure", {
9091 expect_true(is.character(data $ sample_name ))
9192 expect_true(sum(stringr :: str_detect(data $ name , " |" )) > 0 )
9293})
94+ # #
95+ # ## -----------------------------------------------------------------------###
96+ # ## Test removeFlankOverlaps
97+ # ## -----------------------------------------------------------------------###
98+ # #
99+
100+ testthat :: expect_no_error(
101+ peakCombiner ::: crOverlapWithSummits(
102+ data = test_data_reduce ,
103+ input = test_data_filtered ,
104+ removeFlankOverlaps = TRUE
105+ )
106+ )
107+
108+
109+ testthat :: expect_no_error(
110+ peakCombiner ::: crOverlapWithSummits(
111+ data = test_data_reduce ,
112+ input = test_data_filtered ,
113+ removeFlankOverlaps = FALSE
114+ )
115+ )
116+
117+ testthat :: expect_error(
118+ peakCombiner ::: crOverlapWithSummits(
119+ data = test_data_reduce ,
120+ input = test_data_filtered ,
121+ removeFlankOverlaps = NULL
122+ )
123+ )
124+
125+ # # See if non-overlaping regions are removed using removeFlankOverlaps
126+ test_data_reduce_1 <- test_data_reduce [1 : 5 ,] | >
127+ dplyr :: mutate(chrom = " chr5" ) | >
128+ rbind(test_data_reduce )
129+
130+ testthat :: expect_equal(
131+ peakCombiner ::: crOverlapWithSummits(
132+ data = test_data_reduce_1 ,
133+ input = test_data_filtered ,
134+ removeFlankOverlaps = FALSE
135+ ) | > nrow(), 47
136+ )
137+ testthat :: expect_equal(
138+ peakCombiner ::: crOverlapWithSummits(
139+ data = test_data_reduce_1 ,
140+ input = test_data_filtered ,
141+ removeFlankOverlaps = TRUE
142+ ) | > nrow(), 42
143+ )
144+
93145# #
94146# ## -----------------------------------------------------------------------###
95147# ## Test Output
0 commit comments