diff --git a/tests/testthat/test-CNVMetricsOverlapMethods.R b/tests/testthat/test-CNVMetricsOverlapMethods.R index ea9a481..7cfdbfc 100644 --- a/tests/testthat/test-CNVMetricsOverlapMethods.R +++ b/tests/testthat/test-CNVMetricsOverlapMethods.R @@ -315,3 +315,39 @@ test_that("plotOverlapMetric() must return error when type==BOTH and filename gi error_message) }) +test_that("plotOverlapMetric() must return a gtable when graph for amplification", { + + demo <- GRangesList() + demo[["sample01"]] <- GRanges(seqnames="chr1", + ranges=IRanges(start=c(100, 300, 800), end = c(200, 500, 900)), + strand="*", state=c("AMPLIFICATION", "AMPLIFICATION", "DELETION")) + demo[["sample02"]] <- GRanges(seqnames="chr1", + ranges=IRanges(start=c(150, 600, 1000), end=c(250, 700, 1500)), + strand="*", state=c("AMPLIFICATION", "AMPLIFICATION", "DELETION")) + + metric <- calculateOverlapMetric(segmentData = demo, + method = "szymkiewicz") + + result <- plotOverlapMetric(metric=metric, type="AMPLIFICATION") + + expect_is(object=result, class="gtable") +}) + +test_that("plotOverlapMetric() must return a gtable when graph for deletion", { + + demo <- GRangesList() + demo[["sample01"]] <- GRanges(seqnames="chr1", + ranges=IRanges(start=c(100, 300, 800), end = c(200, 500, 900)), + strand="*", state=c("AMPLIFICATION", "AMPLIFICATION", "DELETION")) + demo[["sample02"]] <- GRanges(seqnames="chr1", + ranges=IRanges(start=c(150, 600, 1000), end=c(250, 700, 1500)), + strand="*", state=c("AMPLIFICATION", "AMPLIFICATION", "DELETION")) + + metric <- calculateOverlapMetric(segmentData = demo, + method = "szymkiewicz") + + result <- plotOverlapMetric(metric=metric, type="DELETION") + + expect_is(object=result, class="gtable") +}) +