An efficient clustering algorithm for partitioning Y-short tandem repeats data

Background Y-Short Tandem Repeats (Y-STR) data consist of many similar and almost similar objects. This characteristic of Y-STR data causes two problems with partitioning: non-unique centroids and local minima problems. As a result, the existing partitioning algorithms produce poor clustering results. Results Our new algorithm, called k-Approximate Modal Haplotypes (k-AMH), obtains the highest clustering accuracy scores for five out of six datasets, and produces an equal performance for the remaining dataset. Furthermore, clustering accuracy scores of 100% are achieved for two of the datasets. The k-AMH algorithm records the highest mean accuracy score of 0.93 overall, compared to that of other algorithms: k-Population (0.91), k-Modes-RVF (0.81), New Fuzzy k-Modes (0.80), k-Modes (0.76), k-Modes-Hybrid 1 (0.76), k-Modes-Hybrid 2 (0.75), Fuzzy k-Modes (0.74), and k-Modes-UAVM (0.70). Conclusions The partitioning performance of the k-AMH algorithm for Y-STR data is superior to that of other algorithms, owing to its ability to solve the non-unique centroids and local minima problems. Our algorithm is also efficient in terms of time complexity, which is recorded as O(km(n-k)) and considered to be linear.

In modern kinship analyses, the Y-STR is very useful for distinguishing lineages and providing information about lineage relationships [1]. Many areas of study, including genetic genealogy, forensic genetics, anthropological genetics, and medical genetics, have taken advantage of the Y-STR method. For example, it has been used to trace a similar group of Y-surname projects to support traditional genealogical studies, e.g., [2][3][4].
Further, in forensic genetics, the Y-STR is one of the primary concerns in human identification for sexual assault cases [5], paternity testing [6], missing persons [7], human migration patterns [8], and the reexamination of ancient cases [9].
From a clustering perspective, the goal of partitioning Y-STR data is to group a set of Y-STR objects into clusters that represent similar genetic distances. The genetic distance of two Y-STR objects is based on the mismatch results from comparing the Y-STR objects and their modal haplotypes. For Y-surname applications, if two people share 0, 1, 2, and 3 allele value mismatches for each marker, they are considered to be the most familially related. Furthermore, for Y-haplogroup applications, the number of mismatches is variant and greater than that typically found in Y-surname applications. This is because the haplogroup application is based on larger family groups branched out from the same ancestor, covering certain geographical areas and ethnicities throughout the world. The established Y-DNA haplogroups named by the letters A to T, with further subdivisions using numbers and lower case letters, are now available for reference (see [10] and [11] for details).
Efforts to group Y-STR data based on genetic distances have recently been reported. For example, Schlecht et al. [12] used machine learning techniques to classify Y-STR fragments into related groups. Furthermore, Seman et al. [13][14][15][16][17][18][19] used partitional clustering techniques to group Y-STR data by the number of repeats, a method used in genetic genealogy applications. In this study, we continue efforts to partition the Y-STR data based on the partitional clustering approaches carried out in [13][14][15][16][17][18][19]. Recently, we have also evaluated eight partitional clustering algorithms over six Y-STR datasets [19]. As a result, we found that there is scope to propose a new partitioning algorithm to improve the overall clustering results for the same datasets.
A new partitioning algorithm is required to handle the characteristics of Y-STR data, thus producing better clustering results. Y-STR data are slightly unique compared to the common categorical data used in [20][21][22][23][24][25]. The Y-STR data contain a higher degree of similarity of Y-STR objects in their intra-classes and inter-classes. (Note that the degree of similarity is based on the mismatch results when comparing the objects and their modal haplotypes.) For example, many Y-STR surname objects are found to be similar (zero mismatches) and almost similar (1, 2, and 3 mismatches) in their intraclasses. In some cases, the mismatch values of interclass objects are not obviously far apart. Y-STR haplogroup data contain similar, almost similar, and also quite distant objects. Occasionally, the Y-STR haplogroup data may include sub-classes that are sparse in their intra-classes.

