plotHeatmap: Plot numeric variables in a heatmap

View source: R/plot-miscellaneous.R

plotHeatmapR Documentation

Plot numeric variables in a heatmap

Description

This function uses a heatmpa to visualize numeric variables. By specifying the across-argument in combination with the summarize_with- argument the heatmap can visualize not only cellular profiles but summarized profiles of any grouping variable such as cell_line or condition.

Usage

plotHeatmap(
  object,
  variable_names,
  across = "cell_id",
  across_subset = NULL,
  relevel = NULL,
  summarize_with = "mean",
  drop_na = TRUE,
  phase = NULL,
  verbose = TRUE,
  ...
)

Arguments

object

A valid cypro object.

across

Character value, character vector or NULL (see details for more). Specifies the grouping variable of interest.

Use getGroupingVariableNames() to obtain all variable names that group the cells of your experiment in a certain manner.

across_subset

Character vector, list of character vectors or NULL (see details for more). Specifies the particular groups of interest the grouping variable specified in argument across contains.

If set to NULL all of them are chosen. You can prefix groups you are NOT interested in with a '-'. (Saves writing if there are more groups you are interested in than groups you are not interested in.)

Use getGroupNames() to obtain all valid input options.

relevel

Logical value. If set to TRUE the input order of across_subset determines the order in which the groups of interest are displayed. Groups that are not included are dropped which affects the choice of color.

summarize_with

Character value. Denotes the function with which the numeric variables are summarized across groups if across is not specified as 'cell_id' but e.g. 'condition'. One of 'mean', 'median', 'max' 'min'.

phase

Character or numeric. If character, the ordinal value referring to the phase of interest (e.g. 'first', 'second' etc.). referring to the phase of interest or 'all'. If numeric, the number referring to the phase.

If set to NULL takes the phase denoted as default with adjustDefault().

Ignored if the experiment design contains only one phase.

verbose

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

(Warning messages will always be printed.)

...

Addtional arguments given to function pheatmap::pheatmap().

Details

Input for argument across can be 'cell_id' to focus on cells. In this case the summarizing is skipped.

Before visualization all values are rescaled to values from 0 to 1 within their variable for proper color coding.

Value

A heatmap.


theMILOlab/cypro documentation built on April 5, 2022, 2:03 a.m.