plotTrajectoryHeatmap: Plot trajectory expression dynamic in heatmap

View source: R/plotT-Z.R

plotTrajectoryHeatmapR Documentation

Plot trajectory expression dynamic in heatmap

Description

Displays variable-expression values along a trajectory direction with a smoothed heatmap (from left to right).

Usage

plotTrajectoryHeatmap(
  object,
  id,
  variables,
  binwidth = getCCD(object),
  n_bins = NA_integer_,
  arrange_rows = "none",
  colors = NULL,
  method_gs = NULL,
  show_rownames = NULL,
  show_colnames = NULL,
  split_columns = NULL,
  smooth_span = NULL,
  multiplier = 10,
  with_ggplot = TRUE,
  display_parts_with = "lines",
  line_alpha = 1,
  line_color = "red",
  line_size = 1,
  line_type = "dashed",
  clrsp = NULL,
  .f = NULL,
  .cols = dplyr::everything(),
  summarize_with = "mean",
  verbose = NULL,
  ...
)

Arguments

object

An object of class spata2.

variables

The variables of interest specified as a character vector:

  • Gene sets: Must be in getGeneSets()

  • Genes: Must be in getGenes()

All elements of the specified character vector must either belong to gene sets or to genes.

binwidth

Numeric value. Denotes the binwidth with which to sort all relevant barcode spots into groups that are then aligned with respect to the chosen trajectory's direction.#'

n_bins

Numeric value. Specifies the exact number of bins the barcodes are binned into.

arrange_rows

Alter the way the rows of the heatmap are displayed in order to highlight patterns. Currently either 'maxima', 'minima' or 'input'. If 'input', variables are displayed in the same order as they are provided in the argument variables.

colors

A vector of colors to be used.

method_gs

Character value. The method according to which gene sets will be handled specified as a character of length one. This can be either 'mean or one of 'gsva', 'ssgsea', 'zscore', or 'plage'. The latter four will be given to gsva::GSVA().

show_rownames

Logical. If set to TRUE the variable elements will be displayed at the rownames of the heatmap.

split_columns

Logial. If set to TRUE the heatmap is vertically splitted according to the trajectory parts.

smooth_span

Numeric value. Controls the degree of smoothing. Given to argument span of stats::loess().

multiplier

Numeric value. For better visualization the transient pattern is smoothed with a loess fit. The total number of predicted values (via stats::predict()) is the number of bins multiplied with the input for this argument.

with_ggplot

Logical value. If set to TRUE the heatmap is plotted with ggplot2::geom_tile() and a ggplot is returned.

display_parts_with

Character value. Either 'facets' or 'lines'.

line_alpha

Numeric value. Specifies the transparency of the lines.

line_color

Character. Affects color of the main lines of the plot.

line_size

Numeric. Affects size of the main lines of the plot.

line_type

Character. The line type. One of 'blank', 'solid', 'dashed', 'dotted', 'dotdash', 'longdash' and 'twodash'.

clrsp

Character value. Specifies the color spectrum to be used to represent continuous values of numeric variables. Run validColorSpectra() to obtain valid input options.

summarize_with

Character value. Name of the function with which to summarize.

verbose

Logical. If set to TRUE informative messages regarding the computational progress will be printed.

(Warning messages will always be printed.)

...

Additional parameters given to pheatmap::pheatmap(). If argument with_ggplot is TRUE given to scale_color_add_on().

display_trajectory_parts

Logical value. If TRUE and the trajectory contains more than one part the parts are displayed by facetting the plot or by adding vertical lines.

Value

A heatmap of class 'pheatmap' or a ggplot.


kueckelj/SPATA2 documentation built on March 16, 2024, 10:25 a.m.