plotSeqContent {ngsReports} | R Documentation

## Plot the per base content as a heatmap

### Description

Plot the Per Base content for a set of FASTQC files.

### Usage

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

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

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

    ## S4 method for signature 'FastqcData'
    plotSeqContent(x, usePlotly = FALSE, labels, ...)

    ## S4 method for signature 'FastqcDataList'
    plotSeqContent(
      x,
      usePlotly = FALSE,
      labels,
      pwfCols,
      plotType = c("heatmap", "line", "residuals"),
      cluster = FALSE,
      dendrogram = FALSE,
      ...,
      nc = 2
    )

### Arguments

`x` | Can be a `FastqcData`, `FastqcDataList` or file paths
`usePlotly` | `logical`. Generate an interactive plot using plotly
`labels` | An optional named vector of labels for the file names. All file names must be present in the names of the vector. File extensions are dropped by default.
`...` | Used to pass additional attributes to theme() and between methods
`pwfCols` | Object of class `PwfCols` to give colours for pass, warning, and fail values in plot
`plotType` | `character`. Type of plot to generate. Must be "line", "heatmap" or "residuals"
`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.
`nc` | Specify the number of columns if plotting a FastqcDataList as line plots. Passed to `ggplot2::facet_wrap`.

### Details

Per base sequence content ( heatmap colours when plotting from multiple reports. The individual line plots are able to be generated by setting `plotType = "line"`, and the layout is determined by `facet_wrap` from ggplot2.

Individual line plots are also generated when plotting from a single `FastqcData` object.

If setting `usePlotly = TRUE` for a large number of reports, the plot can be slow to render. An alternative may be to produce a plot of residuals for each base, produced by taking the position-specific mean for each base.

### Value

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

    # The default plot
    plotSeqContent(fdl)

[Package ngsReports version 1.6.1 Index]