barplotAlleleFreqs {CrispRVariants} | R Documentation

## Plots barplots of the spectrum of variants for a sample set

### Description

For signature "matrix", this function optionally does a very naive classification of variants by size. Frameshift variant combinations are those whose sum is not divisible by three. Intron boundaries are *NOT* considered, use with caution! For signature "CrisprSet", the function uses the VariantAnnotation package to localize variant alleles with respect to annotated transcripts. Variants are annotated as "coding" when they are coding in any transcript.

(signature("CrisprSet")) Groups variants by size and type and produces a barplot showing the variant spectrum for each sample. Accepts all arguments accepted by barplotAlleleFreqs for signature("matrix"). Requires package "VariantAnnotation"

signature("matrix") Accepts a matrix of allele counts, with rownames being alleles and column names samples.

### Usage

    barplotAlleleFreqs(obj, ...)

    ## S4 method for signature 'CrisprSet'
    barplotAlleleFreqs(obj, ..., txdb, min.freq = 0,
      include.chimeras = TRUE, group = NULL, palette = c("rainbow",
      "bluered"))

    ## S4 method for signature 'matrix'
    barplotAlleleFreqs(obj, category.labels = NULL,
      group = NULL, bar.colours = NULL, group.colours = NULL,
      legend.text.size = 10, axis.text.size = 10, legend.symbol.size = 1,
      snv.label = "SNV", novar.label = "no variant", chimera.label = "Other",
      include.table = TRUE, classify = TRUE)

### Arguments

`obj` | The object to be plotted
`...` | additional arguments
`txdb` | A transcript database object
`min.freq` | Include variants with at frequency least min.freq in at least one sample. (Default: 0, i.e. no cutoff)
`include.chimeras` | Should chimeric reads be included in results? (Default: TRUE)
`group` | A grouping factor for the columns in obj. Columns in the same group will be displayed in the same text colour (Default: NULL)
`palette` | Colour palette. Options are "rainbow", a quantitative palette (default) or "bluered", a gradient palette.
`category.labels` | Labels for each category, corresponding to the rows of obj. Only applicable when categories are provided, i.e. "classify" is FALSE. (Default: NULL)
`bar.colours` | Colours for the categories in the barplot. Colours must be provided if there are more than 6 different categories.
`group.colours` | Colours for the text labels for the experimental groups A set of 15 different colours is provided.
`legend.text.size` | The size of the legend text, in points.
`axis.text.size` | The size of the axis text, in points
`legend.symbol.size` | The size of the symbols in the legend
`snv.label` | The row label for single nucleotide variants
`novar.label` | The row label for non-variant sequences
`chimera.label` | The row label for chimeric (non-linearly aligned) variant alleles
`include.table` | Should a table of allele (variant combination) counts and total sequences be plotted? (Default: TRUE)
`classify` | If TRUE, performs a naive classification by size (Default:TRUE)

### Value

A ggplot2 barplot of the allele distribution and optionally a table of allele counts

### Author(s)

Helen Lindsay

### Examples

    data("gol_clutch1")
    barplotAlleleFreqs(variantCounts(gol))

    # Just show the barplot without the counts table:
    barplotAlleleFreqs(variantCounts(gol), include.table = FALSE)

[Package CrispRVariants version 1.15.0 Index]