plotFastqcPCA {ngsReports} | R Documentation |
Draw a PCA plot for Fast QC modules across multiple samples
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, ... )
x |
Can be a |
module |
|
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 |
cluster |
|
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 |
... |
Used to pass additional attributes to theme() and between methods |
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.
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) plotFastqcPCA(fdl, module = "Per_sequence_quality_scores", cluster = TRUE)