plotEEProfile: Plot Expected Errors Profile

View source: R/plot.R

plotEEProfileR Documentation

Plot Expected Errors Profile

Description

Plots the cumulative expected errors (EE) of a fastq file or collection of fastq files over sequence positions. This function extends plotQualityProfile as it appears in version 1.12.1 and makes use of its code.

Usage

plotEEProfile(
  fn,
  n = 5e+05,
  aggregate = FALSE,
  logEE = TRUE,
  include_quality_profile = FALSE
)

Arguments

fn

Full name(s) of input fastq file(s), including directory.

n

(Optional) Default 5e+5. The number of reads to sample when processing fastq files; passed to qa.

aggregate

(Optiona) Default FALSE. If inputting multiple fastq files, whether to aggregate their expected errors into one summary plot. If "aggregate" and "include_quality_profile" are both TRUE, also aggregates the quality profiles into one summary plot.

logEE

(Optional) Default TRUE. Whether to log10-transform the Y-axis of the expected error profile.

include_quality_profile

(Optional) Default FALSE. Whether to include the quality profile in the return value (see below).

Details

The red solid line represents the median cumulative EE, the red dotted lines represent the 25th and 75th percentiles of cumulative EE, and the blue-green line represents the mean cumulative EE.

Value

If include_quality_profile = FALSE (default), returns a ggplot of the expected errors. If include_quality_profile = TRUE, returns a length of list two: (1) a ggplot of the expected errors, and (2) a ggplot of the quality profile(s).

Examples

## Not run: 
fnFs <- c("sample1_R1.fastq", "sample2_R1.fastq", "sample3_R1.fastq")
plotEEProfile(fnFs) # produces a multi-faceted ggplot
plotEEProfile(fnFs, aggregate=TRUE) # produces a single-faceted ggplot
p <- plotEEProfile(fnFs, aggregate=TRUE, include_quality_profile=TRUE) # produces a list containing two single-faceted ggplots:
plot(p[[1]]) # expected errors profile
plot(p[[2]]) # quality profile

## End(Not run)


claraqin/neonMicrobe documentation built on April 11, 2024, 11:47 a.m.