gcc.heatmap: heat map

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/rsgcc.R

Description

The heat map is a color imange representing the data in the a matrix. The dendrogram information are usually added to the left side and/or to the top for displaying the clustering information.

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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
gcc.heatmap(x, 
      cpus = 1, 
      method = c("GCC", "PCC", "SCC", "KCC", "BiWt", "MI", "MINE", "ED"), 
      distancemethod = c("Raw", "Abs", "Sqr"), 
      clustermethod = c("complete", "average", "median", 
                        "centroid", "mcquitty", "single", "ward"), 
  
      #hcdata output by gcc.tsheatmap function
      rowhcdata = NULL, 
      colhcdata = NULL, 

      keynote = "FPKM", 

      ## dendrogram control
      symm = FALSE, 
      Rowv = TRUE, 
      Colv = if (symm) "Rowv" else TRUE, 
      dendrogram = c("both", "row", "column", "none"), 

      ## data scaling
      scale = c("none", "row", "column"), 
      na.rm = TRUE, 
      revC = identical(Colv, "Rowv"), 
      add.expr, 

      #break points for binning values in x
      breaks = 16, 
      quanbreaks = TRUE, 
      symbreaks = min(x < 0, na.rm = TRUE) || scale != "none",

      #colors 
      colrange = c("green", "black", "red"), 

      colsep, 
      rowsep,
      sepcolor = "white", 
      sepwidth = c(0.05, 0.05), 
      cellnote, 
      notecex = 1, 
      notecol = "cyan", 
      na.color = par("bg"), 
      trace = c("none", "column", "row", "both"), 
      tracecol = "cyan", 
      hline = median(breaks), 
      vline = median(breaks), 
      linecol = tracecol, 
      margins = c(5, 5), 
      ColSideColors, 
      RowSideColors, 
      cexRow = 0.2 + 1/log10(dim(x)[1]), 
      cexCol = 0.2 + 1/log10(dim(x)[2]), 
      labRow = NULL, 
      labCol = NULL, 

      #color key
      key = TRUE, 
      keysize = 0.65, 
      density.info = c("none", "histogram", "density"), 
      denscol = tracecol, 
      symkey = min(x < 0, na.rm = TRUE) || symbreaks, 
      densadj = 0.25, 

      #image information
      main = NULL, 
      xlab = NULL, 
      ylab = NULL, 
      lmat = NULL, 
      lhei = NULL, 
      lwid = NULL, 
      ...)

Arguments

x

a data matrix containing numeric variables. Example: rows may correspond to genes and columns to samples.

cpus

the number of cpus used for correlaiton calcluation. snowfall package in R needed to be installed in advance.

method

a character string that specifies a correlation method to be used for association calculation.

distancemethod

a character string specifying the distance method to be used. Currently, three distance methods are available, include: "Raw" (1-cor)", "Abs" (1-|cor|), and "Sqr" (1-|cor|^2).

clustermethod

the distance measure to be used. This must be one of "complete", "average", "median", "centroid", "mcquitty", "single", or "ward".

rowhcdata

the object of class hc generated from gcc.hclust for rows in x.

colhcdata

the object of class hc generated from gcc.hclust for columns in x.

keynote

a character string indicating the lable of color key.

symm

logical indicating if x should be treated as a symmetrical matrix.

Rowv

logical determining if the row dendrogram should be reordered.

Colv

logical determining if the columns dendrogram should be reordered.

dendrogram

a character string indicating whether to draw the "none", "row", "column", "both" dendrograms.

scale

a character string specifying if the data values would be centered and scaled by rows or by columns, or none.

na.rm

logical indicating whether the Nas should be eliminated.

revC

logical indicating if the column order should be reversed for plotting.

add.expr

expression that will be evaluated after the call to image. Can be used to add components to the plot.

breaks

(optional)Either a integer number specifying the break points to be used, or a numeric vector indicating the splitting points for binning x into colors.

quanbreaks

logical indicating if the splitting points for binning x in quantile scale. For instance, if quanbreaks is TRUE, the breaks would be quantile( unique(c(x)), probs = seq(0, 1, length = breaks), na.rm = TRUE).

symbreaks

