Description Usage Arguments Details Value References See Also Examples
Produce a t-distributed stochastic neighbour embedding (t-SNE) plot of two
components for an SCESet
dataset.
1 2 3 4 5 6 7 8 9 | plotTSNE(object, ...)
## S4 method for signature 'SCESet'
plotTSNE(object, ntop = 500, ncomponents = 2,
exprs_values = "exprs", colour_by = NULL, shape_by = NULL,
size_by = NULL, feature_set = NULL, return_SCESet = FALSE,
scale_features = TRUE, draw_plot = TRUE, theme_size = 10,
rand_seed = NULL, perplexity = floor(ncol(object)/5), legend = "auto",
...)
|
object |
an |
... |
further arguments passed to |
ntop |
numeric scalar indicating the number of most variable features to
use for the t-SNE Default is |
ncomponents |
numeric scalar indicating the number of t-SNE
components to plot, starting from the first t-SNE component. Default is
2. If |
exprs_values |
character string indicating which values should be used
as the expression values for this plot. Valid arguments are |
colour_by |
character string defining the column of |
shape_by |
character string defining the column of |
size_by |
character string defining the column of |
feature_set |
character, numeric or logical vector indicating a set of
features to use for the t-SNE calculation. If character, entries must all be
in |
return_SCESet |
logical, should the function return an |
scale_features |
logical, should the expression values be standardised
so that each feature has unit variance? Default is |
draw_plot |
logical, should the plot be drawn on the current graphics
device? Only used if |
theme_size |
numeric scalar giving default font size for plotting theme (default is 10). |
rand_seed |
(optional) numeric scalar that can be passed to
|
perplexity |
numeric scalar value defining the "perplexity parameter"
for the t-SNE plot. Passed to |
legend |
character, specifying how the legend(s) be shown? Default is
|
The function Rtsne
is used internally to
compute the t-SNE.
If return_SCESet
is TRUE
, then the function returns an
SCESet
object, otherwise it returns a ggplot
object.
L.J.P. van der Maaten. Barnes-Hut-SNE. In Proceedings of the International Conference on Learning Representations, 2013.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## 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, ]
## Examples plotting PC1 and PC2
plotTSNE(example_sceset, perplexity = 10)
plotTSNE(example_sceset, colour_by = "Cell_Cycle", perplexity = 10)
plotTSNE(example_sceset, colour_by = "Cell_Cycle", shape_by = "Treatment",
perplexity = 10)
plotTSNE(example_sceset, colour_by = "Cell_Cycle", shape_by = "Treatment",
size_by = "Mutation_Status", perplexity = 10)
plotTSNE(example_sceset, shape_by = "Treatment", size_by = "Mutation_Status",
perplexity = 5)
plotTSNE(example_sceset, feature_set = 1:100, colour_by = "Treatment",
shape_by = "Mutation_Status", perplexity = 5)
plotTSNE(example_sceset, shape_by = "Treatment", return_SCESet = TRUE,
perplexity = 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.