Partitional clustering algorithms
Classically, clustering has been divided into hierarchical and partitional methods. The main difference between the two is that the hierarchical method breaks the data up into hierarchical clusters, whereas the partitional method divides the data into mutually disjoint partitions. The pillar of the partitional algorithms is the k-Means algorithm [26], introduced almost four decades ago. As a consequence, the k-Means paradigm has been extended to various versions, including the k-Modes algorithm [25] for categorical data.
The k-Modes algorithm owes its existence to the ineffectiveness of the k-Means algorithm for handling categorical data. Ralambondrainy [27] attempted to rectify this using a hybrid numeric-symbolic method based on the binary characters 0 and 1. However, this approach suffered from an unacceptable computational cost, particularly when the categorical attributes had many categories. Since then, a variety of k-Modes-type algorithms have been introduced, such as k-Modes with new dissimilarity measures [21,22], k-Population [23], and a new Fuzzy k-Modes [20].
Partitional algorithms use an objective function in their optimization process, and the determination of this function was described as the P problem by Bobrowski and Bezdek [28] and Salim and Ismail [29]. When he proposed the k-Modes clustering algorithm, Huang [25] split P into P 1 and P 2 . P 1 denotes the minimization problem of obtaining values for the partition matrix w li of 0 or 1 (for the hard clustering approach) or 0 to 1 (for the fuzzy clustering approach); see Eq. (1b) as an example. Furthermore, P 2 denotes the minimization problem of obtaining the value that occurs most often (or the mode of a categorical data set) to represent the center of a cluster (often called the centroid). The minimization of P 2 by obtaining the appropriate mode essentially causes the minimization of problem P 2 , and vice versa. As an example of the optimization process for problem P in the Fuzzy k-Modes algorithm, we wish to solve Eq. (1) subject to Eqs. (1a), (1b), and (1c).
subject to: And 0 < X n i¼1 w li < n;1≤l≤k ð1cÞ where: w li is a (k × n) partition matrix that denotes the degree of membership of object i in the lth cluster that contains a value of 0 to 1, k (≤ n) is a known number of clusters, Z is the centroid such that [Z 1 , Z 2 ,. . .,Z k ] ∊ R mk , α ∊ [1, ∞) is a weighting exponent, d(X i , Z l ) is the distance measure between the object X i and the centroid Z l , as described in Eqs. (2) and (2a). where: Huang and Ng [24] described the optimization process of P 1 and P 2 as follows: Problem P 1 : Fix Z =Ẑ and solve the reduced problem P(W,Ẑ) as in Eq. (3). This process obtains the minimized values of 0-1 of the partition matrix w li .
Problem P 2 : Fix W = Ŵ and solve the reduced problem P(Ŵ, Z) as in Eq. (4) subject to Eq. (4a). This process obtains the most frequent attributes, or the modes, which give the centroids. where: and α ∈ [1, ∞) is a weighting exponent.

Problem of partitioning Y-STR data
Due to the characteristics of Y-STR data, there are two optimization problems for existing partitional algorithms: non-unique centroids and local minima problems. These two problems are caused by the drawback of the modes mechanism of determining the centroids. Non-unique centroids would result in empty clusters, whereas the local minima problem leads to poorer clustering results. Both problems are a result of the obtained centroids, which are not sufficient to represent their classes. Therefore, problems will occur for the following two cases: i)The total number of objects in a dataset is small while the number of classes is large. To illustrate this case, consider the following example.
Example I: Figure 1 shows an artificial example of a dataset consisting of nine objects in three classes: Class A = {A 1 , A 2 , A 3 }, Class B = {B 1 , B 2 , B 3 }, and Class C = {C 1 , C 2 , C 3 }. Each object is composed of three attributes, represented in lower case; e.g., for object A 1 , the attributes are a 1 , a 2 , and a 3 . The dataset is considered to have a higher degree of similarity between objects in intra-classes, while the number of objects is small and number of classes is large. Thus, the appropriate modes for representing the classes are: , and c 3 in DOMAIN (A 3 ) are too dominant, and would therefore dominate the process of updating P 2 . Figure 2 shows the possibility that each cluster is formed by the dominant attributes.
As a result, the mode that consists of [a 1 , a 2 , c 3 ] would be obtained twice. Thus, P 2 would not be minimized due to this non-unique centroid. Another possibility is that the two modes are different, but are not distinctive enough to represent their clusters, such as modes [a 1 , a 2 , a 3 ] or [a 1 , a 2 , b 3 ] for Cluster 2. As a consequence, this case would fall into a local minima problem. Figure 1 Artificial Example 1. An example of higher degree of similarity between objects.

