| plot_strand_bias {MutationalPatterns} | R Documentation |
Plot strand bias per base substitution type per group
plot_strand_bias(strand_bias, colors)
strand_bias |
data.frame, result from strand_bias function |
colors |
Optional color vector with 6 values for plotting |
Barplot
mut_matrix_stranded,
strand_occurrences,
strand_bias_test
plot_strand
## See the 'mut_matrix_stranded()' example for how we obtained the
## following mutation matrix.
mut_mat_s <- readRDS(system.file("states/mut_mat_s_data.rds",
package="MutationalPatterns"))
## Load a reference genome.
ref_genome <- "BSgenome.Hsapiens.UCSC.hg19"
library(ref_genome, character.only = TRUE)
tissue <- c("colon", "colon", "colon",
"intestine", "intestine", "intestine",
"liver", "liver", "liver")
## Perform the strand bias test.
strand_counts = strand_occurrences(mut_mat_s, by=tissue)
strand_bias = strand_bias_test(strand_counts)
## Plot the strand bias.
plot_strand_bias(strand_bias)