plot_reddim: Plot specific reduced dimensions

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Wrapper functions to create plots for specific types of reduced dimension results in a SingleCellExperiment object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
plotPCASCE(object, ..., ncomponents = 2)

plotTSNE(object, ..., ncomponents = 2)

plotUMAP(object, ..., ncomponents = 2)

plotDiffusionMap(object, ..., ncomponents = 2)

plotMDS(object, ..., ncomponents = 2)

plotNMF(object, ..., ncomponents = 2)

## S4 method for signature 'SingleCellExperiment'
plotPCA(object, ..., ncomponents = 2)

Arguments

object

A SingleCellExperiment object.

...

Additional arguments to pass to plotReducedDim.

ncomponents

Numeric scalar indicating the number of dimensions components to (calculate and) plot. This can also be a numeric vector, see ?plotReducedDim for details.

Details

Each function is a convenient wrapper around plotReducedDim that searches the reducedDims slot for an appropriately named dimensionality reduction result:

Its only purpose is to streamline workflows to avoid the need to specify the dimred argument.

Value

A ggplot object.

Author(s)

Davis McCarthy, with modifications by Aaron Lun

See Also

runPCA, runDiffusionMap, runTSNE, runMDS, runNMF, and runUMAP, for the functions that actually perform the calculations.

plotReducedDim, for the underlying plotting function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
example_sce <- mockSCE()
example_sce <- logNormCounts(example_sce)
example_sce <- runPCA(example_sce)

## Examples plotting PC1 and PC2
plotPCA(example_sce)
plotPCA(example_sce, colour_by = "Cell_Cycle")
plotPCA(example_sce, colour_by = "Cell_Cycle", shape_by = "Treatment")

## Examples plotting more than 2 PCs
plotPCA(example_sce, ncomponents = 4, colour_by = "Treatment",
    shape_by = "Mutation_Status")

## Same for TSNE:
example_sce <- runTSNE(example_sce)
plotTSNE(example_sce, colour_by="Mutation_Status")

## Same for DiffusionMaps:
example_sce <- runDiffusionMap(example_sce)
plotDiffusionMap(example_sce)

## Same for MDS plots:
example_sce <- runMDS(example_sce)
plotMDS(example_sce)

scater documentation built on Feb. 28, 2021, 2:01 a.m.