plotDendrogram: Plot dendrogram of clusterExperiment object

Description Usage Arguments Details Examples

Description

Plots the dendrogram saved in a clusterExperiment object

Usage

1
2
3
4
## S4 method for signature 'ClusterExperiment'
plotDendrogram(x, whichClusters = "dendro",
  leafType = c("clusters", "samples"), labelType = c("name", "colorblock",
  "ids"), main, sub, removeOutbranch = TRUE, legend = "side", ...)

Arguments

x

a ClusterExperiment object.

whichClusters

only used if leafType="samples"). If numeric, an index for the clusterings to be plotted with dendrogram. Otherwise, whichClusters can be a character value identifying the clusterTypes to be used, or if not matching clusterTypes then clusterLabels; alternatively whichClusters can be either 'all' or 'workflow' or 'primaryCluster' to indicate choosing all clusters or choosing all workflowClusters. Default 'dendro' indicates using the clustering that created the dendrogram.

leafType

if "samples" the dendrogram has one leaf per sample, otherwise it has one per cluster.

labelType

one of 'name', 'colorblock' or 'id'. If 'Name' then dendrogram will be plotted, and name of cluster or sample (depending on type of value for leafType) will be plotted next to the leaf of the dendrogram. If 'colorblock', rectangular blocks, corresponding to the color of the cluster will be plotted, along with cluster name legend. If 'id' the internal clusterIds value will be plotted (only appropriate if leafType="clusters").

main

passed to the plot.phylo function to set main title.

sub

passed to the plot.phylo function to set subtitle.

removeOutbranch

logical, only applicable if there are missing samples (i.e. equal to -1 or -2), leafType="samples" and the dendrogram for the samples was made by putting missing samples in an outbranch. In which case, if this parameter is TRUE, the outbranch will not be plotted, and if FALSE it will be plotted.

legend

logical, only applicable if labelType="colorblock". Passed to phydataplot in ape package that is used to draw the color values of the clusters/samples next to the dendrogram. Options are 'none', 'below', or 'side'

...

arguments passed to the plot.phylo function of ape that plots the dendrogram.

Details

If leafType="clusters", the plotting function will work best if the clusters in the dendrogram correspond to the primary cluster. This is because the function colors the cluster labels based on the colors of the clusterIds of the primaryCluster

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(simData)

#create a clustering, for 8 clusters (truth was 3) 
cl <-clusterSingle(simData, subsample=FALSE, 
sequential=FALSE, mainClusterArgs=list(clusterFunction="pam", clusterArgs=list(k=8)))

#create dendrogram of clusters and then 
# merge clusters based ondendrogram: 
cl <- makeDendrogram(cl) 
cl <- mergeClusters(cl,mergeMethod="adjP",cutoff=0.1,plot=FALSE) 
plotDendrogram(cl) 
plotDendrogram(cl,leafType="samples",whichClusters="all",labelType="colorblock")

Bioconductor-mirror/clusterExperiment documentation built on Aug. 2, 2017, 4:28 p.m.