ExClust-class {apcluster} | R Documentation |
S4 class for storing exemplar-based clusterings
Objects of this class can be created by calling cutree
to cut out a clustering level from a cluster hierarchy
of class AggExResult
. Moreover,
cutree
can also be used to convert an object of
class APResult
to class ExClust
.
The following slots are defined for ExClust objects:
l
:number of samples in the data set
sel
:subset of samples used for leveraged clustering
exemplars
:vector containing indices of exemplars
clusters
:list containing the clusters; the i-th component is a vector of indices of data points belonging to the i-th exemplar (including the exemplar itself)
idx
:vector of length l
realizing a
sample-to-exemplar mapping; the i-th entry
contains the index of the exemplar the i-th
sample belongs to
sim
:similarity matrix; only available if
the preceding clustering method was called with
includeSim=TRUE
.
call
:method call of the preceding clustering method
signature(x="ExClust")
: see
plot-methods
signature(x="ExClust", y="matrix")
: see
plot-methods
signature(x="ExClust")
: see
heatmap-methods
signature(x="ExClust", y="matrix")
: see
heatmap-methods
signature(object="ExClust")
: see
show-methods
signature(object="ExClust")
: see
labels-methods
signature(object="ExClust", k="ANY", h="ANY")
: see
cutree-methods
signature(x="ExClust")
: gives the number of
clusters.
signature(x="ExClust")
: see
sort-methods
signature(x="ExClust")
: see
coerce-methods
signature(object="ExClust")
: see
coerce-methods
In the following code snippets, x
is an ExClust
object.
x[[i]]
: Returns the i-th cluster as a list of indices
of samples belonging to the i-th cluster.
x[i]
: Returns a list of integer vectors with the
indices of samples belonging to this cluster. The list has as
many components as the argument i
has elements. A list is
returned even if i
is a single integer.
signature(x="ExClust")
: gives the similarity
matrix.
Ulrich Bodenhofer, Andreas Kothmeier & Johannes Palme apcluster@bioinf.jku.at
http://www.bioinf.jku.at/software/apcluster
Bodenhofer, U., Kothmeier, A., and Hochreiter, S. (2011) APCluster: an R package for affinity propagation clustering. Bioinformatics 27, 2463-2464. DOI: 10.1093/bioinformatics/btr406.
aggExCluster
, show-methods
,
plot-methods
, labels-methods
,
cutree-methods
, AggExResult
,
APResult
## create two Gaussian clouds cl1 <- cbind(rnorm(20, 0.2, 0.05), rnorm(20, 0.8, 0.06)) cl2 <- cbind(rnorm(25, 0.7, 0.08), rnorm(25, 0.3, 0.05)) x <- rbind(cl1, cl2) ## compute similarity matrix (negative squared Euclidean) sim <- negDistMat(x, r=2) ## run affinity propagation aggres <- aggExCluster(sim) ## extract level with two clusters excl <- cutree(aggres, k=2) ## show details of clustering results show(excl) ## plot information about clustering run plot(excl, x)