View source: R/plot_embedding.R
plot_embedding_sce | R Documentation |
Plot selected PCs from an embedding saved in a SingleCellExperiment object
plot_embedding_sce( sce, which_embedding, color_attr = NULL, color_title = color_attr, ellipse_attr = NULL, facet_attr = NULL, ... )
sce |
|
which_embedding |
character; for the embedding to plot |
color_attr |
character; name of the attribute within |
color_title |
character; title to use for colors legend, defaults to the same as |
ellipse_attr |
character; name of the attribute within |
facet_attr |
character; name of the attribute within |
... |
additional optional arguments - see |
default none; options to display plot (showplot
), save plot (saveplot
), and/or return ggplot2
object (returngg
)
library(DuoClustering2018) library(SingleCellExperiment) sce <- sce_full_Zhengmix4eq()[1:100,sample(1:3500,100,replace = FALSE)] colData(sce)$Method <- matrix(sample(c('Method1','Method2'),100,replace = TRUE)) sce <- corralm(sce, splitby = 'Method') # to plot and show only plot_embedding_sce(sce = sce, which_embedding = 'corralm', xpc = 1, plot_title = 'corralm: PC1 by PC2', color_attr = "Method", ellipse_attr = 'phenoid', saveplot = FALSE) # to return ggplot2 object and display, but not save corralm_ggplot <- plot_embedding_sce(sce = sce, which_embedding = 'corralm', xpc = 1, plot_title = 'corralm: PC1 by PC2', color_attr = 'Method', ellipse_attr = 'phenoid', returngg = TRUE, saveplot = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.