plotPCA: Sample PCA Plot for Transformed Data

Description Usage Arguments Value Author(s) See Also Examples

Description

Wrapper for DESeq2::plotPCA() that improves principal component analysis (PCA) sample coloring and labeling.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## S4 method for signature 'SummarizedExperiment'
plotPCA(object, genes = NULL,
  samples = NULL, interestingGroups, color = scale_color_hue(),
  label = FALSE, title = "pca", return = c("ggplot", "data.frame"))

## S4 method for signature 'DESeqDataSet'
plotPCA(object, ...)

## S4 method for signature 'bcbioRNASeq'
plotPCA(object, normalized = c("rlog", "vst", "tmm",
  "tpm"), ...)

Arguments

object

Object.

genes

Character vector of genes to include. These must match the rownames of the object. It is best practice to use the stable gene identifiers from Ensembl (e.g. "ENSG00000000003") and not the gene symbols.

samples

Character vector of samples to include.

interestingGroups

Character vector denoting groups of interest that define the samples. If left unset, defaults to sampleName.

color

Desired ggplot color scale. Must supply discrete values. When set to NULL, the default ggplot2 color palette will be used. If manual color definitions are desired, we recommend using ggplot2::scale_color_manual().

label

Superimpose sample text labels on the plot.

title

Title of plot.

return

Object class to return. Uses match.arg() internally and picks the first item in the vector by default.

...

Additional arguments.

normalized

Character indicating which normalization method to apply:

  • "tpm": Transcripts per million (tximport).

  • "tmm": edgeR trimmed mean of M-values. Calculated on the fly.

  • "rlog": DESeq2 log2 regularized log transformation.

  • "vst": DESeq2 log2 variance stabilizing transformation.

Value

ggplot or data.frame.

Author(s)

Michael Steinbaugh

See Also

Other Quality Control Functions: plot5Prime3PrimeBias, plotCorrelationHeatmap, plotCountDensity, plotCountsPerGene, plotDispEsts, plotExonicMappingRate, plotGenderMarkers, plotGeneSaturation, plotGenesDetected, plotIntronicMappingRate, plotMappedReads, plotMappingRate, plotMeanSD, plotPCACovariates, plotRRNAMappingRate, plotTotalReads

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# bcbioRNASeq ====
plotPCA(bcb_small, label = FALSE)
plotPCA(bcb_small, label = TRUE)

# Select samples
plotPCA(
    object = bcb_small,
    samples = head(colnames(bcb_small), 4L),
    label = TRUE
)

# DESeqDataSet ====
# DESeqTransform method is preferred
plotPCA(dds_small)

roryk/bcbioRnaseq documentation built on May 27, 2019, 10:44 p.m.