aclust: aclust

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/peplib.R

Description

Clusters a matrix of peptide sequences using kmeans or agglomerative clustering

Usage

1
2
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.

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.

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).

Note

The "kmeans" is much much faster.

Author(s)

Andrew White

See Also

Sequences, kmeans

Examples

1
2
3
4
5
6
7
8
#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]))

peplib documentation built on May 29, 2017, 10:52 p.m.

Related to aclust in peplib...