Class Object Attribute 1 Attribute 2 Attribute 3
ii)An extreme distribution of objects in a class. To illustrate this case, consider the following example.
Example II: Figure 3 shows a dataset consisting of eight objects in two classes: Class A = {A 1 , A 2 , A 3 , A 4 , A 5 , A 6 } and Class B = {B 1 , B 2 }. Each object consists of three attributes, again represented in lower case. The appropriate modes to represent the classes are: Class A -[a 1 , a 2 , b 3 ] and Class B -[a 1 , b 2 , c 3 ] or [a 1 , b 2 , d 3 ]. The distribution of objects in Class A is considerably larger than in Class B, covering approximately 75% of the total set of objects. This characteristic of the data is found to be problematic for P 2 , particularly for the fuzzy approach. The problem is actually caused by the initial centroid selection. Figure 4 shows the objects in Class A would be equally distributed into clusters 1 and 2.
As a result, object A becomes dominant in both clusters, and so the obtained modes might be represented solely by objects in Class A, e.g., [a 1 , a 2 , a 3 ] and [a 1 , a 2 , b 3 ].

Figure 2
The dominant attributes form centroid 1 (a 1 , a 2 , c 3 ), centroid 2 (a 1 , a 2 , c 3 ) and centroid 3 (b 1 , c 2 , d 3 ). In this case, there are possibilities that each cluster is formed by the dominant attributes, e.g. attribute a 1 , a 2 and c 3. This scenario of non-unique centroids would result in empty clusters; otherwise the centroids would lead to local a minima problem and produce poorer clustering results. Figure 3 Artificial Example 2. An example of the extreme distribution of objects in a class.

Class Object Attribute 1 Attribute 2 Attribute 3
The above situations cause P not to be fully optimized, thus producing poor clustering results. Therefore, a new algorithm with a new concept of P 2 is proposed in order to overcome these problems and improve the clustering accuracy results of Y-STR data.

