Generates plot of dimensional reduction coordinates (default t-SNE) colored by expression of specified gene. Data can be scaled by dataset or selected feature column from cell.data (or across all cells). Data plots can be split by feature.
plotGene(
object,
gene,
use.raw = FALSE,
use.scaled = FALSE,
scale.by = "dataset",
log2scale = NULL,
methylation.indices = NULL,
plot.by = "dataset",
set.dr.lims = FALSE,
pt.size = 0.1,
min.clip = NULL,
max.clip = NULL,
clip.absolute = FALSE,
points.only = FALSE,
option = "plasma",
cols.use = NULL,
zero.color = "#F5F5F5",
axis.labels = NULL,
do.legend = TRUE,
return.plots = FALSE,
keep.scale = FALSE,
raster = NULL
)
If returning single plot, returns ggplot object; if returning multiple plots; returns list of ggplot objects.
liger
object. Should call runTSNE before calling.
Gene for which to plot expression.
Plot raw UMI values instead of normalized, log-transformed data (default FALSE).
Plot values scaled across specified groups of cells (with log transformation) (default FALSE).
Grouping of cells by which to scale gene (can be any factor column in cell.data or 'none' for scaling across all cells) (default 'dataset').
Whether to show log2 transformed values or original normalized, raw, or scaled values (as stored in object). Default value is FALSE if use.raw = TRUE, otherwise TRUE.
Indices of datasets in object with methylation data (this data is not log transformed and must use normalized values). (default NULL)
How to group cells for plotting (can be any factor column in cell.data or 'none' for plotting all cells in a single plot). Note that this can result in large number of plots. Users are encouraged to use same value as for scale.by (default 'dataset').
Whether to keep dimensional reduction coordinates consistent when multiple plots created (default FALSE).
Point size for plots (default 0.1).
Minimum value for expression values plotted. Can pass in quantile (0-1) or absolute cutoff (set clip.absolute = TRUE). Can also pass in vector if expecting multiple plots; users are encouraged to pass in named vector (from levels of desired feature) to avoid mismatches in order (default NULL).
Maximum value for expression values plotted. Can pass in quantile (0-1) or absolute cutoff (set clip.absolute = TRUE). Can also pass in vector if expecting multiple plots; users are encouraged to pass in named vector (from levels of desired feature) to avoid mismatches in order (default NULL).
Whether to treat clip values as absolute cutoffs instead of quantiles (default FALSE).
Remove axes, background, and legend when plotting coordinates (default FALSE).
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). (default NULL).
Color to use for zero values (no expression) (default '#F5F5F5').
Vector of two strings to use as x and y labels respectively. (default NULL)
Display legend on plots (default TRUE).
Return ggplot objects instead of printing directly (default FALSE).
Maintain min/max color scale across all plots when using plot.by (default FALSE)
Rasterization of points (default NULL). Automatically convert to raster format if there are over 100,000 cells to plot.
ligerex <- createLiger(list(ctrl = ctrl, stim = stim))
ligerex <- normalize(ligerex)
ligerex <- selectGenes(ligerex)
ligerex <- scaleNotCenter(ligerex)
ligerex <- optimizeALS(ligerex, k = 5, max.iter = 1)
ligerex <- quantile_norm(ligerex)
ligerex <- runTSNE(ligerex)
plotGene(ligerex, "CD74", pt.size = 1)
Run the code above in your browser using DataLab