componentsClust-class: Base class for components that are based on hierarchical...

componentsClust-classR Documentation

Base class for components that are based on hierarchical clustered data.

Description

This base class is derived from components and is used to store components resulting from hierarchical clustering information, for instance, generated by generateComponentsIntClust and generateComponentsSpecClust.

Usage

## S4 method for signature 'componentsClust'
delete(obj, ...)

## S4 method for signature 'componentsClust'
clusters(obj)

## S4 method for signature 'componentsClust'
cutClusters(obj)

## S4 method for signature 'componentsClust'
clusterProperties(obj)

## S4 method for signature 'componentsClust'
treeCut(obj, k = NULL, h = NULL)

## S4 method for signature 'componentsClust'
treeCutDynamic(obj, maxTreeHeight, deepSplit, minModuleSize)

## S4 method for signature 'componentsClust,missing'
plot(
  x,
  pal = "Paired",
  numericLabels = TRUE,
  colourBranches = length(x) < 50,
  showLegend = length(x) < 20,
  ...
)

## S4 method for signature 'componentsClust'
plotSilhouettes(obj, kSeq, pch = 16, type = "b", ...)

Arguments

...

Further options passed to plot.dendrogram (plot) or plot (plotSilhouettes).

k, h

Desired number of clusters or tree height to be used for cutting the dendrogram, respectively. One or the other must be specified. Analogous to cutree.

maxTreeHeight, deepSplit, minModuleSize

Arguments used by cutreeDynamicTree.

x, obj

A componentsClust (derived) object.

pal

Colour palette to be used from RColorBrewer.

numericLabels

Set to TRUE to label with numeric indices instead of (long) feature group names.

colourBranches

Whether branches from cut clusters (and their labels) should be coloured. Might be slow with large numbers of clusters, hence, the default is only TRUE when this is not the case.

showLegend

If TRUE and colourBranches is also TRUE then a legend will be shown which outlines cluster numbers and their colours. By default TRUE for small amount of clusters to avoid overflowing the plot.

kSeq

An integer vector containing the sequence that should be used for average silhouette width calculation.

pch, type

Passed to plot.

Methods (by generic)

  • clusters(componentsClust): Accessor method to the clust slot, which was generated by hclust.

  • cutClusters(componentsClust): Accessor method to the cutClusters slot. Returns a vector with cluster membership for each candidate (format as cutree).

  • clusterProperties(componentsClust): Returns a list with properties on how the clustering was performed.

  • treeCut(componentsClust): Manually (re-)cut the dendrogram.

  • treeCutDynamic(componentsClust): Automatically (re-)cut the dendrogram using the cutreeDynamicTree function from dynamicTreeCut.

  • plot(x = componentsClust, y = missing): generates a dendrogram from a given cluster object and optionally highlights resulting branches when the cluster is cut.

  • plotSilhouettes(componentsClust): Plots the average silhouette width when the clusters are cut by a sequence of k numbers. The k value with the highest value (marked in the plot) may be considered as the optimal number of clusters.

Slots

distm

Distance matrix that was used for clustering (obtained with daisy).

clust

Object returned by hclust.

cutClusters

A list with assigned clusters (same format as what cutree returns).

gInfo

The groupInfo of the feature groups object that was used.

properties

A list containing general properties and parameters used for clustering.

altered

Set to TRUE if the object was altered (e.g. filtered) after its creation.

S4 class hierarchy

  • components

    • componentsClust

      • componentsIntClust

      • componentsSpecClust

Note

The intensity values for components (used by plotSpectrum) are set to a dummy value (1) as no single intensity value exists for this kind of components.

When the object is altered (e.g. by filtering or subsetting it), methods that need the original clustered data such as plotting methods do not work anymore and stop with an error.

References

\insertRef

Scholle2018patRoon

See Also

components and generateComponents


rickhelmus/patRoon documentation built on April 25, 2024, 8:15 a.m.