plotContrastHeatmap: Plot heatmaps showing significant genes per contrast

plotContrastHeatmap,ClusterExperiment-methodR Documentation

Plot heatmaps showing significant genes per contrast

Description

Plots a heatmap of the data, with the genes grouped based on the contrast for which they were significant.

Usage

## S4 method for signature 'ClusterExperiment'
plotContrastHeatmap(
  object,
  signifTable,
  whichCluster = NULL,
  contrastColors = NULL,
  ...
)

Arguments

object

ClusterExperiment object on which biomarkers were found

signifTable

A data.frame in format of the result of getBestFeatures. It must minimally contain columns 'Contrast' and 'IndexInOriginal' giving the grouping and original index of the features in the assay(object)

whichCluster

if not NULL, indicates cluster used in making the significance table. Used to match to colors in clusterLegend(object) (relevant for one-vs-all contrast so that color aligns). See description of argument in getClusterIndex for futher details.

contrastColors

vector of colors to be given to contrasts. Should match the name of the contrasts in the 'Contrast' column of signifTable or 'ContrastName', if given.. If missing, default colors given by match to the cluster names of whichCluster (see above), or otherwise given a default assignment.

...

Arguments passed to plotHeatmap

Details

If the column 'ContrastName' is given in signifTable, these names will be used to describe the contrast in the legend.

Within each contrast, the genes are sorted by log fold-change if the column "logFC" is in the signifTable data.frame

Note that if whichCluster is NOT given (the default) then there is no automatic match of colors with contrasts based on the information in object.

Value

A heatmap is created. The output of plotHeatmap is returned.

See Also

plotHeatmap, makeBlankData, getBestFeatures

Examples

data(simData)

cl <- clusterSingle(simData, subsample=FALSE,
sequential=FALSE, 
mainClusterArgs=list(clusterFunction="pam", clusterArgs=list(k=8)))

#Do all pairwise, only return significant, try different adjustments:
pairsPerC <- getBestFeatures(cl, contrastType="Pairs", number=5,
p.value=0.05, DEMethod="limma")
plotContrastHeatmap(cl,pairsPerC)

epurdom/clusterCells documentation built on April 28, 2024, 8:14 p.m.