The center of a cluster
The mode mechanism for the center of a cluster (problem P 2 ) is not appropriate for handling the characteristics of Y-STR data, and therefore, it cannot be used as a mechanism to represent the center of a cluster (centroid). Instead, the center of Y-STR data should be the modal haplotypes, which are required to calculate the distance of Y-STR objects. The distance between a Y-STR object and its modal haplotype can be formalized as in Eq. (5) subject to Eq. (5a).
subject to: where m is the number of markers. The modal haplotype is controlled by groups of objects that are similar or almost similar in Y-STR data. The similar and almost similar objects have a lower distance, or a higher degree of membership values in a fuzzy sense. Thus, these two groups are considerably the Figure 4 The extreme distribution of objects A forms centroid 1 (a 1 , a 2 , a 3 ) and centroid 2 (a 1 , a 2 , b 3 ). In this case, the objects in Class A are equally distributed into clusters 1 and 2. Therefore, the obtained centroids are not sufficient to represent their classes.
most dominant objects required to find the Approximate Modal Haplotype. Consider four objects x 1 , x 2 , x 3 , and x 4 and two clusters c 1 and c 2 . The membership value for each object and its cluster are as shown in Table 1, whereby objects x 1 and x 3 have a 100% chance of being the most dominant object in cluster c 1 , but only a 50% chance of being the dominant object in cluster c 2 , and so on. A dominant weighting value of 1.0 is given to any dominant object and a weight of 0.5 is given to the remaining objects.
The k-AMH algorithm The objective of the algorithm is to partition the categorical objects X into k clusters. Thus, the H l can be replaced by X i until n provided they satisfy the condition described in Eq. (6).
subject to: W li ∝ is a (k × n) partition matrix that denotes the degree of membership of Y-STR object i in the lth cluster that contains a value of 0 to 1 as described in Eq. (8), subject to Eqs. (8a) and (8b). subject to: and  [24]. d ystr (X i, H l ) is the distance measure between the Y-STR object X i and the Approximate Modal Haplotype H l as described in Eq. (5) and subject to Eq.(5a). D li is another (k × n) partition matrix which contains a dominant weighting value of 1.0 or 0.5, as explained above (See Table 1). The dominant weighting values are based on the value of W li ∝ above. D li is described in Eq. (9), subject to Eqs. (9a), (9b), and (9c).
subject to: The basic idea of the k-AMH algorithm is to find k clusters in n objects by first randomly selecting an object to be the Approximate Modal Haplotype h for each cluster. The next step is to iteratively replace the objects x one-by-one towards the Approximate Modal Haplotype h. The replacement is based on Eq. (6) if the cost function as described in Eq. (7) and subject to (7a), (8), (8a), (8b), (9), (9a), (9b) and, (9c) is maximized. Thus, the differences between the k-AMH algorithm and the other k-Mode-type algorithms are as follows.
i. The objects (the data themselves) are used as the centroids instead of modes. Since the distance of Y-STR objects is measured by comparing the objects and their modal haplotypes, we need to approximately find the objects that can represent the modal haplotypes. In finding the final Approximate Modal Haplotype for a particular group (cluster), each object needs to be tested oneby-one and replaced on a maximization of a cost function. ii. A maximization process of the cost function is required instead of minimizing it as in the k-modetype algorithms.
A detailed description of the k-AMH algorithm is given below.
Step 1 -Select k initial objects randomly as Approximate Modal Haplotype (centroids). E.g. if k = 4, then choose randomly 4 objects as the initial Approximate Modal Haplotype.
Step 3 -Calculate partition matrix w li ∝ according to Eq. (8), subject to Eqs. (8a) and (8b). Note that the w li ∝ is based on the distance calculated in Step 2.
Step 6 -Test for each initial modal haplotype by the other objects one-by-one. If current cost function is greater than previous cost function according to Eq. (6), then replace it.
Step 7 -Repeat Step 2 until Step 6 for each x and h Step 8 -Once the final Approximate Modal Haplotypes are obtained for all clusters, assign the objects to their corresponding crisp clusters C li according to Eq. (10).
Furthermore, the implementation of the steps above of the algorithm is formalized in the form of pseudo-code as follows.
INPUT: Dataset, X, the number of cluster, k, the number of dimensional, d and the fuzziness index, OUTPUT: A set of clusters, k 01: Select H l randomly from X such that 1≤l≤ k 02: for each H l an Approximate Modal Haplotype do 03: for each X i do 04: Calculate P(À) = P l = 1 k P i = 1 n À li 05: if P(À) = P l = 1 k P i = 1 n À li is maximized, then 06: Replace H l by X i 07: end if 08: end for 09: end for 10: Assign X i to C l for all l, 1≤ l ≤ k; 1≤i≤ n as Eq. (10)

