Standard and modified version of LIGER's plotByDatasetAndCluster

DimPlot_LIGER(
  liger_object,
  group_by = NULL,
  split_by = NULL,
  colors_use_cluster = NULL,
  colors_use_meta = NULL,
  pt_size = NULL,
  shuffle = TRUE,
  shuffle_seed = 1,
  reduction_label = "UMAP",
  reduction = NULL,
  aspect_ratio = NULL,
  label = TRUE,
  label_size = NA,
  label_repel = FALSE,
  label_box = FALSE,
  label_color = "black",
  combination = FALSE,
  raster = NULL,
  raster.dpi = c(512, 512),
  num_columns = NULL,
  ggplot_default_colors = FALSE,
  color_seed = 123
)

Arguments

liger_object

liger liger_object. Need to perform clustering before calling this function

group_by

Variable to be plotted. If NULL will plot clusters from liger@clusters slot. If combination = TRUE will plot both clusters and meta data variable.

split_by

Variable to split plots by.

colors_use_cluster

colors to use for plotting by clusters. By default if number of levels plotted is less than or equal to 36 will use "polychrome" and if greater than 36 will use "varibow" with shuffle = TRUE both from DiscretePalette_scCustomize.

colors_use_meta

colors to use for plotting by meta data (cell.data) variable. By default if number of levels plotted is less than or equal to 36 it will use "polychrome" and if greater than 36 will use "varibow" with shuffle = TRUE both from DiscretePalette_scCustomize.

pt_size

Adjust point size for plotting.

shuffle

logical. Whether to randomly shuffle the order of points. This can be useful for crowded plots if points of interest are being buried. (Default is TRUE).

shuffle_seed

Sets the seed if randomly shuffling the order of points.

reduction_label

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". (only valid for rliger < 2.0.0).

reduction

specify reduction to use when plotting. Default is current object default reduction (only valid for rliger v2.0.0 or greater).

aspect_ratio

Control the aspect ratio (y:x axes ratio length). Must be numeric value; Default is NULL.

label

logical. Whether or not to label the clusters. ONLY applies to plotting by cluster. Default is TRUE.

label_size

size of cluster labels.

label_repel

logical. Whether to repel cluster labels from each other if plotting by cluster (if group_by = NULL or group_by = "cluster). Default is FALSE.

label_box

logical. Whether to put a box around the label text (uses geom_text vs geom_label). Default is FALSE.

label_color

Color to use for cluster labels. Default is "black".

combination

logical, whether to return patchwork displaying both plots side by side. (Default is FALSE).

raster

Convert points to raster format. Default is NULL which will rasterize by default if greater than 200,000 cells.

raster.dpi

Pixel resolution for rasterized plots, passed to geom_scattermore(). Default is c(512, 512).

num_columns

Number of columns in plot layout. Only valid if split.by != NULL.

ggplot_default_colors

logical. If colors_use = NULL, Whether or not to return plot using default ggplot2 "hue" palette instead of default "polychrome" or "varibow" palettes.

color_seed

random seed for the "varibow" palette shuffle if colors_use = NULL and number of groups plotted is greater than 36. Default = 123.

Value

A ggplot/patchwork object

Examples

if (FALSE) {
DimPlot_LIGER(liger_object = obj_name, reduction_label = "UMAP")
}