plotMiss: Missing value plot

View source: R/plotMiss.R

plotMissR Documentation

Missing value plot

Description

Visualizes missing values with a SummarizedExperiment object or matrix of intensity data where rows represent features and columns represent samples. All values in a data matrix are re-coded (1: missing; 0: non-missing). The left panel displays the amount of missing values in each samples. The right panel displays the pattern of missing values using a heatmap with dendrograms.

Usage

plotMiss(
  x,
  i,
  group,
  dendrogram_row = TRUE,
  dendrogram_col = FALSE,
  colors = (scales::viridis_pal())(2),
  hide_colorbar = TRUE,
  showticklabels = c(TRUE, FALSE),
  row_dend_left = FALSE,
  k_row = 1,
  k_col = 1,
  ...
)

Arguments

x

A matrix-like object or SummarizedExperiment object.

i

A string or integer value specifying which assay values to use when x is a SummarizedExperiment object.

group

A discrete variable to change colors of the barplot by sample groups.

dendrogram_row

A logical specifying whether dendogram is computed and reordering is performed based on rows.

dendrogram_col

A logical specifying whether dendogram is computed and reordering is performed based on columns.

colors

A vector of colors for the heatmap.

hide_colorbar

A logical specifying whether the color bar (legend) in the heatmap is hidden.

showticklabels

A logical vector of length 2 (x-axis, y-axis) specifying whether the ticks are removed from the sides of the heatmap.

row_dend_left

A logical controlling whether the row dendrogram is placed on the left on the heatmap.

k_row

A numeric value specifying the desired number of groups by which to color the dendrogram's branches in the rows. If NA, then dendextend::find_k is used to deduce the optimal number of clusters.

k_col

A numeric value specifying the desired number of groups by which to color the dendrogram's branches in the columns. If NA, then dendextend::find_k is used to deduce the optimal number of clusters.

...

Additional arguments passed to heatmaply::heatmaply.

Value

A patchwork object of aligned ggplots

References

Tal Galili, Alan O'Callaghan, Jonathan Sidi, Carson Sievert; heatmaply: an R package for creating interactive cluster heatmaps for online publishing, Bioinformatics, btx657, https://doi.org/10.1093/bioinformatics/btx657

Examples


data(faahko_se)

## Sample group
g <- colData(faahko_se)$sample_group

## SummarizedExperiment object
plotMiss(faahko_se, i = 1, group = g)

## Matrix
m <- assay(faahko_se, i = 1)
plotMiss(m, group = g, dendrogram_col = TRUE)


HimesGroup/qmtools documentation built on April 16, 2023, 8 p.m.