Optimization of the problem P
In optimizing the problem P, the k-AMH algorithm uses a maximization process instead of the minimization process imposed by the k-Mode-type algorithms. This process is formalized in the k-AMH algorithm as follows.
Step 1 -Choose an Approximate Modal Haplotype, H (t) ∈ X. Calculate P(Á); Set t=1 Step 2 -Choose X (t+1) such that P(Á) t+1 is maximized; Replace H 1 by X (t+1) Step 3 -Set t=t+1; Stop when t=n; otherwise go to Step 2. *Note: n is the number of objects The convergence of the algorithm is proven as P 1 and P 2 are maximized accordingly. The function P(Á) incorporates the P(W, H) function imposed by the Fuzzy k-Modes algorithm, where W is a partition matrix and H is the approximate modal haplotype that defines the center of a cluster. Thus, P 1 and P 2 are solved by Theorems 1 and 2, respectively. Let X= {X 1 ,X 2 ,..,X n } be a set of n Y-STR categorical objects and H= {H 1 ,H 2 ,..,H k } be a set of centroids (Approximate Modal Haplotypes) for k clusters. Suppose that P= {P 1 ,P 2 ,..,P k } is a set of dissimilarity measures based on d ystr (X i, H l ), as described in Eqs. (5) and subject to (5a), ∀ i and l 1 ≤ i ≤ n; 1 ≤ l ≤ k Definition 1 -For X i = H l and X i = H z , where z ≠ l, the membership value for all i is For any P that is obtained from d ystr (X i, H l ) where X i = H l , the maximum value of w li ∝ is 1 and X i = H z , z ≠ l the value of w li ∝ is 0. Therefore, because H l is fixed, w li ∝ is maximized.
Definition 2 -For the case of H i ≠ X i and X i ≠ H z , ∀ z, 1 ≤ z ≤ k, the membership value for all i is Suppose that p li ∈ P is the minimum value, we write as t ≠ l and ∀ z and t, 1 ≤ z ≤ k; 1 ≤ t ≤ k It follows that where t ≠ l Therefore, based on definitions 1 and 2, w li ∝ is maximal. Because Ĥ is fixed, P W;Ĥ À Á is maximized.
Theorem 2 -Let h l ∈ X be the initial center of a cluster for 1 ≤ l ≤ k. h l is replaced by x i as the Approximate Modal Haplotype if and only if Proof Let D= {D 1 ,D 2 ,..,D k } be a set of dominant weighting values. For any maximum value of w li ∝ as proved by Theorem 1, we assign an optimum value of 1.0 as a dominant weighting value, otherwise 0.5 as described in Eq, (9) and subject to Eqs. (9a), (9b) and (9c). We write Because w li ∝ and D li are non-negative, the product W li ∝ D li must be maximal. It follows that the sum of all n Á li is also maximal. Hence, the result follows.
All datasets were retrieved from the respective websites in April 2010, and can be described as follows: 1) The first dataset consists of 751 objects of the Y-STR haplogroup belonging to the Ireland yDNA project [32]. The data contain only 5 haplogroups, namely E 3) The third dataset consists of 263 objects obtained from the Y-haplogroup project [34]. The data contain Groups G (37), N (68), and T (158). Thus, k = 3. 4) The fourth dataset consists of 236 objects combining four surnames: Donald [35], Flannery [36], Mumma [37], and William [38]. Thus, k = 4.
The values in parentheses indicate the number of objects belonging to that particular group. Datasets 1-3 represent Y-STR haplogroups and datasets 4-6 represent Y-STR surnames.
Our analysis was based on the average accuracy scores obtained from 100 runs for each algorithm and dataset. During the experiments, the objects in the datasets were randomly reordered from the preceding run. The misclassification matrix proposed by Huang [25] was used to obtain the clustering accuracy scores for evaluating the performance of each algorithm. The clustering accuracy r defined by Huang [25] is given by Eq. (11): where k is the number of clusters, a i is the number of instances occurring in both cluster i and its corresponding haplogroup or surname, and n is the number of instances in the dataset.
Clustering performance Table 2 shows the clustering accuracy scores for all datasets (boldface indicates the highest clustering accuracy). Based on these results, the performance of the k-AMH algorithm was very promising. Out of six datasets, our algorithm obtained the highest clustering accuracy scores for datasets 1, 2, 4, 5, and 6. In fact, the algorithm also achieved the optimal clustering accuracy for two datasets (4 and 5). However, for dataset 3, the results show that the accuracy of the k-AMH algorithm was 0.01 lower than that of the k-Population algorithm. A statistical t-test was carried out for further verification. This indicated that t(101.39) = 0.65, and p = 0.51. Thus, there was no significant difference at the 5% level between the accuracy score of our k-AMH algorithm and the k-Population algorithm. This means that both algorithms displayed an equal performance for this dataset.
During the experiments, the k-AMH algorithm did not encounter any difficulties. However, the Fuzzy k-Modes and the New Fuzzy k-Modes algorithms faced problems with datasets 1, 5, and 6. For dataset 1, the problem was caused by the extreme number of objects in Class R (475), which covered about 63% of the total objects. Further, for datasets 5 and 6, the problem was caused by many similar objects in a larger number of classes. In particular, both algorithms faced the problem P 2 caused by the initial centroid selections. Note also that the results for both algorithms were based on the diverse method, an initial centroid selection proposed by Huang [25].
For an overall comparison, Table 3 shows the results of all Y-STR datasets. It clearly indicates that the k-AMH algorithm obtained the highest accuracy score of 0.93. The closest score of 0.91 belongs to the k-Population algorithm. Furthermore, the k-AMH algorithm also recorded the best results in terms of standard deviation (0.07), the lower bound (0.93), the upper bound (0.94), and the minimum accuracy score (0.79).
For further verification, a one-way ANOVA test was carried out. This indicated that the assumption of homogeneity of variance was violated; therefore, the Welch F-ratio is reported. There was a significant variance in the clustering accuracy scores among the  nine algorithms, in which F(8, 2230) = 378, p < 0.001, and ω 2 = 0.25. Thus, the Games-Howell procedure was used for a multiple comparison among the nine algorithms. Table 4 shows the result of this comparison with regard to the k-AMH algorithm against the other eight algorithms. At the 5% level of significance, it is clearly shown that the k-AMH algorithm (M = 0.93, 95% CI [0.93, 0.94]) differed from the other eight algorithms (all P values < 0.001). Thus, the performance of k-AMH algorithm exhibited a very significant difference compared to the other algorithms.

