Linear clustering with application to single nucleotide polymorphism genotyping