Description Usage Arguments Details Value Examples
#' Produce an MDS plot from the cell pairwise distance data in an
SCESet
dataset.
1 2 3 4 5 6 7 8 9 10 11 | plotMDS(object, ...)
plotMDSSCESet(object, ncomponents = 2, colour_by = NULL, shape_by = NULL,
size_by = NULL, return_SCESet = FALSE, draw_plot = TRUE,
exprs_values = "exprs", theme_size = 10, legend = "auto")
## S4 method for signature 'SCESet'
plotMDS(object, ncomponents = 2, colour_by = NULL,
shape_by = NULL, size_by = NULL, return_SCESet = FALSE,
draw_plot = TRUE, exprs_values = "exprs", theme_size = 10,
legend = "auto")
|
object |
an |
... |
arguments passed to S4 plotMDS method |
ncomponents |
numeric scalar indicating the number of principal
components to plot, starting from the first principal component. Default is
2. If |
colour_by |
character string defining the column of |
shape_by |
character string defining the column of |
size_by |
character string defining the column of |
return_SCESet |
logical, should the function return an |
draw_plot |
logical, should the plot be drawn on the current graphics
device? Only used if |
exprs_values |
a string specifying the expression values to use for
colouring the points, if |
theme_size |
numeric scalar giving default font size for plotting theme (default is 10). |
legend |
character, specifying how the legend(s) be shown? Default is
|
The function cmdscale
is used internally to
compute the multidimensional scaling components to plot.
If return_SCESet
is TRUE
, then the function returns an
SCESet
object, otherwise it returns a ggplot
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Set up an example SCESet
data("sc_example_counts")
data("sc_example_cell_info")
pd <- new("AnnotatedDataFrame", data = sc_example_cell_info)
example_sceset <- newSCESet(countData = sc_example_counts, phenoData = pd)
drop_genes <- apply(exprs(example_sceset), 1, function(x) {var(x) == 0})
example_sceset <- example_sceset[!drop_genes, ]
example_sceset <- calculateQCMetrics(example_sceset)
## define cell-cell distances
cellDist(example_sceset) <- as.matrix(dist(t(exprs(example_sceset))))
## Examples plotting
plotMDS(example_sceset)
plotMDS(example_sceset, colour_by = "Cell_Cycle")
plotMDS(example_sceset, colour_by = "Cell_Cycle",
shape_by = "Treatment")
## define cell-cell distances differently
cellDist(example_sceset) <- as.matrix(dist(t(counts(example_sceset)),
method = "canberra"))
plotMDS(example_sceset, colour_by = "Cell_Cycle",
shape_by = "Treatment", size_by = "Mutation_Status")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.