plotAdapterContent-methods: Draw an Adapter Content Plot

Description Usage Arguments Details Value Examples

Description

Draw an Adapter Content Plot 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
plotAdapterContent(
  x,
  usePlotly = FALSE,
  labels,
  pwfCols,
  warn = 5,
  fail = 10,
  ...
)

## S4 method for signature 'ANY'
plotAdapterContent(
  x,
  usePlotly = FALSE,
  labels,
  pwfCols,
  warn = 5,
  fail = 10,
  ...
)

## S4 method for signature 'character'
plotAdapterContent(
  x,
  usePlotly = FALSE,
  labels,
  pwfCols,
  warn = 5,
  fail = 10,
  ...
)

## S4 method for signature 'FastqcData'
plotAdapterContent(
  x,
  usePlotly = FALSE,
  labels,
  pwfCols,
  warn = 5,
  fail = 10,
  ...
)

## S4 method for signature 'FastqcDataList'
plotAdapterContent(
  x,
  usePlotly = FALSE,
  labels,
  pwfCols,
  warn = 5,
  fail = 10,
  plotType = c("heatmap", "line"),
  adapterType = "Total",
  cluster = FALSE,
  dendrogram = FALSE,
  ...
)

Arguments

x

Can be a FastqcData, a FastqcDataList or character vector of file paths

usePlotly

logical. Output as ggplot2 (default) 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.

pwfCols

Object of class PwfCols containing the colours for PASS/WARN/FAIL

warn, fail

The default values for warn and fail are 5 and 10 respectively (i.e. percentages)

...

Used to pass additional attributes to theme() and between methods

plotType

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

adapterType

A regular expression matching the adapter(s) to be plotted. To plot all adapters summed, specify adapterType = "Total". This is the default behaviour.

cluster

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

dendrogram

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

Details

This extracts the Adapter_Content module 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.

When x is a single or FastqcData object line plots will always be drawn for all adapters. Otherwise, users can select line plots or heatmaps. When plotting more than one fastqc file, any undetected adapters will not be shown.

An interactive version of the plot can be made by setting usePlotly as TRUE

Value

A standard ggplot2 object, or an interactive plotly object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# 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)

# The default plot
plotAdapterContent(fdl)

# Also subset the reads to just the R1 files
r1 <- grepl("R1", fqName(fdl))
plotAdapterContent(fdl[r1])

# Plot just the Universal Adapter
# and change the y-axis using ggplot2::scale_y_continuous
plotAdapterContent(fdl, adapterType ="Universal", plotType = "line") +
facet_wrap(~Filename) +
guides(colour = FALSE)

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