Usage
plotTSNE(object, ...)
"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", ...)
Arguments
...
further arguments passed to Rtsne
ntop
numeric scalar indicating the number of most variable features to
use for the t-SNE Default is 500
, but any ntop
argument is
overrided if the feature_set
argument is non-NULL.
ncomponents
numeric scalar indicating the number of t-SNE
components to plot, starting from the first t-SNE component. Default is
2. If ncomponents
is 2, then a scatterplot of component 1 vs component
2 is produced. If ncomponents
is greater than 2, a pairs plots for the
top components is produced. NB: computing more than two components for t-SNE
can become very time consuming.
exprs_values
character string indicating which values should be used
as the expression values for this plot. Valid arguments are "tpm"
(default; transcripts per million), "norm_tpm"
(normalised TPM
values), "fpkm"
(FPKM values), "norm_fpkm"
(normalised FPKM
values), "counts"
(counts for each feature), "norm_counts"
,
"cpm"
(counts-per-million), "norm_cpm"
(normalised
counts-per-million), "exprs"
(whatever is in the 'exprs'
slot
of the SCESet
object; default), "norm_exprs"
(normalised
expression values) or "stand_exprs"
(standardised expression values),
or any other named element of the assayData
slot of the SCESet
object that can be accessed with the get_exprs
function.
colour_by
character string defining the column of pData(object)
to
be used as a factor by which to colour the points in the plot.
shape_by
character string defining the column of pData(object)
to
be used as a factor by which to define the shape of the points in the plot.
size_by
character string defining the column of pData(object)
to
be used as a factor by which to define the size of points in the plot.
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 featureNames(object)
. If numeric, values are taken to be indices for
features. If logical, vector is used to index features and should have length
equal to nrow(object)
.
return_SCESet
logical, should the function return an SCESet
object with principal component values for cells in the
reducedDimension
slot. Default is FALSE
, in which case a
ggplot
object is returned.
scale_features
logical, should the expression values be standardised
so that each feature has unit variance? Default is TRUE
.
draw_plot
logical, should the plot be drawn on the current graphics
device? Only used if return_SCESet
is TRUE
, otherwise the plot
is always produced.
theme_size
numeric scalar giving default font size for plotting theme
(default is 10).
rand_seed
(optional) numeric scalar that can be passed to
set.seed
to make plots reproducible.
perplexity
numeric scalar value defining the "perplexity parameter"
for the t-SNE plot. Passed to Rtsne
- see documentation
for that package for more details. legend
character, specifying how the legend(s) be shown? Default is
"auto"
, which hides legends that have only one level and shows others.
Alternatives are "all" (show all legends) or "none" (hide all legends).