Skip to contents

This function plots a heatmap showing the result of prop.table(table(...)). Currently, this is used to represent the proportions of cells in each cluster, from sample of origin, in scRNA-Seq data. The input correspond to a dataframe with two columns, which are put in table function.

Usage

plot_prop_heatmap(
  df,
  prop_margin = NULL,
  color_prop = aquarius::palette_BlWhRd,
  row_title = NULL,
  column_title = NULL,
  cluster_rows = FALSE,
  cluster_columns = TRUE,
  force = FALSE,
  ...
)

Arguments

df

DATAFRAME : a dataframe with only two columns. The function will make a prop.table(table(...)) on this dataframe. First column will be represented in the heatmap as rows, and second one as columns. Both columns will be coerce as factor. To prevent coercion of continuous numeric value, the function will output an error if more than 100 levels are found. Use force = TRUE to skip this behavior (no default)

prop_margin

NUMERIC : parameter to be passed to margin parameter of prop.table function (default to NULL)

color_prop

VECTOR : a vector of color to fill the heatmap with (default to aquarius::palette_BlWhRd)

row_title

CHARACTER : a character to be passed to row_title parameter in ComplexHeatmap::Heatmap function (default to colnames(df)[1])

column_title

CHARACTER : a character to be passed to column_title parameter in ComplexHeatmap::Heatmap function (default to colnames(df)[2])

cluster_rows

LOGICAL : to be passed to cluster_rows parameter in ComplexHeatmap::Heatmap function (default to FALSE)

cluster_columns

LOGICAL : to be passed to cluster_columns parameter in ComplexHeatmap::Heatmap function (default to TRUE)

force

LOGICAL : whether to force doing the heatmap in case there are more than 100 levels in factors (default to FALSE)

...

other settings to be passed to ComplexHeatmap::Heatmap function, such as annotation or row_names_gp parameter

Value

This function returns a heatmap, made with ComplexHeatmap::Heatmap function