File: test-count_dbs_contexts.R

package info (click to toggle)
r-bioc-mutationalpatterns 3.8.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,336 kB
  • sloc: sh: 8; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 871 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
context("test-count_dbs_contexts")

## Get a GRangesList object with dbs contexts.
grl_dbs_context <- readRDS(system.file("states/blood_grl_dbs_context.rds",
  package = "MutationalPatterns"
))

output <- count_dbs_contexts(grl_dbs_context)
expected <- readRDS(system.file("states/blood_dbs_counts.rds",
  package = "MutationalPatterns"
))

test_that("Output has correct class", {
  expect_true(inherits(output, c("matrix")))
})

test_that("Output is identical to expected", {
  expect_identical(output, expected)
})


grl_dbs_context_bad <- readRDS(system.file("states/blood_grl_dbs.rds",
                                        package = "MutationalPatterns"
))


test_that("An error occurs when the context has not been set.", {
    expect_error({count_dbs_contexts(grl_dbs_context_bad)},
                 "There are some REF or ALT bases, that do not belong")
    })