add_density_coloring: Color cells using a background density

Description Usage Arguments Value

View source: R/add_density_coloring.R

Description

Color cells using a background density

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
add_density_coloring(
  cell_positions,
  color_density = c("none", "grouping", "feature"),
  trajectory,
  grouping = NULL,
  groups = NULL,
  feature_oi = NULL,
  expression_source = "expression",
  padding = 0.1,
  nbins = 1000,
  bw = 0.2,
  density_cutoff = 0.3,
  density_cutoff_label = density_cutoff/10
)

Arguments

cell_positions

The positions of the cells in 2D. Must be a tibble with character column cell_id and numeric columns comp_1 and comp_2.

color_density

How to color density, can be "none", "grouping", or "feature".

trajectory

A dynwrap trajectory.

grouping

A grouping of the cells (e.g. clustering) as a named character vector.

groups

A tibble containing character columns group_id and color. If NULL, this object is inferred from the grouping itself.

feature_oi

The name of a feature to use for colouring the cells.

expression_source

Source of the feature expression, defaults to get_expression(trajectory).

padding

The padding in the edges to the plot, relative to the size of the plot.

nbins

Number of bins for calculating the density.

bw

Bandwidth, relative to the size of the plot.

density_cutoff

Cutoff for density, the lower the larger the areas.

density_cutoff_label

Cutoff for density for labeling, the lower the further way from cells.

Value

A named list with objects:


dynplot documentation built on Dec. 11, 2021, 9:33 a.m.