Plot heatmap showing proportions
plot_prop_heatmap.Rd
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. Useforce = TRUE
to skip this behavior (no default)- prop_margin
NUMERIC : parameter to be passed to
margin
parameter ofprop.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 inComplexHeatmap::Heatmap
function (default tocolnames(df)[1]
)- column_title
CHARACTER : a character to be passed to
column_title
parameter inComplexHeatmap::Heatmap
function (default tocolnames(df)[2]
)- cluster_rows
LOGICAL : to be passed to
cluster_rows
parameter inComplexHeatmap::Heatmap
function (default to FALSE)- cluster_columns
LOGICAL : to be passed to
cluster_columns
parameter inComplexHeatmap::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 orrow_names_gp
parameter
Value
This function returns a heatmap, made with ComplexHeatmap::Heatmap
function