plotBaseQuals-methods: Plot the Base Qualities for each file

Description Usage Arguments Details Value Examples

Description

Plot the Base Qualities for each file as separate plots

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
58
59
60
61
62
63
plotBaseQuals(
  x,
  usePlotly = FALSE,
  labels,
  pwfCols,
  warn = 25,
  fail = 20,
  boxWidth = 0.8,
  ...
)

## S4 method for signature 'ANY'
plotBaseQuals(
  x,
  usePlotly = FALSE,
  labels,
  pwfCols,
  warn = 25,
  fail = 20,
  boxWidth = 0.8,
  ...
)

## S4 method for signature 'character'
plotBaseQuals(
  x,
  usePlotly = FALSE,
  labels,
  pwfCols,
  warn = 25,
  fail = 20,
  boxWidth = 0.8,
  ...
)

## S4 method for signature 'FastqcData'
plotBaseQuals(
  x,
  usePlotly = FALSE,
  labels,
  pwfCols,
  warn = 25,
  fail = 20,
  boxWidth = 0.8,
  ...
)

## S4 method for signature 'FastqcDataList'
plotBaseQuals(
  x,
  usePlotly = FALSE,
  labels,
  pwfCols,
  warn = 25,
  fail = 20,
  boxWidth = 0.8,
  plotType = c("heatmap", "boxplot"),
  plotValue = "Mean",
  cluster = FALSE,
  dendrogram = FALSE,
  nc = 2,
  ...
)

Arguments

x

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

usePlotly

logical Default FALSE will render using ggplot. If TRUE plot will be rendered with plotly

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 to give colours for pass, warning, and fail values in plot

warn, fail

The default values for warn and fail are 30 and 20 respectively (i.e. percentages)

boxWidth

set the width of boxes when using a boxplot

...

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

plotType

character Can be either "boxplot" or "heatmap"

plotValue

character Type of data to be presented. Can be any of the columns returned by getModule(x, module = "Per_base_sequence_qual")

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.

nc

numeric. The number of columns to create in the plot layout. Only used if drawing boxplots for multiple files in a FastqcDataList

Details

When acting on a FastqcDataList, this defaults to a heatmap using the mean Per_base_sequence_quality score. A set of plots which replicate those obtained through a standard FastQC html report can be obtained by setting plotType = "boxplot", which uses facet_wrap to provide the layout as a single ggplot object.

When acting an a FastqcData object, this replicates the Per base sequence quality plots from FastQC with no faceting.

For large datasets, subsetting by R1 or R2 reads may be helpful.

An interactive plot can be obtained by setting 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)

# The default plot for multiple libraries is a heatmap
plotBaseQuals(fdl)

# The default plot for a single library is the standard boxplot
plotBaseQuals(fdl[[1]])

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