plotKmers {ngsReports} | R Documentation

## Plot Overrepresented Kmers

### Description

Plot Overrepresented Kmers

### Usage

    plotKmers(x, usePlotly = FALSE, labels, ...)

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

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

    ## S4 method for signature 'FastqcData'
    plotKmers(x, usePlotly = FALSE, labels, n = 6,
      ..., lineWidth = 0.5, pal = c("red", "blue", "green", "black",
      "magenta", "yellow"))

    ## S4 method for signature 'FastqcDataList'
    plotKmers(x, usePlotly = FALSE, labels,
      cluster = FALSE, dendrogram = FALSE, pwfCols,
      heatCol = inferno(50), ...)

### 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.
`...` | Used to pass various potting parameters to theme. Can also be used to set size and colour for box outlines.
`n` | `numeric`. The number of Kmers to show.
`lineWidth` | Passed to `geom_line(size = lineWidth)`
`pal` | The colour palette. If the vector supplied is less than n, `grDevices::colorRampPalette()` will be used
`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.
`pwfCols` | Object of class `PwfCols` to give colours for pass, warning, and fail values in the plot
`heatCol` | Colour palette used for the heatmap. Default is `inferno` from the package `viridris`

### Details

As the Kmer Content module present in FastQC reports is relatively uninformative, and omitted by default in later versions of FastQC, these are rudimentary plots.

Plots for `FastqcData` objects replicate those contained in a FastQC report, whilst the heatmap generated from `FastqcDataList` objects simply show the location and abundance of over-represented Kmers.

### Value

A standard ggplot2 object or an interactive 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)
    plotKmers(fdl[[1]])

[Package ngsReports version 1.0.1 Index]