File: test-plot_compare_indels.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 (35 lines) | stat: -rw-r--r-- 985 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
31
32
33
34
35
context("test-plot_compare_indels")

# Get indel counts
indel_counts <- readRDS(system.file("states/blood_indel_counts.rds",
  package = "MutationalPatterns"
))

# Get indel refit
fit_res <- readRDS(system.file("states/indel_refit.rds",
  package = "MutationalPatterns"
))

# Run default function
output <- plot_compare_indels(indel_counts[, 1], fit_res$reconstructed[, 1])

# Test you can change the name
output_name <- plot_compare_indels(indel_counts[, 1],
  fit_res$reconstructed[, 2],
  profile_names = c("Original", "Reconstructed")
)

## You can also change the y limits.
## This can be done separately for the profiles and the different facets.
output_yaxis <- plot_compare_indels(indel_counts[, 1],
  fit_res$reconstructed[, 2],
  profile_ymax = 0.3,
  diff_ylim = c(-0.03, 0.03)
)

# Perform tests
test_that("Output has correct class", {
  expect_true(inherits(output, c("gg")))
  expect_true(inherits(output_name, c("gg")))
  expect_true(inherits(output_yaxis, c("gg")))
})