Efficiency
We now consider the time efficiency of the k-AMH algorithm. The computational cost of the algorithm depends on the nested loop for k(n-k), where k is the number of clusters and n is the number of data required to obtain the cost function, P(À). The function P(À) involves the number of attributes m in calculating the distances and the membership values for its partition matrix w li . Thus, the overall time complexity is O(km(n-k)). However, the time efficiency of the k-AMH algorithm will not reach O(n 2 ) because the value of k in the outer loop will not become equivalent to the value of n-k in the inner loop. See pseudo-code for a detailed implementation of these loops. A scalability test was also carried out for the k-AMH algorithm. These experiments were based on a dataset called Connect [42]. This dataset consisted of 65,000 data, 42 attributes, and three classes. Two scalability tests were conducted: (a) scalability against the number of objects, when the number of clusters was three, and (b) scalability against the number of clusters, when the number of objects was 65,000. The test was performed on a personal computer with an Intel ® Core ™ 2 DUO Processor with 2.93 GHz and 2.00 GB memory. Figure 5 (a) and (b) illustrate the results of the tests. In conclusion, the runtime of the k-AMH algorithm increased linearly with the number of clusters and data.

Conclusions
Our experimental results indicate that the performance of the proposed k-AMH algorithm for partitioning Y-STR data was significantly better than that of the other algorithms. Our algorithm handled all problems, as described previously, and was not too sensitive to P 0 , the initial centroid selection, even though the datasets contained a lot of similar objects. Moreover, the concept of P 2 in using the object (the data itself) as the approximate center of a cluster has significantly improved the overall performance of the algorithm. In fact, our algorithm is the most consistent of those tested because the difference between the minimum and maximum scores is smaller. The k-AMH algorithm always produces the highest minimum score for each dataset. In conclusion, the k-AMH algorithm is an efficient method of partitioning Y-STR categorical data.