Clustering of haplotypes