plot_strand {MutationalPatterns} | R Documentation

## Plot strand per base substitution type

### Description

For each base substitution type and transcriptional strand the total number of mutations and the relative contribution within a group is returned.

### Usage

    plot_strand(strand_bias_df, mode = "relative", colors)

### Arguments

`strand_bias_df` | data.frame, result from strand_bias function
`mode` | Either "absolute" for absolute number of mutations, or "relative" for relative contribution, default = "relative"
`colors` | Optional color vector for plotting with 6 values

### Value

Barplot

### See Also

`mut_matrix_stranded`, `strand_occurrences`, `plot_strand_bias`

### Examples

    ## 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")

    strand_counts = strand_occurrences(mut_mat_s, by=tissue)

    #' ## Plot the strand in relative mode.
    strand_plot = plot_strand(strand_counts)

    #' ## Or absolute mode.
    strand_plot = plot_strand(strand_counts, mode = "absolute")

[Package MutationalPatterns version 1.6.1 Index]