Parallel and Scalable Precise Clustering for Homologous Protein Discovery
Total Page:16
File Type:pdf, Size:1020Kb
Parallel and Scalable Precise Clustering for Homologous Protein Discovery Stuart Byma Akash Dhasade Adrian Altenhoff [email protected] [email protected] [email protected] EPFL IIT ETH Zürich Christophe Dessimoz James R. Larus [email protected] [email protected] University of Lausanne EPFL Abstract are referred to as homologs, and their detection allows the This paper presents a new, parallel implementation of clus- transference of knowledge from well-studied genes to newly tering and demonstrates its utility in greatly speeding up sequenced ones. Homologs, despite having accumulated sub- the process of identifying homologous proteins. Clustering stantial differences during evolution, often continue to per- is a technique to reduce the number of comparison needed form the same biological function. In fact, most of today’s to find similar pairs in a set of n elements such as protein molecular-level biological knowledge comes from the study sequences. Precise clustering ensures that each pair of similar of a handful of model organisms, which is then extrapolated elements appears together in at least one cluster, so that to other life forms, primarily through homology detection. similarities can be identified by all-to-all comparison in each Several sequence homology techniques are among the 100 cluster rather than on the full set. This paper introduces most-cited scientific papers of all time [24]. ClusterMerge, a new algorithm for precise clustering that Current approaches to find similar (homologous) proteins uses transitive relationships among the elements to enable are computationally expensive. The baseline is to perform 2 parallel and scalable implementations of this approach. an exhaustive, all-against-all (O¹n º) comparison of each se- We apply ClusterMerge to the important problem of find- quence against all others using the Smith-Waterman (S-W) 2 ing similar amino acid sequences in a collection of proteins. or another, similarly expensive (O¹n º) string matching algo- ClusterMerge identifies 99.8% of similar pairs found by afull rithm. This naive approach finds all similar pairs, but it scales O¹n2º comparison, with only half as many operations. More poorly as the number of proteins grows. Several databases importantly, ClusterMerge is highly amenable to parallel of similar proteins produced by this approach exist, includ- and distributed computation. Our implementation achieves ing OMA [2] and OrthoDB [26]. Analyzing their contents is a speedup of 604× on 768 cores (1400× faster than a compa- costly. OMA for example has consumed over 10 million CPU rable single-threaded clustering implementation), a strong hours, but includes proteins from only 2000 genomes. scaling efficiency of 90%, and a weak scaling efficiency of The large amount of data produced by many laboratories nearly 100%. requires new methods for homology detection. In a report published in 2014, the Quest for Orthologs consortium, a col- 1 Introduction laboration of the main cross-species homology databases, reported: “[C]omputing orthologs between all complete pro- The ongoing revolution in genome sequencing is generating teomes has recently gone from typically a matter of CPU weeks large and growing datasets whose value is exposed through to hundreds of CPU years, and new, faster algorithms and arXiv:1908.10574v1 [cs.DC] 28 Aug 2019 extensive computation. The cost of this analysis is an im- methods are called for”[21]. Ideally, a new algorithm with pediment to analyzing these databases when the time for asymptotically better performance would find the same sim- processing grows rapidly as a dataset becomes larger, more ilarities as the ground truth, all-against-all comparison. Un- inclusive, and more valuable. Asymptotically efficient algo- fortunately, fast (sub O¹n2º) algorithms — based on k-mer rithms are desirable, but sometimes a tradeoff between speed counting, sequence identity, or MinHash — identify signifi- and precision requires the use of expensive algorithms. In cantly fewer homologs and hence are not practical for this this situation, the time to perform an analysis can be reduced application. In the absence of a better algorithm, a scalable by running on a parallel computer or cluster of computers. parallel implementation of an O¹n2º solution would help This paper describes a new approach to applying parallel keep pace with the production of sequence data. computing to protein clustering, an important technique in the field of proteomes, the analysis of the protein sequences contained in an organism’s genome. Similarities among protein sequences are used as prox- ies to infer common ancestry among genes. Similar genes 1 Byma, Dhasade, Altenhoff, Dessimoz, Larus Our approach extends the idea of clustering [27] into pre- (hundreds to tens of thousands of amino acids), the O¹n2º cise clustering, which ensures that each pair of similar pro- string comparison that exaggerates this disparity, and differ- teins appears together in at least one cluster1. Similar pairs ences in the size of clusters, all of which requires dynamic are then easily identified in the resulting clusters. Tradi- load balancing to achieve good performance. We present tional clustering techniques such as k-means, hierarchical efficient parallel and distributed implementations using this clustering, density/spatial clustering, etc. are difficult to ap- cluster merge approach. Our single-node, shared-memory de- ply because they partition, require a similarity matrix, or sign scales nearly linearly and achieves a speedup of 21× on generally do not achieve sufficient selectivity. Our technique a 24 core machine. Our distributed design achieves a speedup uses the transitivity of similarity to construct clusters and to of 604× while maintaining a strong scaling efficiency of 79% avoid unnecessary comparisons. The key idea is that some on a distributed cluster of 768 cores (90% on larger datasets), similar sequence pairs will have the stronger property of running 1400× faster than the incremental greedy clustering transitively similarity. Formally, if A is transitively similar to of Wittwer et al. [27]. Our distributed implementation ex- B, and B is similar to C, then C will be similar to A. This not hibits a weak scaling efficiency of nearly 100% on 768 cores. only finds similarity between sequences A and B, but also be- ClusterMerge and our implementations for protein sequence tween A and all sequences similar to B. Transitivity avoids a clustering are open-sourced [25] large number of comparisons and reduces the computational This paper makes the following contributions: cost. We exploit transitivity by building clusters of sequences • A formalization of precise clustering using similarity centered on a representative sequence to which all cluster and transitivity. members are similar. Any sequence transitively similar to a • An algorithm, ClusterMerge, that reformulates the cluster representative is added to its cluster. It need not be clustering process in a parallelism-friendly form. compared against the other cluster members, as transitivity • An application of ClusterMerge to the problem of clus- implies its similarity with them. Sequences that are only tering protein sequences that maintains near-perfect similar to the representative are also added to the cluster, accuracy while achieving high parallel efficiency. but they must also be made representatives of their own, new cluster to ensure they are available for subsequent com- The rest of this paper is organized as follows: §2 reviews parisons. In this way, all similar pairs end up together in at related work in clustering and sequence clustering. §3 for- least one cluster. Previous work showed that this approach malizes precise clustering and presents the ClusterMerge performs well for protein clustering [27], but the greedy algorithm. §4 shows how to apply ClusterMerge to precise implementation in that paper was slow and not scalable. protein sequence clustering. §5 discusses our shared mem- In this paper, we generalize the problem of clustering with ory and distributed implementations of ClusterMerge. §6 a transitive relation, introduce a parallel and distributed evaluates the algorithm, systems, and their performance in algorithm, and apply our approach to clustering protein se- this application. §7 discusses future work and §8 concludes. quences. Our new algorithm for precise clustering is called ClusterMerge. The key insight enabling parallelism is that two clusters can be merged if their representatives are tran- 2 Related Work sitively similar since each cluster’s members are similar to Clustering in general has been the subject of considerable the other cluster’s representative (and members). Members research. Andreopoulos et al. survey uses of the techniques of both clusters can be merged into a single cluster with in bioinformatics [4]. Widely known techniques are difficult one representative. If the representatives are similar (but to apply to protein clustering, however. not transitively similar), the clusters exchange elements that Partitioning algorithms require an equivalence relation be- are similar to the other cluster’s representatives. The result tween elements, which is stronger than the not-necessarily of merging is either one cluster or two unmergeable clus- transitive similarity relationship in protein clustering. k- ters (since their representatives are not transitively similar). means clustering requires a target number of clusters, which Merging clusters reframes