| plotSeqLengthDistn {ngsReports} | R Documentation |
Plot the Sequence Length Distribution across one or more FASTQC reports
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", "cumulative"), ..., expand.x = expand_scale(0,
0.2))
## S4 method for signature 'FastqcDataList'
plotSeqLengthDistn(x, usePlotly = FALSE,
labels, counts = FALSE, plotType = c("heatmap", "line",
"cumulative"), cluster = FALSE, dendrogram = FALSE, ...,
expand.x = expand_scale(0, 0.2), heatCol = inferno(50))
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. |
... |
Used to pass additional attributes to theme() |
plotType |
|
expand.x |
Output from |
counts |
|
cluster |
|
dendrogram |
|
heatCol |
The colour scheme for the heatmap |
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 cumulative plot can also be generated to provide guidance for minimum
read length in some NGS workflows, by setting plotType = "cumulative".
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.
A standard ggplot2 object, or an interactive 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 as a frequency plot using lines
plotSeqLengthDistn(fdl)
# Or plot the cumulative value
plotSeqLengthDistn(fdl, plotType = "cumulative")