Learn R Programming

peplib (version 1.5.1)

aclust: aclust

Description

Clusters a matrix of peptide sequences using kmeans or agglomerative clustering

Usage

aclust(sDistMatrix, clusterNumber, verbose = T, type = "kmeans", knstart = 20)

Arguments

sDistMatrix
sDistMatrix is a distance matrix resulting from a call to dist(seqs), where seqs is a Sequences object. You may also just pass the sequences and a call to dist will be done automatically.
clusterNumber
The number of clusters to create.
verbose
Controls how much logging information is printed.
type
There are two type options: "kmeans" and "agglomerative". "kmeans" causes aclust to call the normal kmeans method available in R. "agglomerative" uses a hierarchical clustering technique on the distance matrix.
knstart
The number of times to execute the "kmeans" algorithm to ensure a global minimum is reached.

Value

aclust returns a list where each element represents a cluster. Each element in the list is an array of integers, where each integer is the index of sequence (the row of the input sequence matrix).

Details

During each round, the agglomerative clustering technique combines the points or sets of points which have the smallest distance to one another. The distance measure is the smallest pairwise distance between two sets of points.

See Also

Sequences, kmeans

Examples

Run this code

#load some example data
data(TULASequences)

##Cluster
clusters <- aclust(dist(TULASequences), 3, knstart=1)
print(length(clusters[1]))
print(length(clusters[2]))
print(length(clusters[3]))

Run the code above in your browser using DataLab