Modified and optimized version of plotFactors
function from LIGER package.
plotFactors_scCustom(
liger_object,
num_genes = 8,
colors_use_factors = NULL,
colors_use_dimreduc = c("lemonchiffon", "red"),
pt.size_factors = 1,
pt.size_dimreduc = 1,
reduction_label = "UMAP",
plot_legend = TRUE,
raster = TRUE,
raster.dpi = c(512, 512),
order = FALSE,
plot_dimreduc = TRUE,
save_plots = TRUE,
file_path = NULL,
file_name = NULL,
return_plots = FALSE,
cells.highlight = NULL,
reorder_datasets = NULL,
ggplot_default_colors = FALSE,
color_seed = 123
)
liger
liger_object. Need to perform clustering and factorization before calling this function
Number of genes to display for each factor (Default 8).
colors to use for plotting factor loadings By default datasets will be
plotted using "varibow" with shuffle = TRUE from both from DiscretePalette_scCustomize
.
colors to use for plotting factor loadings on dimensionality reduction coordinates (tSNE/UMAP). Default is c('lemonchiffon', 'red'),
Adjust point size for plotting in the factor plots.
Adjust point size for plotting in dimensionality reduction plots.
What to label the x and y axes of resulting plots. LIGER does not store name of technique and therefore needs to be set manually. Default is "UMAP".
logical, whether to plot the legend on factor loading plots, default is TRUE. Helpful if number of datasets is large to avoid crowding the plot with legend.
Convert points to raster format. Default is NULL which will rasterize by default if greater than 200,000 cells.
Pixel resolution for rasterized plots, passed to geom_scattermore(). Default is c(512, 512).
logical. Whether to plot higher loading cells on top of cells with lower loading values in the dimensionality reduction plots (Default = FALSE).
logical. Whether to plot factor loadings on dimensionality reduction coordinates. Default is TRUE.
logical. Whether to save plots. Default is TRUE
directory file path and/or file name prefix. Defaults to current wd.
name suffix to append after sample name.
logical. Whether or not to return plots to the environment. (Default is FALSE)
Names of specific cells to highlight in plot (black) (default NULL).
New order to plot datasets in for the factor plots if different from current factor level order in cell.data slot.
logical. If colors_use_factors = NULL
, Whether or not to return plot using
default ggplot2 "hue" palette instead of default "varibow" palette.
random seed for the palette shuffle if colors_use_factors = NULL
. Default = 123.
A list of ggplot/patchwork objects and/or PDF file.
Based on plotFactors
functionality from original LIGER package.
if (FALSE) {
plotFactors_scCustom(liger_object = liger_obj, return_plots = FALSE, plot_dimreduc = TRUE,
raster = FALSE, save_plots = TRUE)
}