R/components-clust.R
componentsClust-class.Rd
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
.
# S4 method for class 'componentsClust'
delete(obj, ...)
# S4 method for class 'componentsClust'
clusters(obj)
# S4 method for class 'componentsClust'
cutClusters(obj)
# S4 method for class 'componentsClust'
clusterProperties(obj)
# S4 method for class 'componentsClust'
treeCut(obj, k = NULL, h = NULL)
# S4 method for class 'componentsClust'
treeCutDynamic(obj, maxTreeHeight, deepSplit, minModuleSize)
# S4 method for class 'componentsClust,missing'
plot(
x,
pal = "Paired",
numericLabels = TRUE,
colourBranches = length(x) < 50,
showLegend = length(x) < 20,
...
)
# S4 method for class 'componentsClust'
plotSilhouettes(obj, kSeq, pch = 16, type = "b", ...)
Further options passed to plot.dendrogram
(plot
) or plot
(plotSilhouettes
).
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
.
Arguments used by
cutreeDynamicTree
.
A componentsClust
(derived) object.
Colour palette to be used from RColorBrewer.
Set to TRUE
to label with numeric indices instead of (long) feature group names.
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.
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.
An integer vector containing the sequence that should be used for average silhouette width calculation.
Passed to plot
.
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.
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.
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.
componentsClust
Scholle2018patRoon