plotSeqLengthDistn-methods: Plot the Sequence Length Distribution

Description Usage Arguments Details Value Examples

Description

Plot the Sequence Length Distribution across one or more FASTQC reports

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
plotSeqLengthDistn(x, usePlotly = FALSE, labels, ...)

## S4 method for signature 'ANY'
plotSeqLengthDistn(x, usePlotly = FALSE, labels, ...)

## S4 method for signature 'character'
plotSeqLengthDistn(x, usePlotly = FALSE, labels, ...)

## S4 method for signature 'FastqcData'
plotSeqLengthDistn(
  x,
  usePlotly = FALSE,
  labels,
  plotType = c("line", "cdf"),
  ...,
  expand.x = expansion(0, 0.2)
)

## S4 method for signature 'FastqcDataList'
plotSeqLengthDistn(
  x,
  usePlotly = FALSE,
  labels,
  counts = FALSE,
  plotType = c("heatmap", "line", "cdf"),
  cluster = FALSE,
  dendrogram = FALSE,
  ...,
  expand.x = expansion(0, 0.2),
  heatCol = inferno(50)
)

Arguments

x

Can be a FastqcData, FastqcDataList or file paths

usePlotly

logical. Output as ggplot2 or plotly object.

labels

An optional named vector of labels for the file names. All filenames must be present in the names. File extensions are dropped by default.

...

Used to pass additional attributes to theme()

plotType

character. Can only take the values plotType = "heatmap" plotType = "line" or plotType = "cdf"

expand.x

Output from expansion() or numeric vector of length 4. Passed to scale_x_discrete

counts

logical Should distributions be shown as counts or frequencies (percentages)

cluster

logical default FALSE. If set to TRUE, fastqc data will be clustered using hierarchical clustering

dendrogram

logical redundant if cluster and usePlotly are FALSE. If both cluster and dendrogram are specified as TRUE then the dendrogram will be displayed.

heatCol

The colour scheme for the heatmap

Details

This extracts the Sequence Length Distribution from the supplied object and generates a ggplot2 object, with a set of minimal defaults. The output of this function can be further modified using the standard ggplot2 methods.

A cdf plot can also be generated to provide guidance for minimum read length in some NGS workflows, by setting plotType = "cdf". If all libraries have reads of identical lengths, these plots may be less informative.

An alternative interactive plot is available by setting the argument usePlotly = TRUE.

Value

A standard ggplot2 object, or an interactive plotly object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Get the files included with the package
packageDir <- system.file("extdata", package = "ngsReports")
fl <- list.files(packageDir, pattern = "fastqc.zip", full.names = TRUE)

# Load the FASTQC data as a FastqcDataList object
fdl <- FastqcDataList(fl)

# Plot as a frequency plot using lines
plotSeqLengthDistn(fdl)

# Or plot the cdf
plotSeqLengthDistn(fdl, plotType = "cdf")

ngsReports documentation built on Nov. 23, 2020, 2:01 a.m.