plotReadTotals {ngsReports} | R Documentation |
Draw a barplot of read totals
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)), ... )
x |
Can be a |
usePlotly |
|
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 |
|
bars |
If |
barCols |
Colours for duplicated and unique reads. |
expand.x |
Output from |
... |
Used to pass additional attributes to theme() |
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
.
Returns a ggplot or plotly object
# 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)