Plot heatmap showing proportions
plot_prop_heatmap.RdThis 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 = TRUEto skip this behavior (no default)- prop_margin
NUMERIC : parameter to be passed to
marginparameter ofprop.tablefunction (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_titleparameter inComplexHeatmap::Heatmapfunction (default tocolnames(df)[1])- column_title
CHARACTER : a character to be passed to
column_titleparameter inComplexHeatmap::Heatmapfunction (default tocolnames(df)[2])- cluster_rows
LOGICAL : to be passed to
cluster_rowsparameter inComplexHeatmap::Heatmapfunction (default to FALSE)- cluster_columns
LOGICAL : to be passed to
cluster_columnsparameter inComplexHeatmap::Heatmapfunction (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::Heatmapfunction, such as annotation orrow_names_gpparameter
Value
This function returns a heatmap, made with ComplexHeatmap::Heatmap function