






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Pavel Kuksa and Vladimir Pavlovic
Department of Computer Science, Rutgers University, Piscataway, NJ 08854 [email protected], [email protected]
Abstract. In this work we study string kernel methods for sequence analysis and focus on the problem of species-level identification based on short DNA fragments known as barcodes. We introduce efficient sorting-based algorithms for exact string k-mer kernels and then de- scribe a divide-and-conquer technique for kernels with mismatches. Our algorithms for mismatch kernel matrix computations improve currently known time bounds for these computations. We then consider the mis- match kernel problem with feature selection, and present efficient algo- rithms for it. Our experimental results show that, for string kernels with mismatches, kernel matrices can be computed 100-200 times faster than traditional approaches. Kernel vector evaluations on new sequences show similar computational improvements. On several DNA barcode datasets, k-mer string kernels considerably improve identification accuracy com- pared to prior results. String kernels with feature selection demonstrate competitive performance with substantially fewer computations.
Biological species identification through DNA barcodes has been proposed re- cently in [1]. In the DNA barcoding setting, DNA sequencing of the mitochon- drial region is used to obtain a relatively short sequence, DNA barcode, that is subsequently used as a marker for species identification and classification. This approach contrasts traditional identification methods that rely on markers from multiple genomic locations. DNA barcoding has shown great promise due to in- creased robustness, and predictive value for rapid and accurate identification of species. For instance, barcoding analysis via cox1 gene of moth and fly specimens intercepted at New Zealand’s borders resulted in improved correct placement of previously unknown species or increased resolution of specimens [2]. Reliance of DNA barcoding on a short single fragment of DNA sequence ne- cessitates new computational methods to deal efficiently with this single sequence- based assignment. Several methods, based on pairwise alignments [3] or statis- tical approaches using evolutionary distances [4], have been applied to the tasks of identification and analysis of the DNA barcode data. However, a number of challenges remain to be addressed, including the accuracy of identification [3–6], as well as the efficiency and scalability of computational methods.
In this study we investigate kernel classification methods for the DNA bar- coding. Kernel-based classification demonstrated strong performance in many related tasks of biological sequence analysis, such as protein classification and remote homology detection [7–9]. There are several types of kernels for the bio- logical sequences, including kernels derived from probabilistic models [10], k-mer string kernels [7, 8], and weighted-decomposition kernels [11]. In this work we fo- cus on recently proposed k-mer string kernels. In our approach, species identification is performed by first transforming sequences (potentially of varying length) into fixed-length representations (string spectra) and then classifying them into one of many established species classes using Support Vector Machine (SVM) classifiers [12, 13]. As a result, the string kernel-based species identification in our study demonstrates high accuracy and improved classification performance compared to previously employed methods. The improved accuracy of kernel-based classification methods in the sequence domain is typically challenged by their computational complexity. To address the computational aspects of the method, we propose novel and efficient algorithms for solving the string kernel-based learning problems. We also introduce string kernels with feature selection which perform as well as the methods based on the full feature sets while having significantly lower computation cost. Our experimental results show that, for string kernels with mismatches, ker- nel matrices can be computed by factors of 100-200 times faster. Identification of new sequences similarly requires significantly less time than the standard ap- proaches. We also observe that the k-mer string kernels considerably improve identification accuracy compared to the previously reported results on several barcode datasets. String kernels with feature selection demonstrate competitive classification performance with substantially fewer computations. This paper is organized as follows. We start by introducing efficient sorting- based algorithms for exact string k-mer kernels (Section 3). In Section 4 we describe a divide-and-conquer technique for exact k-spectrum kernels and k-mer kernels with m mismatches which combined with the sorting improves currently known time bounds for the mismatch kernel computations. We then introduce the mismatch kernel problem with feature selection and present algorithms for efficient computations of the string kernels with feature selection (Section 5). A comparison of our kernel method with a baseline computational approach is discussed in Section 6. Finally, we evaluate several feature spaces and pro- vide comparative analysis of the performance of our method on three publicly available barcode datasets in Section 8.
Species identification problem can be described in the following way: given an unlabeled sample (specimen) X and a set SP of known species represented by their reference barcode sequences or models, the task is to assign the given sample to one of the known species (or decide that this sample does not belong to any of
Step 1.Extract and store k-mers from the input sequences, O(knN ) time^2. Step 2. Sort obtained list L using counting sort, O(knN ). Step 3. Compute feature counts by scanning the sorted list and update the kernel matrix on each change in the feature value, O(knN + min(u, n) · N 2 ).
For each unique feature f (there are u of them), in step 3 kernel matrix is updated as follows:
K(updf , updf ) = K(updf , updf ) + cf cTf (1)
where updf = {i : f ∈ xi} is a set of input sequences that contain f and cf = [nxi (f )]i∈updf is a vector of feature counts for each sequence from updf. In the case of (k, m)-mismatch kernel when up to m mismatches are allowed, a set of unique features u can be extracted first using the above algorithm and then used in computations instead of the original redundant set. This preprocessing step takes O(knN ) time, however, since nN (number of features collected from all the input sequences) is much larger than u in the case of DNA sequences, this preprocessing step results in the improved performance of the algorithm.
While the sorting formalism results in an improved computational method for kernel evaluation it is also possible to gain further reduction in computational complexity. The efficient computation is achieved by using linear time character- based clustering to divide the problem into subproblems and the merging pro- cedure that updates the kernel matrix. Using a divide-and-conquer technique, the exact and mismatch kernel prob- lems can be solved recursively as follows:
Step 1: Original set L of features composed of all k-mers extracted from N input sequences is divided into subsets L 1 ,... , L|Σ| using character-based clustering. Step 2: The same procedure (Divide step) is applied to each of the subsets L 1 ,... , L|Σ| recursively. The depth of recursion is bounded by k (since clus- tering continues until there is no substrings left or depth k reached). Each node at depth k corresponds to some feature f and stores counts nxi (f ) (number of times f appears in xi) for all the sequences that contain f , these counts are used to update kernel matrix as in (1). (^2) Complexity of the feature extraction step can be reduced if k-mers are stored as integers (e.g. 32-bit word can store k-mers with value of k up to 16 when |Σ| = 4). Features then can be extracted from all the input sequences in O(N (n + k)) time since feature i can be computed from feature i − 1 in O(1) time and it takes O(k) time to compute the first feature. Extracted features then can be sorted in Θ(knN ) time and Θ(nN ) space
The procedure above builds one recursion tree for all input sequences. At each level l = 1... k of the recursion tree there are |Σ|l^ clusters, each of the l-level cluster corresponds to a distinct substring of length l. Each cluster C consists of a number of subclusters SC where each subcluster is formed by k-mers from one particular sequence. At level k of the recursion tree, each node contains a collection of subclusters where each subcluster corresponds to a set of substrings from one particular sequence that are in the neighborhood of node feature, i.e., each node points to all the substrings that are in the neighborhood of the base string (node feature). The recursion procedure above results in an incremental algorithm for the mismatch kernel computation.
4.1 Analysis of Incremental Mismatch Kernel Algorithm
The time complexity of the incremental mismatch kernel algorithm can be ex- pressed as
u ·
∑^ k
l=
min( ∑m,l)
i=
l i
(Σ − 1)i^ + u · N 2
At each level l algorithm gives solution for the (l, min(m, l))-mismatch problem. Last term in the expression for the time complexity reflects the cost of comput- ing kernel matrix using N -length vectors of feature counts. For small values of m (m k) complexity of processing each k-mer can be approximated as km|Σ|m.
As m grows, time complexity approaches limit of |Σ| |Σ|
k− 1 | |Σ|− 1 , i.e.^ O(u^ · |Σ|
k) (^3).
Incremental mismatch kernel algorithm and recursive exact spectrum kernel al- gorithm are very similar with the only difference being that at each step of clustering some of the features that do not match base character may remain in the subset provided that the number of mismatches is no more than m. Number of mismatches can be tracked using an indicator array that is initialized with k. At each step indicator value is reduced by 1 for features that match the base character, then at step l all the features for which indicator value is greater than k − l + m are removed. The filtering step takes linear time. From implementation point of view, exact spectrum and incremental mismatch algorithms utilizing character-based clustering are the same except the filtering step.
A common approach to feature selection relies on the filtering paradigm, when the subset F of the most informative features is extracted prior to learning. In our experiments, we use term-frequency tfc(fi) = num numc((ffii )^ ) for feature selection,
where numc(fi) and num(fi) are the number of times term fi occurs in class c and in all classes, respectively. We characterize utility of each feature fi using
(^3) It should be noted, however, that m = k represents a special case that essentially takes into account only sequence lengths and kernel matrix can be computed in O(N 2 ) time as |Σ|k^ len · len′, where len is N × 1 vector of sequence lengths.
Table 1. Complexity of the mismatch kernel computations
Mismatch kernel matrix
Mismatch kernel matrix with feature selection
Mismatch kernel vector EM N nvk + |Σ|kN 2 N nvk + |F |N 2 N nvk + |Σ|k^ N EM+ Sort
N nk + uvk+ uvN + |Σ|k^ N 2 N kn + uvk + uvN + |F |N 2 N nk + uvk + uvN + |Σ|k^ N DC N nvk + u′N 2 N n|F |k + |F |N 2 N nvk + u′N DC+ Sort N kn + uvk + u′N 2 N kn + uk|F | + |F |N 2 N kn + uvk + u′N EM=explicit map, EM+Sort=EM with presorting, DC=divide and conquer, v=neighborhood size, u=number of different k-mers in the input, u′=number of different k-mers including neighbors
Traditional algorithms for computing string kernels [7, 8, 14] rely on suffix trees and arrays. Exact k-spectrum kernel for two sequences x and y of length n can be computed in O(kn) time using suffix trees. All-substrings kernel problem [14] has also been solved in the linear time using suffix trees and matching statistics. However, it is not necessary to build suffix trees in order to obtain a kernel. Commonly used linear suffix tree algorithms (e.g., Ukkonen algorithm [15]) have large running time constants and large memory requirements. Moreover, in many applications algorithms make no use of suffix links after construction of a tree. In our framework, the exact k-spectrum kernel Kk(x, y) can be computed in time Θ(kn) linear in the length of sequences x and y, however proposed counting sort formalism provides a much simpler and more efficient implementation, as well as minimal memory requirements. Also, in our framework, the k-mer spec- trum kernel can be efficiently computed for N sequences of length n in O(N nk) time and linear space using sorting, resulting in the elimination of the large time constants and storage overhead of the suffix-tree based algorithms [7]. Mismatch kernel over a set S of N sequences each of length n reported in [8, 16] to have complexity of O(N 2 nkm+1|Σ|m). Our divide-and-conquer algorithm for mismatch kernel computation improves this bound and has running time of O(u · km+1|Σ|m^ + u · N 2 ), where u is the number of different k-mers in the input sequences. In [8] mismatch algorithm considers (k, m)-neighborhood of size O(km|Σ|m) for each k-mer. It should be noted that in this case the total number of features considered by the algorithm can exceed the natural upper bound^4 of |Σ|k^. In our divide-and-conquer algorithm for mismatch kernel we take a different approach: our algorithm clusters unique features of S and naturally finds groups of features that are (k, m)-neighbors, size of the resulting clusters (subclusters that correspond to different input strings) gives desired counts of number of times features occur in the input strings.
(^4) For example, one of our datasets contains N =466 DNA sequences of length n = 600, for |Σ| = 4, k = 5, m = 1, u is bounded by |Σ|k^ = 1024, N 2 nkm+1|Σ|m^ is 1.3e+10, u(km+1|Σ|m^ + N 2 ) = 2.2e+08 which is approximately 50 times less.
In our experiments we use three data sets of DNA barcodes. Fish larvae^5 dataset consists of 56 barcode sequences from 7 species. The Astraptes.Fulgerator^6 dataset contains 466 barcodes from 12 species. The number of sequences per species in the second dataset varies from as few as 3 barcodes to as many as 100 barcodes. Finally, a large Hesperiidae dataset has 2185 sequences and 355 classes.
8.1 Classification Performance
We evaluate performance of all methods using the ROC50 score [18] as well as the cross-validation error. In case of the Fisher kernel, profile HMM models are estimated from multiple sequence alignments for each sequence class. For clas- sification, we use the existing implementation of SVM from a machine-learning package Spider 7. In the experiments with feature selection, we preselect a small subset of k-mers before learning a classifier using filtering approach. We compare the performance of full feature kernels and kernels based on the reduced feature set in Fig. 1 on the basis of the number of families with the score higher than corresponding ROC50 score. For the Fisher kernel, ROC50 plots clearly demonstrate that Fisher kernel with feature selection achieves higher performance compared with the full feature set kernel and performs as well as the mismatch kernel with feature selection. However, Fisher kernel offers position information and can therefore facilitate interpretation of the resulting model. Table 2 displays performance results of all six methods on the A.fulgerator dataset. Similar validations are provided in Table 3 for the fish larvae dataset. The performance of the kernels with feature selection (SFK, SSK, SMK) on both datasets is, at worst, indistinguishable from that of full feature kernels (FK, SK, MK). In some cases, as with the Fisher kernel, the feature reduction has resulted in significant improvement (on A.fulgerator dataset, SFK is better than FK with a p-value of 0.0063 as measured by a two-tailed signed rank test). Figure 2 shows performance on the Hesperiidae dataset. The string kernels with feature selection performed extremely well on this dataset obtaining perfect results in more than 94% test cases. Feature selection improved performance for the exact spectrum kernel, and demonstrated performance very similar to that of the full feature mismatch kernel, however the computation cost is significantly lower, as shown in Sec. 5. Average cross-validation error rates on the Hesperiidae dataset are 3. 7 · 10 −^4 for spectrum and 3. 5 · 10 −^4 for mismatch kernels. The use of feature selection for string kernels has resulted in a substantial reduction in the number of features (only 10% of features were selected) for all our test data sets, whereas performance has remained the same or improved. Feature selection for the Fisher kernel not only improved performance, but also even more dramatically decreased the number of features (see Table 2).
(^5) See [3] for the details on dataset. (^6) From Barcode of Life Data Systems (BOLD) collection www.barcodinglife.org. see [17] for detailed description of the dataset. (^7) Available from http://www.kyb.mpg.de/bs/people/spider/.
8.2 Comparison to Other Methods
We compared performance of the string kernel-based method using SVM with a number of other classification methods. In particular, we evaluated Fisher ker- nel method [10], PSI-BLAST, ridge regression and nearest neighbor methods. Table 4 displays classification performance results on the three barcode datasets (note that the complexity of estimating Fisher kernel is very high and the re- sults are not included for the large Hesperiidae set). We observe that k-mer string kernels considerably improve identification accuracy compared to previ- ously reported results of [4, 5] (for example, on Astraptes dataset [17], the test error rate of multi-class SVM is only 0.67% compared to 9% in [5] or 20% in [4]).
8.3 Running Time Analysis
We performed running time analysis of the proposed algorithms to demonstrate their behavior under variety of circumstances, including various feature filter- ing levels, mismatch factors, and sequence feature lengths. We implemented and tested our algorithms in MATLAB. On a 2.8Ghz machine with 1GB RAM (MATLAB v.7.0.4.352), the running time of our mismatch kernel algorithm on Astraptes.fulgerator data set (N = 466, n = 600) is 16.92 seconds and 240.36 sec- onds on a larger Hesperiidae dataset (N=2185, n=600) (to compute full (N ×N )- kernel matrix, k = 5, m = 1). It takes about 2820 seconds and about 20 hours, re- spectively, to compute the same matrices when we used publicly available string kernel package that implements the state-of-art method for spectrum/mismatch kernel^8. Our experiments show order of magnitude running time improvement (Table 5) for the k-mer kernel with m mismatches (by factors of 100-200 times de- pending on the dataset size)^9. We also observe that our extension of the explicit map (EM) algorithm that uses sorting as a preprocessing step results in sig- nificant speed improvements, however the explicit map algorithm requires much larger storage (exponential in |Σ| and k) than the divide-and-conquer algorithm. Table 6 shows running times for mismatch kernel matrix computations with feature selection (filtering level in the table is a fraction of features filtered out). As we can see from the results, EM algorithms do not scale with the number of selected features, while divide-and-conquer approach scales almost linearly. Similarly to kernel matrix computations, extracting unique k-mers from support vectors using sorting (O(N kn) time) accelerates kernel vector computations for new sequences during testing. In mismatch kernel vector computations (Table 7), divide-and-conquer approach outperforms in many cases explicit mapping with sorting, especially for larger k and m (note that for the large k, EM algorithm exceeded memory capacity), which makes our algorithms also particularly suited for the fast identification of new sequences.
(^8) From http://www1.cs.columbia.edu/compbio/string-kernels/ (^9) This improvement is especially significant in light of the differences in the two im- plementations: MATLAB is an interpretive language while the competing package is implemented in C.
Table 5. Running time comparison. Mismatch kernel matrix computation
data set K EM EM+Sort D&C String kernel package Astraptes 5 202.11 3.14 16.92 2820 Hesperiidae 5 938.79 14.73 240.36 75219
Table 6. Computation of mismatch kernel matrices with feature selection (time, s)
Astraptes data Hesperiidae data filt. level EM^
EM+ Sort D&C EM^
EM+ Sort D&C 0.1 212.23 4.03 12.91 961.94 17.75 163. 0.2 212.01 3.62 11.43 964.55 19.83 144. 0.3 185.62 3.88 10.41 982.72 17.20 122. 0.4 193.08 3.76 9.51 974.43 18.73 113. 0.5 193.74 2.31 8.54 989.4 18.56 89. 0.6 196.87 2.30 7.47 969.48 17.37 78. 0.7 192.54 2.51 6.31 977.07 14.85 52. 0.8 200.59 2.51 5.18 964.67 10.73 39. 0.9 184.75 3.60 3.74 966.68 10.57 23.
Table 7. Computation of the mismatch kernel vector (time, s)
k m Astraptes data Hesperiidae data D&C DC+Sort EM+Sort D&C D&C+Sort EM+Sort
5 1 9.25 3.25 3.06 53.36 14.44 13. 6 1 12.64 4.95 3.92 70.70 12.31 18. 7 1 18.01 9.15 5.84 78.39 16.35 48. 8 1 26.58 20.37 9.99 113.46 29.57 - 9 1 39.88 42.70 - 200.62 99.37 - 5 2 33.28 3.9 5.30 197.34 26.23 20. 6 2 53.09 5.71 8.28 354.11 34.92 35. 7 2 80.65 10.14 12.50 537.61 49.31 75. 8 2 121.02 23.79 20.00 797.65 82.53 - 9 2 192.04 70.88 - 1166.6 173.9 -
In this paper, we present a kernel classification based approach to the DNA bar- coding problem that substantially improved identification accuracy compared to traditional approaches. We also present a framework for efficient computations of string kernels that results in substantial speed improvements. We introduce string kernels with feature selection which have lower computational cost and, at the same time, comparable or improved classification performance. Presented algorithmic approaches to implementing string kernels are general and can be applied to many other problems of biological sequence analysis. We have presented a counting-sort formalism and a divide-and-conquer tech- nique for the string kernels that provides a fast and scalable solution for many string kernel computation problems. In particular, for an input set S of N se- quences over alphabet Σ with each sequence of typical length n we developed:
An Θ(knN + min(u, n) · N 2 ) time and O(nN ) space algorithm based on counting sort for the exact k-spectrum kernel; An O(ukm+1|Σ|m^ +u·N 2 ) time divide-and-conquer algorithm for the (k, m)- mismatch kernel; An improved O(N kn + |F |N 2 ) time mismatch algorithm with feature selec- tion for the kernel matrix computation. We have demonstrated that the use of feature selection applied to the high dimensional space of string sequence features can often result in dramatic re- duction in the number of features and may be of particular interest in the DNA