bio-0.5.2: A bioinformatics library

Safe Haskell | Safe-Inferred

Bio.Clustering

Description

Implement clustering

Synopsis

- data Clustered score datum
  - = Branch score (Clustered score datum) (Clustered score datum)
  - | Leaf datum
- cluster_sl :: (Ord a, Ord s) => [(s, a, a)] -> [Clustered s a]

# Documentation

data Clustered score datum

Data structure for storing hierarchical clusters

Constructors

Branch score (Clustered score datum) (Clustered score datum) |
Leaf datum |

Instances

(Show score, Show datum) => Show (Clustered score datum) |

cluster_sl :: (Ord a, Ord s) => [(s, a, a)] -> [Clustered s a]

Single linkage agglomerative clustering. Cluster elements by slurping a sorted list of pairs with score (i.e. triples :-) Keeps a set of contained elements at each branch's root, so O(n log n), and requires elements to be in Ord. For this to work, the triples must be sorted on score. Earlier scores in the list will make up the lower nodes, so sort descending for similarity, ascending for distance.