This function is an extension of plotPCA() that is optimized for automatic handling of differentially expressed genes, rather than requiring manual input of a gene vector or subset object.

# S4 method for DESeqResults
plotDEGPCA(object, counts, direction = c("both",
  "up", "down"), object, assay = 1L, interestingGroups = NULL,
  label = getOption("basejump.label", FALSE),
  color = getOption("basejump.color.discrete", NULL),
  pointSize = getOption("basejump.point.size", 3L),
  return = c("ggplot", "DataFrame"), ...)

# S4 method for DESeqAnalysis
plotDEGPCA(object, results,
  contrastSamples = FALSE, direction = c("both", "up", "down"),
  assay = 1L, interestingGroups = NULL,
  label = getOption("basejump.label", FALSE),
  color = getOption("basejump.color.discrete", NULL),
  pointSize = getOption("basejump.point.size", 3L),
  return = c("ggplot", "DataFrame"), ...)

Arguments

object

Object.

counts

DESeqTransform. Variance-stabilized counts suitable for heatmap. Object rownames must be identical to corresponding DESeqResults.

direction

character(1). Plot "both", "up", or "down" directions.

assay

vector(1). Name or index of count matrix slotted in assays(). When passing in a string, the name must be defined in assayNames().

interestingGroups

character. Groups of interest that define the samples. If left unset, defaults to sampleName.

label

logical(1). Superimpose sample text labels on the plot.

color

function, character, or NULL. Hexadecimal color function or values to use for plot.

We generally recommend these hexadecimal functions from the viridis package:

Alternatively, colors can be defined manually using hexadecimal values (e.g. c("#FF0000", "#0000FF")), but this is not generally recommended. Refer to the RColorBrewer package for hexadecimal color palettes that may be suitable. If set NULL, will use the default pheatmap colors.

pointSize

numeric(1). Point size for dots in the plot.

return

character(1). Return type. Uses match.arg() internally and defaults to the first argument in the character vector.

...

Additional arguments.

results

character(1) or integer(1). Name or position of DESeqResults.

contrastSamples

logical(1). Experimental. Only include the samples used to define the contrast passed to DESeq2::results(). This setting will break for complex DESeq2 contrasts (e.g. interaction effect).

Details

To adjust the annotation columns, modify the colData() of the counts argument, which must contain/extend a SummarizedExperiment.

Examples

data(deseq) ## DESeqAnalysis ==== plotDEGPCA(deseq, results = 1L)
#> DESeqResults: condition B vs A (shrunken LFC)
#> 171 differentially expressed genes detected.
#> Plotting PCA using 171 genes.