plot_heatmap: Plot expression data along a trajectory

Description Usage Arguments Value Examples

View source: R/plot_heatmap.R

Description

NOTE: When using RStudio, the heatmap might not show inside the plot area, but will be visible once you click the 'Zoom' button.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
plot_heatmap(
  trajectory,
  expression_source = "expression",
  features_oi = 20,
  clust = "ward.D2",
  margin = 0.02,
  color_cells = NULL,
  milestones = NULL,
  milestone_percentages = trajectory$milestone_percentages,
  grouping = NULL,
  groups = NULL,
  cell_feature_importances = NULL,
  heatmap_type = c("tiled", "dotted"),
  scale = dynutils::scale_quantile,
  label_milestones = TRUE
)

Arguments

trajectory

A dynwrap trajectory.

expression_source

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

features_oi

The features of interest, either the number of features or a vector giving the names of the different features

clust

The method to cluster the features, or a hclust object

margin

A margin between trajectory segments.

color_cells

How to color the cells.

  • "auto": Try to figure out how to color cells depending on whether one of the grouping, feature_io, milestones or pseudotime parameters are defined.

  • "none": Cells are not coloured.

  • "grouping": Cells are coloured according to a grouping (e.g. clustering). Either the grouping parameter or trajectory$grouping must be a named character vector.

  • "feature": Cells are coloured according to the values of a given feature (e.g. gene expression). Either the expression_source parameter or get_expression(trajectory) must be a matrix. Parameter feature_oi must also be defined.

  • "milestone" (recommended): Cells are coloured according their position in the trajectory. The positioning of the cells are determined by parameter milestone_percentages or else by trajectory$milestone_percentages. The colours of the milestones can be determined automatically or can be specified by passing a tibble containing character columns milestone_id and color (See add_milestone_coloring() for help in constructing this object).

  • "pseudotime": Cells are coloured according to the pseudotime value from the root.

milestones

Tibble containing the column milestone_id (character). If color_milestones is set to "given", this tibble should also contain a column color (character), containing colour hex codes (e.g. "#123456").

milestone_percentages

The milestone percentages.

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.

cell_feature_importances

The importances of every feature in every cell, as returned by dynfeature::calculate_cell_feature_importance()

heatmap_type

The type of heatmap, either tiled or dotted

scale

Whether to rescale the expression, can be a function or boolean

label_milestones

How to label the milestones. Can be TRUE (in which case the labels within the trajectory will be used), "all" (in which case both given labels and milestone_ids will be used), a named character vector, or FALSE

Value

A heatmap ggplot of an expression dataset with trajectory.

Examples

1
2

dynverse/dynplot documentation built on Dec. 12, 2021, 9:39 p.m.