Boolean indicating whether breaks should be made symmetric about 0. This option works when the quanbreaks is FALSE.

colrange

colors used for the image. It could be a function(i.e., heat.colors) or a vector of colors with at leat two elements (e.g., c("green", "black", "red")).

colsep

(optional) vectors of integers indicating which columns should be seperated from the preceding columans by a narrow space of color sepcor.

rowsep

(optional) vectors of integers indicating which rows should be seperated from the preceding rows by a narrow space of color sepcor.

sepcolor

(optional) color used to seperate rows or columns.

sepwidth

(optional) A numeric vector containing two elements giving the width (colsep) or height (rowsep) for the seperation of columns or rows.

cellnote

(optional)a matrix of character strings which will be placed within each color cell.

notecex

(optional)numeric scaling factor for cellnot itmes.

notecol

(optional)character string specifying the color of cellnote text. Default to "green".

na.color

color to be used for missing value (NA). Defaults to the plot background color.

trace

character string indicating a solid "trace" lined should be drawn across "rows", or "column", or "both" or "none".

tracecol

color for trace

hline

vector of values whithin cells where horizontal lines should be drawn with line col.

vline

vector of values whithin cells where vertical lines should be drawn with line col.

linecol

color for hline and vline.

margins

a numeric vector containing 2 elements specifying the margins for column and row names, respectively. See (par(mar=*)).

ColSideColors

(optional)character string of colors for annotating the columns of heat map.

RowSideColors

(optional)character string of colors for annotating the rows of heat map.

cexRow

cex.axis for the row lables.

cexCol

cex.axis for the column lables.

labRow

character strings indicating the lables of rows. Default to rownames(x)

labCol

character strings indicating the lables of columns. Default to colnames(x)

key

logical indicating whether the color key would be draw.

keysize

numeric value specifying the size of color key.

density.info

character string indicating whether to superimpose a "histogram", a "density" plot, or not plot("none") on the color-key.

denscol

character string giving the color for the density display specified by density.info, defaults to the same value as tracecol.

symkey

Boolean indicating whether the color key should be made symmetric about 0. Defaults to TRUE if the data includes negative values and to FALSE otherwise.

densadj

Numeric scaling value for tuning the kernel width when a density plot is drawn on the color key. Default to 0.25.

main

main title. defaults to none.

xlab

x-axis label. defaults to none.

ylab

y-axis label. defaults to none.

lmat

position matrix for visual layout. See details from the help page of heatmap.2.

lhei

column height for visual layout. See details from the help page of heatmap.2

lwid

column width for visual layout. See details from the help page of heatmap.2

...

additonal arguments passed on to image.

Details

This function plots the heat map of microarray and RNA-Seq gene expression data by modifying the scripts of heatmap.2 in R. The main modifications include: (1) designing several distance measures derived from Gini correlation and other correlation methods; (2) providing the option of quanbreaks for RNA-Seq data.

Value

A list with the following components:

retval

a list with components of "rowInd" (row index of heat map from x), "colInd" (column index of heat map from x), "call" (the match call), "carpet" (reordered and scaled 'x' values used generate the main 'carpet'), "rowDendrogram" (row dendrogram), "colDendrogram" (column dendrogram), "breaks" (break points for binning x), "col" (colors used), and "colorTable" (a data frame providing the lower and upper bound and color for each bin).

hcr

the values returned from gcc.hclust function for clustering individuals (e.g., genes) in row direction

hcc

the values returned from gcc.hclust function for clustering individuals (e.g., genes) in column direction

Note

This function clusters microarray and RNA-Seq gene expression data and plot heatmap by refining heatmap.2 function in gplots package. Therefore, most parameters and output values are defined similarly as those in heatmap.2.

Author(s)

Chuang Ma, Xiangfeng Wang

See Also

gcc.dist, cor.matrix, gcc.hclust, gcc.tsheatmap.

Examples

1
2
3
4
5
6
7
8
## Not run: 
   data(rsgcc)
   x <- rnaseq[1:50,]
   ghm <- gcc.heatmap(x, cpus = 1, method = "GCC", 
               distancemethod = "Raw", clustermethod = "complete", labRow = "")

## End(Not run)
  

rsgcc documentation built on May 2, 2019, 9:25 a.m.