Skip to contents

Bins cells into hexagons and colors them proportionally to their group label.

Usage

plot_hex_biMAP(
  obj,
  meta_df = NULL,
  color_by = "cluster",
  gene_size = 2,
  cell_alpha = 0.8,
  gene_alpha = 0.8,
  hex_n = 40,
  min_bin = 2,
  show_density = FALSE,
  color_genes = TRUE,
  label_groups = TRUE,
  group_label_size = 4,
  label_marker_genes = FALSE,
  interactive = FALSE,
  ...
)

# S4 method for caclust
plot_hex_biMAP(
  obj,
  meta_df = NULL,
  color_by = "cluster",
  gene_size = 2,
  cell_alpha = 0.8,
  gene_alpha = 0.8,
  hex_n = 40,
  min_bin = 2,
  show_density = FALSE,
  color_genes = TRUE,
  label_groups = TRUE,
  group_label_size = 4,
  label_marker_genes = FALSE,
  interactive = FALSE,
  ...
)

# S4 method for SingleCellExperiment
plot_hex_biMAP(
  obj,
  meta_df = NULL,
  color_by = "cluster",
  gene_size = 2,
  cell_alpha = 0.8,
  gene_alpha = 0.8,
  hex_n = 40,
  min_bin = 2,
  show_density = FALSE,
  color_genes = TRUE,
  label_groups = TRUE,
  group_label_size = 4,
  label_marker_genes = FALSE,
  interactive = FALSE,
  ...,
  caclust_meta_name = "caclust",
  subset = FALSE
)

Arguments

obj

Object that stores biMAP coordinates. Can be either a "caclust" object or of class "SingleCellExperiment".

meta_df

optional. data.frame that should have either gene or cell names (or both) as rownames or a column named `name` and a column with the same name as `color_by`.

color_by

Either "type" or "cluster". "type" colors by the type (cell or gene) while "cluster" colors by the assigned cluster. If meta_df is provided a column from the data.frame can be specified.

gene_size

integer. Size of the genes in the plot.

cell_alpha

numeric. Alpha value of cells (between 0 and 1).

gene_alpha

numeric. Alpha value of genes (between 0 and 1).

hex_n

integer. Number of hexagonal bins that partition the x-axis.

min_bin

integer. Only bins with more than `min_bin` cells are plotted.

show_density

logical. Should the alpha value for plot type "hex" be adjusted by the number of cells in the bin?

color_genes

logical. If TRUE colors genes by color_by.

label_groups

logical. If TRUE puts the group label on the median coordinates of the point.

group_label_size

integer. Size of the group label.

label_marker_genes

logical or character vector. If TRUE, names of detected marker genes are displayed. If is character vector, the given marker genes are labeled.

interactive

If TRUE plot_scatter_biMAP returns an interactive (html) plot. If FALSE a ggplot object is returned.

...

Further arguments

caclust_meta_name

Name under which the caclust object is stored in the metadata of the SingleCellExperiment object.

subset

Whether the biMAP embedding should be subset to the cells/genes in the SCE object. This might lead to unintended results. If unsure, we recommend to rerun CA and caclust instead.

Value

hex-plot biMAP as a ggplot.

See also

Other plot_*_biMAP: plot_contour_biMAP(), plot_scatter_biMAP()