bClust(dist.table, linkage = "single", threshold = 1)
data.frame
with pairwise distances. The columns Sequence.A and
Sequence.B contain tags identifying pairs of sequences. The column Distance contains
the distances, always a number from 0.0 to 1.0.bClust
will assign sequences into gene families by a hierarchical clustering approach.
Since the number of sequences may be huge, a full all-against-all distance matrix will be impossible
to handle in memory. However, most sequence pairs will have an infinite distance between them,
and only the pairs with a finite (smallish) distance need to be considered.This function takes as input the distances in a data.frame
where only the interesting distances
are listed. Typically, this data.frame
is the output from bDist
. All pairs of
sequence not listed are assumed to have distance 1.0, which is considered the infinite
distance. Note that dist.table must have the columns Sequence.A, Sequence.B and
Distance. The first two contain texts identifying sequences, the latter contains the distances.
All sequences must be listed at least once. This should pose no problem, since all sequences have
distance 0.0 to themselves, and should be listed with this distance once.
The linkage defines the type of clusters produced. The threshold indicates the size of the clusters. A single linkage clustering means all members of a cluster have at least one other member of the same cluster within distance threshold from itself. An average linkage means all members of a cluster are within the distance threshold from the center of the cluster. A complete linkage means all members of a cluster are no more than the distance threshold away from any other member of the same cluster.
Typically, single linkage produces big clusters where members may differ a lot, since they are only required to be close to something, which is close to something,...,which is close to some other member. On the other extreme, complete linkage will produce small and tight clusters, since all must be similar to all. The average linkage is between, but closer to complete linkage. If you want the threshold to specify directly the maximum distance tolerated between two members of the same gene family, you must use complete linkage. The single linkage is the fastest alternative to compute. Using the default setting of single linkage and maximum threshold (1.0) will produce the largest and fewest clusters possible.
bDist
, hclust
, dClust
, isOrtholog
.
# Loading distance data in the micropan package
data(Mpneumoniae.blast.distances,package="micropan")
# Clustering with default settings
clustering.blast.single <- bClust(Mpneumoniae.blast.distances)
# Clustering with complete linkage and a liberal threshold
clustering.blast.complete <- bClust(Mpneumoniae.blast.distances,linkage="complete",threshold=0.75)
Run the code above in your browser using DataLab