Skip to content

Commit

Permalink
Adding unit tests for plotOverlapMetric() method
Browse files Browse the repository at this point in the history
  • Loading branch information
adeschen committed Feb 18, 2021
1 parent 04570b2 commit b3a611a
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/testthat/test-CNVMetricsOverlapMethods.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
})

0 comments on commit b3a611a

Please sign in to comment.