plotReadTotals-methods: Draw a barplot of read totals

Description Usage Arguments Details Value Examples

Description

Draw a barplot of read totals

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
plotReadTotals(
  x,
  usePlotly = FALSE,
  labels,
  duplicated = TRUE,
  bars = c("stacked", "adjacent"),
  barCols = c("red", "blue"),
  expand.x = expansion(mult = c(0, 0.02)),
  ...
)

## S4 method for signature 'ANY'
plotReadTotals(
  x,
  usePlotly = FALSE,
  labels,
  duplicated = TRUE,
  bars = c("stacked", "adjacent"),
  barCols = c("red", "blue"),
  expand.x = expansion(mult = c(0, 0.02)),
  ...
)

## S4 method for signature 'character'
plotReadTotals(
  x,
  usePlotly = FALSE,
  labels,
  duplicated = TRUE,
  bars = c("stacked", "adjacent"),
  barCols = c("red", "blue"),
  expand.x = expansion(mult = c(0, 0.02)),
  ...
)

## S4 method for signature 'FastqcDataList'
plotReadTotals(
  x,
  usePlotly = FALSE,
  labels,
  duplicated = TRUE,
  bars = c("stacked", "adjacent"),
  barCols = c("red", "blue"),
  expand.x = expansion(mult = c(0, 0.02)),
  ...
)

Arguments

x

Can be a FastqcData, FastqcDataList or 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.

duplicated

logical. Include deduplicated read total estimates to plot charts

bars

If duplicated = TRUE, show unique and deduplicated reads as "stacked" or "adjacent".

barCols

Colours for duplicated and unique reads.

expand.x

Output from expansion() controlling x-axis expansion. Alternatively can be a numeric vector of length 4

...

Used to pass additional attributes to theme()

Details

Draw a barplot of read totals using the standard ggplot2 syntax. The raw data from readTotals can otherwise be used to manually create a plot.

Duplication levels are based on the value shown on FASTQC reports at the top of the DeDuplicatedTotals plot, which is known to be inaccurate. As it still gives a good guide as to sequence diversity it is included as the default. This can be turned off by setting duplicated = FALSE.

Value

Returns a ggplot or 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 the Read Totals showing estimated duplicates
plotReadTotals(fdl)

# Plot the Read Totals without estimated duplicates
plotReadTotals(fdl, duplicated = FALSE)

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