plotFastqcPCA-methods: Draw a PCA plot for Fast QC modules

Description Usage Arguments Details Value Examples

Description

Draw a PCA plot for Fast QC modules across multiple samples \lifecycleexperimental

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
plotFastqcPCA(
  x,
  module,
  usePlotly = FALSE,
  labels,
  cluster = FALSE,
  clusterType = "colour",
  groups = NULL,
  ...
)

## S4 method for signature 'ANY'
plotFastqcPCA(
  x,
  module,
  usePlotly = FALSE,
  labels,
  cluster = FALSE,
  clusterType = "colour",
  groups = NULL,
  ...
)

## S4 method for signature 'character'
plotFastqcPCA(
  x,
  module,
  usePlotly = FALSE,
  labels,
  cluster = FALSE,
  clusterType = "colour",
  groups = NULL,
  ...
)

## S4 method for signature 'FastqcDataList'
plotFastqcPCA(
  x,
  module,
  usePlotly = FALSE,
  labels,
  cluster = FALSE,
  clusterType = "colour",
  groups = NULL,
  ...
)

Arguments

x

Can be a FastqcData, FastqcDataList or file paths

module

character vector containing the desired FastQC module (eg. c("Per_base_sequence_quality", "Per_base_sequence_content"))

usePlotly

logical. Output as ggplot2 (default) or plotly object.

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

cluster

logical default FALSE. If groups argument is not set fastqc data will be clustered using hierarchical clustering.

clusterType

One of "color/colour" or "hulls". Default is "colours" and will colour points based on cluster/group, "hulls" will draw a polygon around each cluster.

groups

Optional data.frame (or tibble) with columns Filename and Group. Values in the Filename column should correspond to the values returned by fqName(x). If not supplied and cluster = TRUE, clusters will be automatically generated using HCPC from FactoMiner

...

Used to pass additional attributes to theme() and between methods

Details

This carries out PCA on all or a subset of FastQC modules and plots the output using either ggplot or plotly. Clustering of the PCA can be carried out using a hierarchical clustering approach. Current modules for PCA are Per_base_sequence_quality, Per_sequence_quality_scores, Per_sequence_GC_content, Per_base_sequence_content, and Sequence_Length_Distribution.

Value

A standard ggplot2 object, or an interactive plotly object

Examples

1
2
3
4
5
6
7
# 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)
plotFastqcPCA(fdl, module = "Per_sequence_quality_scores", cluster = TRUE)

ngsReports documentation built on Nov. 23, 2020, 2:01 a.m.