plotErrors: Plot observed error rates after denoising.

Description Usage Arguments Value Examples

Description

This function plots the observed frequency of each transition (eg. A->C) as a function of the associated quality score. It also plots the final estimated error rates (if they exist). The initial input rates and the expected error rates under the nominal definition of quality scores can also be shown.

Usage

1
2
plotErrors(dq, nti = c("A", "C", "G", "T"), ntj = c("A", "C", "G", "T"),
  obs = TRUE, err_out = TRUE, err_in = FALSE, nominalQ = FALSE)

Arguments

dq

(Required). A dada-class object, or a list of such objects that were pooled to estimate a common set of error rates.

nti

(Optional). Default c("A","C","G","T"). Some combination of the 4 DNA nucleotides.

ntj

(Optional). Default c("A","C","G","T"). Some combination of the 4 DNA nucleotides.

The error rates from nti->ntj will be plotted. If multiple nti or ntj are chosen, error rates from each-to-each will be plotted in a grid.

obs

(Optional). Default TRUE. If TRUE, the observed error rates are plotted as points.

err_out

(Optional). Default TRUE. If TRUE, plot the output error rates (solid line).

err_in

(Optional). Default FALSE. If TRUE, plot the input error rates (dashed line).

nominalQ

(Optional). Default FALSE. If TRUE, plot the expected error rates (red line) if quality scores exactly matched their nominal definition: Q = -10 log10(p_err).

Value

A ggplot2 object. Will be rendered to default device if printed, or can be stored and further modified. See ggsave for additional options.

Examples

1
2
3
4
5
derep1 = derepFastq(system.file("extdata", "sam1F.fastq.gz", package="dada2"), verbose = TRUE)
dada1 <- dada(derep1, err = inflateErr(tperr1, 2), errorEstimationFunction = loessErrfun) 
plotErrors(dada1)
plotErrors(dada1, "A", "C")
plotErrors(dada1, nti="A", ntj=c("A","C","G","T"), err_in=TRUE, nominalQ=TRUE)


Search within the dada2 package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.