cutreeHybrid {dynamicTreeCut}R Documentation

Hybrid adaptive tree cut for hierarchical clustering dendrograms.

Description

Detect clusters in a dendorgram produced by the function hclust.

Usage

cutreeHybrid(dendro, distM, cutHeight = NULL, minClusterSize = 20, 
             deepSplit = 1,
             maxCoreScatter = NULL, minGap = NULL,
             maxAbsCoreScatter = NULL, minAbsGap = NULL, 
             pamStage = TRUE, pamRespectsDendro = TRUE,
             useMedoids = FALSE, maxDistToLabel = cutHeight,
             respectSmallClusters = TRUE, verbose = 2, indent = 0)

Arguments

dendro a hierarchical clustering dendorgram such as one returned by hclust.
distM Distance matrix that was used as input to hclust.
cutHeight Maximum joining heights that will be considered. It defaults to 99 of the range between the 5th percentile and the maximum of the joining heights on the dendrogram.
minClusterSize Minimum cluster size.
deepSplit Either logical or integer in the range 0 to 4. Provides a rough control over sensitivity to cluster splitting. The higher the value, the more and smaller clusters will be produced. A finer control can be achieved via maxCoreScatter and minGap below.
maxCoreScatter Maximum scatter of the core for a branch to be a cluster, given as the fraction of cutHeight relative to the 5th percentile of joining heights. See Details.
minGap Minimum cluster gap given as the fraction of the difference between cutHeight and the 5th percentile of joining heights.
maxAbsCoreScatter Maximum scatter of the core for a branch to be a cluster given as absolute heights. If given, overrides maxCoreScatter.
minAbsGap Minimum cluster gap given as absolute height difference. If given, overrides minGap.
pamStage Logical, only used for method "hybrid". If TRUE, the second (PAM-like) stage will be performed.
pamRespectsDendro Logical, only used for method "hybrid". If TRUE, the PAM stage will respect the dendrogram in the sense an object can be PAM-assigned only to clusters that lie below it on the branch that the object is merged into. See cutreeDynamic for more details.
useMedoids if TRUE, the second stage will be use object to medoid distance; if FALSE, it will use average object to cluster distance. The default (FALSE) is recommended.
maxDistToLabel Maximum object distance to closest cluster that will result in the object assigned to that cluster.
respectSmallClusters If TRUE, branches that failed to be clusters in stage 1 only because of insufficient size will be assigned together in stage 2. If FALSE, all objects will be assigned individually.
verbose Controls the verbosity of the output. 0 will make the function completely quiet, values up to 4 gradually increase verbosity.
indent Controls indentation of printed messages (see verbose above). Each unit adds two spaces before printed messages; useful when several functions' output is to be nested.

Details

The function detects clusters in a hierarchical dendrogram based on the shape of branches on the dendrogram. For details on the method, see http://www.genetics.ucla.edu/labs/horvath/CoexpressionNetwork/BranchCutting.

In order to make the shape parameters maxCoreScatter and minGap more universal, their values are interpreted relative to cutHeight and the 5th percetile of the merging heights (we arbitrarily chose the 5th percetile rather than the minimum for reasons of stability). Thus, the absolute maximum allowable core scatter is calculated as maxCoreScatter * (cutHeight - refHeight) + refHeight and the absolute minimum allowable gap as minGap * (cutHeight - refHeight), where refHeight is the 5th percentile of the merging heights.

Value

A list containg the following elements:

labels Numerical labels of clusters, with 0 meaning unassigned, label 1 labeling the largest cluster etc.
cores Numerical labels indicating cores of found clusters.
smallLabels Numerical labels for branches that failed to be recognized clusters only because of insufficient number of objects.
trimmed Numerical labels indicating objects that have been trimmed from clusters.
branches A list detailing the deteced branch structure.

Author(s)

Peter Langfelder, Peter.Langfelder@gmail.com

References

Langfelder P, Zhang B, Horvath S, 2007. http://www.genetics.ucla.edu/labs/horvath/CoexpressionNetwork/BranchCutting

See Also

hclust, as.dist


[Package dynamicTreeCut version 1.20 Index]