APResult-class {apcluster} | R Documentation |
S4 class for storing results of affinity propagation
clustering. It extends the class ExClust
.
Objects of this class can be created by calling apcluster
or apclusterL
for a given similarity matrix or calling
one of these procedures with a data set and a similarity measure.
The following slots are defined for APResult objects. Most names are taken from Frey's and Dueck's original Matlab package:
sweeps
:number of times leveraged clustering ran with different subsets of samples
it
:number of iterations the algorithm ran
p
:input preference (either set by user or
computed by apcluster
or
apclusterL
)
netsim
:final total net similarity, defined as the
sum of expref
and dpsim
(see below)
dpsim
:final sum of similarities of data points to exemplars
expref
:final sum of preferences of the identified exemplars
netsimLev
:total net similarity of the individual sweeps for leveraged clustering; only available for leveraged clustering
netsimAll
:vector containing the total net similarity
for each iteration; only available if
apcluster
was called with
details=TRUE
exprefAll
:vector containing the sum of preferences
of the identified exemplars
for each iteration; only available if
apcluster
was called with
details=TRUE
dpsimAll
:vector containing the sum of similarities
of data points to exemplars
for each iteration; only available if
apcluster
was called with
details=TRUE
idxAll
:matrix with sample-to-exemplar indices
for each iteration; only available if
apcluster
was called with
details=TRUE
Class "ExClust"
, directly.
signature(x="APResult")
: 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="APResult")
: see
show-methods
signature(object="APResult")
: see
labels-methods
signature(object="APResult")
: see
cutree-methods
signature(x="APResult")
: 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 APResult
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="APResult")
: 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.
Frey, B. J. and Dueck, D. (2007) Clustering by passing messages between data points. Science 315, 972-976.
apcluster
, apclusterL
,
show-methods
, plot-methods
,
labels-methods
, cutree-methods
## create two Gaussian clouds cl1 <- cbind(rnorm(100, 0.2, 0.05), rnorm(100, 0.8, 0.06)) cl2 <- cbind(rnorm(50, 0.7, 0.08), rnorm(50, 0.3, 0.05)) x <- rbind(cl1, cl2) ## compute similarity matrix (negative squared Euclidean) sim <- negDistMat(x, r=2) ## run affinity propagation apres <- apcluster(sim, details=TRUE) ## show details of clustering results show(apres) ## plot information about clustering run plot(apres) ## plot clustering result plot(apres, x) ## plot heatmap heatmap(apres, sim)