Reduced dimension plots | R Documentation |
Wrapper functions to create plots for specific types of reduced dimension results in a SingleCellExperiment object.
plotPCASCE(object, ..., ncomponents = 2, dimred = "PCA")
plotTSNE(object, ..., ncomponents = 2, dimred = "TSNE")
plotUMAP(object, ..., ncomponents = 2, dimred = "UMAP")
plotDiffusionMap(object, ..., ncomponents = 2, dimred = "DiffusionMap")
plotMDS(object, ..., ncomponents = 2, dimred = "MDS")
plotNMF(object, ..., ncomponents = 2, dimred = "NMF")
## S4 method for signature 'SingleCellExperiment'
plotPCA(object, ..., ncomponents = 2, dimred = "PCA")
object |
A SingleCellExperiment object. |
... |
Additional arguments to pass to |
ncomponents |
Numeric scalar indicating the number of dimensions components to (calculate and) plot.
This can also be a numeric vector, see |
dimred |
A string or integer scalar indicating the reduced dimension
result in |
Each function is a convenient wrapper around plotReducedDim
that searches the reducedDims
slot for an appropriately named dimensionality reduction result:
"PCA"
for plotPCA
"TSNE"
for plotTSNE
"DiffusionMap"
for plotDiffusionMap
"MDS"
for "plotMDS"
"NMF"
for "plotNMF"
"UMAP"
for "plotUMAP"
Its only purpose is to streamline workflows to avoid the need to specify the dimred
argument.
A ggplot object.
Davis McCarthy, with modifications by Aaron Lun
runPCA
,
runDiffusionMap
,
runTSNE
,
runMDS
,
runNMF
,
and runUMAP
,
for the functions that actually perform the calculations.
plotReducedDim
, for the underlying plotting function.
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")
## Not run:
## Same for DiffusionMaps:
example_sce <- runDiffusionMap(example_sce)
plotDiffusionMap(example_sce)
## End(Not run)
## Same for MDS plots:
example_sce <- runMDS(example_sce)
plotMDS(example_sce)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.