consensusHeatmap: Heatmap of top consensus gene sets

View source: R/consensusHeatmap.R

consensusHeatmapR Documentation

Heatmap of top consensus gene sets

Description

Based on multiple result objects from the runGSA function, this function computes the consensus scores, based on rank aggregation, for each directionality class and produces a heatmap plot of the results.

Usage

consensusHeatmap(
  resList,
  method = "median",
  cutoff = 5,
  adjusted = FALSE,
  plot = TRUE,
  ncharLabel = 25,
  cellnote = "consensusScore",
  columnnames = "full",
  colorkey = TRUE,
  colorgrad = NULL,
  cex = NULL
)

Arguments

resList

a list where each element is an object of class GSAres, as returned by the runGSA function.

method

a character string selecting the method, either "mean", "median", "Borda" or "Copeland".

cutoff

the maximum consensus score of a gene set, in any of the directionality classes, to be included in the heatmap.

adjusted

a logical, whether to use adjusted p-values or not. Note that if runGSA was run with the argument adjMethod="none", the adjusted p-values will be equal to the original p-values.

plot

whether or not to draw the heatmap. Setting plot=FALSE allows you to save the heatmap as a matrix without plotting it.

ncharLabel

the number of characters to include in the row labels.

cellnote

a character string selecting the information to be printed inside each cell of the heatmap. Either "consensusScore", "medianPvalue", "nGenes" or "none". Note that the actual heatmap will always be based on the consensus scores.

columnnames

either "full" (default) or "abbr" to use full or abbreviated column labels. Will save some space for the heatmap if set to "abbr"

colorkey

a logical (default TRUE), whether or not to display the colorkey. Will save some space for the heatmap if turned off.

colorgrad

a character vector giving the color names to use in the heatmap.

cex

a numeric, to control the text size.

Details

This function computes the consensus gene set scores for each directionality class based on the results (gene set p-values) listed in resList, using the consensusScores function. For each class, only the GSAres objects in resList that contain p-values for that class are used as a basis for the rank aggregation. Hence, if not all classes are covered by at least 2 GSAres objects in the list, the consensusHeatmap function will not work. The results are displayed in a heatmap showing the consensus scores.

Value

A list, returned invisibly, containing the matrix of consensus scores as represented in the heatmap as well as the matrix of corresponding median p-values and the matrix of number of genes in each gene set (inlcuding the subset of up and down regulated genes for the mixed directional classes).

Author(s)

Leif Varemo piano.rpkg@gmail.com and Intawat Nookaew piano.rpkg@gmail.com

See Also

piano, runGSA

Examples



   # Load some example GSA results:
   data(gsa_results)
   
   # Consensus heatmap:
   dev.new(width=10,height=10)
   consensusHeatmap(resList=gsa_results)
   
   # Store the output:
   dev.new(width=10,height=10)
   ch <- consensusHeatmap(resList=gsa_results)
   
   # Access the median p-values for gene set s1:
   ch$pMat["s1",]


varemo/piano documentation built on Sept. 19, 2022, 12:01 p.m.