morpheus: Morpheus heat map widget

Description Usage Arguments See Also Examples

View source: R/morpheus.R

Description

Creates a morpheus.js-based heat map widget.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
morpheus(x, 
  labRow = rownames(x), 
  labCol = colnames(x),
  # dendrogram control 
  Rowv = TRUE,
  Colv = if (symm) "Rowv" else TRUE, 
  distfun = dist, hclustfun = hclust,
  dendrogram = c("both", "row", "column", "none"), 
  reorderfun = function(d, w) reorder(d, w), 
  symm = FALSE, 
  # plot 
  na.rm = TRUE, 
  rowAnnotations = NULL,
  columnAnnotations = NULL, 
  colorScheme = NULL,
  rowSize = 13,
  columnSize = 13,
  drawGrid = TRUE,
  gridColor = "#808080",
  gridThickness = 0.1,
  drawValues = FALSE,
  width = NULL, 
  height = NULL,
  ...)

Arguments

x

numeric matrix of the values to be plotted.

labRow

character vector with row labels to use (optional, defaults to rownames(x))

labCol

character vector with column labels to use (optional, defaults to colnames(x))

Rowv

determines if and how the row dendrogram should be reordered. By default, it is TRUE, which implies dendrogram is computed and reordered based on row means. If NULL or FALSE, then no dendrogram is computed and no reordering is done. If a dendrogram, then it is used "as-is", ie without any reordering. If a vector of integers, then dendrogram is computed and reordered based on the order of the vector.

Colv

determines if and how the column dendrogram should be reordered. Has the options as the Rowv argument above and additionally when x is a square matrix, Colv="Rowv" means that columns should be treated identically to the rows.

distfun

function used to compute the distance (dissimilarity) between both rows and columns. Defaults to dist.

hclustfun

function used to compute the hierarchical clustering when Rowv or Colv are not dendrograms. Defaults to hclust.

dendrogram

character string indicating whether to draw "none", "row", "column" or "both" dendrograms. Defaults to "both". However, if Rowv (or Colv) is FALSE or NULL and dendrogram is "both", then a warning is issued and Rowv (or Colv) arguments are honoured.

reorderfun

function(d, w) of dendrogram and weights for reordering the row and column dendrograms. The default uses stats{reorder.dendrogram}.

symm

logical indicating if x should be treated symmetrically; can only be true when x is a square matrix.

na.rm

logical indicating whether NA's should be removed.

rowAnnotations

Data frame of additional row annotations in same order as x (optional)

columnAnnotations

Data frame of additional column annotations in same order as x (optional)

colorScheme

List of scalingMode ("fixed" or "relative"), stepped (Whether color scheme is continuous (FALSE) or discrete (TRUE)), values (list of numbers corresponding to colors), colors (list of colors)

rowSize

Heat map column size in pixels or "fit" to fit heat map to current height (optional, defaults to 13)

columnSize

Heat map column size in pixels or "fit" to fit heat map to current width (optional, defaults to 13)

drawGrid

Whether to draw heat map grid (optional, defaults to TRUE)

gridColor

Heat map grid color (optional, defaults to "#808080")

gridThickness

Heat map grid thickness (optional, defaults to 0.1)

drawValues

Whether to draw values in the heat map (optional, defaults to FALSE)

width

Heat map width (optional, defaults to available width)

height

Heat map height (optional, defaults to available height)

...

Additional morpheus options as documented at https://software.broadinstitute.org/morpheus/configuration.html

See Also

heatmap, heatmap.2

Examples

1
2
3
4
5
6
7
8
9
library(morpheus)
x <- t(mtcars)
columnAnnotations <- data.frame(annotation1=1:32, annotation2=sample(LETTERS[1:3], ncol(x),
  replace = TRUE))
morpheus(x,
  colorScheme=list(scalingMode="relative", colors=heat.colors(3)),
  columnAnnotations=columnAnnotations,
  columns=list(list(field='id', display=list('text')), list(field='annotation2',
   highlightMatchingValues=TRUE, display=list('color'))))

cmap/morpheus.R documentation built on Oct. 26, 2020, 3:39 p.m.