plot_heterogeneity: Plots heterogeneity of the reads using ggplot2.

Description Usage Arguments Value See Also Examples

View source: R/helpers_plots.R

Description

This function creates stacked barplot explaining reads heterogeneity. It groups reads by user defined levels and measures how unique are reads in this level. Uniqueness of reads is simplified to the bins and colored according to the color gradient. Default color black indicates very high heterogeneity of the reads. The more yellow (default) the more similar are reads and less heterogeneous.

Usage

1
2
plot_heterogeneity(alignments, config, level = "ID",
  colors = c("#000000", "#F0E442"), bins = c(0, 5, seq(10, 100, 10)))

Arguments

alignments

(data.frame) Loaded alignment information from alignments_events.csv file.

config

(data.frame) Loaded table from config_summary.csv file.

level

(string) Name of the column from config file specifying levels to group by.

colors

(html colors vector) Two colours for gradient, eg. c('#000000', '#F0E442').

bins

(numeric vector) Numeric vector from 0 to 100 specifying bins eg. c(0, 5, seq(10, 100, 10)).

Value

(heterogeneity plot) ggplot2 object of heterogeneity plot

See Also

Other specialized plots: metaplot_deletions, metaplot_insertions, metaplot_mismatches, plot_cuts, plot_deletions, plot_insertions, plot_mismatches, plot_variants

Examples

1
2
3
4
5
6
7
8
9
#example config
config <- read.csv(system.file("extdata", "results", "config_summary.csv",
                               package = "amplican"))
#example alignments results
alignments_file <- system.file("extdata", "results", "alignments",
                               "events_filtered_shifted_normalized.csv",
                               package = "amplican")
alignments <- read.csv(alignments_file)
plot_heterogeneity(alignments[alignments$consensus, ], config)

amplican documentation built on Nov. 8, 2020, 11:10 p.m.