Generates one plot for each dataset, colored by chosen feature (column) from cell.data slot. Feature can be categorical (factor) or continuous. Can also plot all datasets combined with by.dataset = FALSE.
plotFeature(
object,
feature,
by.dataset = TRUE,
discrete = NULL,
title = NULL,
pt.size = 0.3,
text.size = 3,
do.shuffle = TRUE,
rand.seed = 1,
do.labels = FALSE,
axis.labels = NULL,
do.legend = TRUE,
legend.size = 5,
option = "plasma",
cols.use = NULL,
zero.color = "#F5F5F5",
return.plots = FALSE
)
liger
object. Should call runTSNE or runUMAP before calling.
Feature to plot (should be column from cell.data slot).
Whether to generate separate plot for each dataset (default TRUE).
Whether to treat feature as discrete; if left NULL will infer from column class in cell.data (if factor, treated like discrete) (default NULL).
Plot title (default NULL).
Controls size of points representing cells (default 0.3).
Controls size of plot text (cluster center labels) (default 3).
Randomly shuffle points so that points from same dataset are not plotted one after the other (default TRUE).
Random seed for reproducibility of point shuffling (default 1).
Print centroid labels for categorical features (default FALSE).
Vector of two strings to use as x and y labels respectively.
Display legend on plots (default TRUE).
Size of legend spots for discrete data (default 5).
Colormap option to use for ggplot2's scale_color_viridis (default 'plasma').
Vector of colors to form gradient over instead of viridis colormap (low to high). Only applies to continuous features (default NULL).
Color to use for zero values (no expression) (default '#F5F5F5').
Return ggplot plot objects instead of printing directly (default FALSE).
List of ggplot plot objects (only if return.plots TRUE, otherwise prints plots to console).
# NOT RUN {
# ligerex (liger object), factorization complete
# get tsne.coords for normalized data
ligerex <- runTSNE(ligerex)
# plot nUMI to console
plotFeature(ligerex, feature = 'nUMI')
# }
Run the code above in your browser using DataLab