plotDupLevels {ngsReports} | R Documentation

## Plot the combined Sequence_Duplication_Levels information

### Description

Plot the Sequence_Duplication_Levels information for a set of FASTQC reports

### Usage

    plotDupLevels(x, usePlotly = FALSE, labels, pwfCols, ...)

    ## S4 method for signature 'ANY'
    plotDupLevels(x, usePlotly = FALSE, labels, pwfCols, ...)

    ## S4 method for signature 'character'
    plotDupLevels(x, usePlotly = FALSE, labels,
      pwfCols, ...)

    ## S4 method for signature 'FastqcData'
    plotDupLevels(x, usePlotly = FALSE, labels,
      pwfCols, warn = 20, fail = 50, lineCols = c("red", "blue"), ...)

    ## S4 method for signature 'FastqcDataList'
    plotDupLevels(x, usePlotly = FALSE, labels,
      pwfCols, deduplication = c("pre", "post"), cluster = FALSE,
      dendrogram = FALSE, heatCol = inferno(50), ...)

### Arguments

`x` | Can be a `FastqcData`, `FastqcDataList` or file path
`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 the plot
`...` | Used to pass additional attributes to theme() and between methods
`warn, fail` | The default values for warn and fail are 20 and 50 respectively (i.e. percentages)
`lineCols` | Colours of the lines drawn for individual libraries
`deduplication` | Plot Duplication levels 'pre' or 'post' deduplication. Can only take values "pre" and "post"
`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.
`heatCol` | Colour palette used for the heatmap

### Details

This extracts the Sequence_Duplication_Levels from the supplied object and generates a ggplot2 object, with a set of minimal defaults. For multiple reports, this defaults to a heatmap with block sizes proportional to the percentage of reads belonging to that duplication category.

If setting `usePlotly = FALSE`, the output of this function can be further modified using standard ggplot2 syntax. If setting `usePlotly = TRUE` an interactive plotly object will be produced.

### Value

A standard ggplot2 or plotly object

### Examples

    # 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)

    # Draw the default plot for a single file
    plotDupLevels(fdl[[1]])

    plotDupLevels(fdl)

[Package ngsReports version 1.2.0 Index]