SCALABLE PARALLEL METHODS FOR
ANALYZING METAGENOMICS DATA
AT EXTREME SCALE
By
JEFFREY ALAN DAILY
A dissertation submitted in partial fulfillment of the requirements for the degree of
DOCTOR OF PHILOSOPHY
WASHINGTON STATE UNIVERSITY School of Electrical Engineering and Computer Science
MAY 2015
c Copyright by JEFFREY ALAN DAILY, 2015 All rights reserved c Copyright by JEFFREY ALAN DAILY, 2015 All rights reserved To the Faculty of Washington State University:
The members of the Committee appointed to examine the dissertation of JEFFREY ALAN DAILY find it satisfactory and recommend that it be accepted.
Ananth Kalyanaraman, Ph.D., Chair
John Miller, Ph.D.
Carl Hauser, Ph.D.
Sriram Krishnamoorthy, Ph.D.
ii ACKNOWLEDGEMENT
First, I would like to thank Dr. Ananth Kalyanaraman for his supervision and support throughout the work. I would like to thank Dr. Abhinav Vishnu who encouraged my pursuit of my Ph.D. before anyone else, suggested Dr. Kalyanaraman as my advisor, and has been a valuable mentor and friend. I would like to thank Dr. Sriram Krishnamoorthy for his role on my graduate committee, for his research support at our employer, Pacific Northwest Northwest Laboratory (PNNL), and for his mentoring role while performing my research. I would like to thank Dr. John Miller and Dr. Carl Hauser for being on my graduate committee. Last, but not least, I would like to thank my employer, PNNL, for the tuition reimbursement benefit that assisted my pursuit of this degree.
iii SCALABLE PARALLEL METHODS FOR ANALYZING METAGENOMICS DATA AT EXTREME SCALE
Abstract
by Jeffrey Alan Daily, Ph.D. Washington State University May 2015
Chair: Ananth Kalyanaraman, Ph.D.
The field of bioinformatics and computational biology is currently experiencing a data revolution. The exciting prospect of making fundamental biological discoveries is fueling the rapid development and deployment of numerous cost-effective, high-throughput next-generation sequencing technologies. The result is that the DNA and protein sequence repositories are being bombarded with new sequence information. Databases are continuing to report a Moores law-like growth trajectory in their database sizes, roughly doubling every 18 months. In what seems to be a paradigm-shift, individual projects are now capable of generating billions of raw sequence data that need to be analyzed in the presence of already annotated sequence information. While it is clear that data-driven methods, such as sequencing homology detection, are becoming the mainstay in the field of computational life sciences, the algorithmic advancements essential for implementing complex data analytics at scale have mostly lagged behind. Sequence homology detection is central to a number of bioinformatics applications including genome sequencing and protein family characterization. Given millions of sequences, the goal is to identify all pairs of sequences that are highly similar (or “homologous”) on the basis of alignment criteria. While there are optimal alignment
iv algorithms to compute pairwise homology, their deployment for large-scale is currently not feasible; instead, heuristic methods are used at the expense of quality. In this dissertation, we present the design and evaluation of a parallel implemen- tation for conducting optimal homology detection on distributed memory supercomput- ers. Our approach uses a combination of techniques from asynchronous load balancing (viz. work stealing, dynamic task counters), data replication, and exact-matching filters to achieve homology detection at scale. Results for a collection of 2.56M sequences show parallel efficiencies of ∼75-100% on up to 8K cores, representing a time-to-solution of 33 seconds. We extend this work with a detailed analysis of single-node sequence alignment performance using the latest CPU vector instruction set extensions. Preliminary results re- veal that current sequence alignment algorithms are unable to fully utilize widening vector registers.
v TABLE OF CONTENTS
Page
ACKNOWLEDGEMENTS ...... iii
ABSTRACT ...... v
LIST OF TABLES ...... ix
LIST OF FIGURES ...... x
CHAPTER
1. INTRODUCTION ...... 1 1.1 Quantifying Scaling Requirements ...... 4 1.2 Contributions ...... 5
2. BACKGROUND AND RELATED WORK ...... 7 2.1 Algorithms and Data Structures for Homology Detection ...... 7 2.1.1 Notation ...... 7 2.1.2 Sequence Alignment ...... 8 2.1.3 Sequence Homology ...... 10 2.1.4 String Indices for Exact Matching ...... 11 2.2 Parallelization of Homology Detection ...... 14 2.2.1 Vectorization Opportunities in Sequence Alignment ...... 15 2.2.2 Distributed Alignments ...... 18
3. SCALABLE PARALLEL METHODS ...... 20 3.1 Filtering Sequence Pairs ...... 20
vi 3.1.1 Suffix Tree Filter ...... 20 3.1.2 Length Based Cutoff Filter ...... 23 3.1.3 Storing Large Numbers of Tasks ...... 24 3.1.4 Storing Large Sequence Datasets ...... 24 3.2 Load Imbalance ...... 25 3.2.1 Load Imbalance Caused by Filters ...... 25 3.2.2 Load Imbalance in Homology Detection ...... 26 3.2.3 Solutions to Load Imbalance ...... 27 3.3 Implementation ...... 29
4. RESULTS AND DISCUSSION ...... 31 4.1 Compute Resources ...... 31 4.2 Datasets ...... 31 4.3 Length-Based Filter ...... 32 4.4 Suffix Tree Filter ...... 33 4.4.1 Suffix Tree Heuristic Parameters ...... 34 4.4.2 Distributed Datasets ...... 36 4.4.3 Strong Scaling ...... 36
5. EXTENSIONS ...... 42 5.1 Vectorized Sequence Alignments using Prefix Scan ...... 42 5.1.1 Algorithmic Comparison of Striped and Scan ...... 44 5.1.2 Workload Characterization ...... 47 5.1.3 Empirical Characterization ...... 48 5.1.3.1 Cache Analysis ...... 51 5.1.3.2 Instruction Mix Analysis ...... 52 5.1.3.3 Query Length versus Performance ...... 54
vii 5.1.3.4 Query Length versus Number of Striped Corrections . . . 56 5.1.3.5 Scoring Criteria Analysis ...... 57 5.1.3.6 Prescriptive Solutions on Choice of Algorithm ...... 58 5.2 Communication-Avoiding Filtering using Tiling ...... 60
6. CONCLUSIONS AND FUTURE WORK ...... 64
viii LIST OF TABLES
Page
2.1 Enhanced Suffix Array for Input String s = mississippi$...... 14
3.1 Notation used in the dissertation...... 21
5.1 Relative performance of each vector implementation approach. For this study, we used a small but representative protein sequence dataset and aligned every protein to each other protein. The vector implementations used the SSE4.1 ISA, splitting the 128-bit vector register into 8 16-bit in- tegers. The codes were run using a single thread of execution on a Haswell CPU running at 2.3 Ghz...... 44 5.2 Cache analysis of all-to-all sequence alignment for the Bacteria 2K dataset on Haswell. Scan and Striped are using 4, 8, and 16 Lanes. For both scan and striped, instruction and data miss rates for all cache levels were less than 1 percent and are therefore not shown. The primary difference between approaches is indicated by the instruction and data references. . . . 51 5.3 Cache analysis of all-to-all sequence alignment for the Bacteria 2K dataset on Xeon Phi. Scan and Striped are using only 16 lanes because the KNC ISA only supports 32-bit integers which restricts this analysis to 16 lanes. . 52 5.4 Decision table showing which algorithm should be used given a particular class of sequence alignment and query length...... 58
ix LIST OF FIGURES
Page
2.1 Input string s = mississippi$ and corresponding suffix tree Γ...... 13 2.2 Known ways to vectorize Smith-Waterman alignments using vectors with four elements. The tables shown here represent a query sequence of length 18 against a database sequence of length 6. Alignment tables are shown with colored elements, indicating the most recently computed cells. In or- der of most recently computed to least recently, the order is green, yellow, orange, and red. Dark gray cells were computed more than four vector epochs ago. Light gray cells indicate padded cells, which are required to properly align the computation(s) but are otherwise ignored or discarded. The blue lines indicate the relevant portion of the tables with the table ori- gin in the upper left corner. (Blocked) Vectors run parallel to the the query sequence. Each vector may need to recompute until values converge. First described by Rognes and Seeberg (Rognes and Seeberg, 2000). (Diagonal) Vectors run parallel to the anti-diagonal. Fist described by Wozniak (Woz- niak, 1997). (Striped) Vectors run parallel to the query using a striped data layout. A column may need to be recomputed at most P − 1 times until the values converge. First described by Farrar (Farrar, 2007). (Scan) This is the approach taken in this dissertation. It is similar to (Striped) but requires exactly two iterations over a column...... 16
3.1 Characterization of time spent in alignment operations for an all-against-all alignment of a 15K sequence dataset from the CAMERA database...... 27
x 3.2 Schematic illustration of the execution on a compute node. One thread is reserved to facilitate the transfer of tasks. Tasks are stolen only from the shared portion of the deque and delivered only to the private portion. The set of input sequences typically fits entirely within a compute node and is shared by all worker threads. The task pool starts having only subtree processing (pair generation) tasks but as subtree tasks are processed they add pair alignment tasks to the pool, as well. The dynamic creation and stealing of tasks causes the tasks to become unordered...... 30
4.1 Execution times for the 80K dataset using the dynamic load balancing strategies of work stealing (‘Brute’) and distributed task counters (‘Counter’). Additionally, a length-based filter is applied to each strategy. Work steal- ing iterators are not considered as they performed similarly to the original work stealing approach...... 33 4.2 Execution times for suffix tree filter and best non-tree filter strategy for the 80K sequence dataset...... 35 4.3 Execution times for suffix tree filter for the 80K sequence dataset when it is replicated on each node or distributed across nodes...... 37 4.4 Execution times for suffix tree filter strategies for the 1280K, 2560K, and 5120K sequence datasets. The ideal execution time for each input dataset is shown as a dashed line...... 39 4.5 Parallel efficiency with input sizes of 1280K, 2560K, and 5120K...... 40 4.6 PSAPS (Pairwise Sequence Alignments Per Sec) performance with input sizes of 1280K, 2560K, and 5120K...... 41
xi 5.1 Distribution of sequence lengths for all [5,448] RefSeq Homo sapiens DNA (a), all [2,618,768] RefSeq bacteria DNA (b), all [33,119,142] RefSeq bac- teria proteins (c), and full [547,964] UniProt protein (d) datasets. Protein datasets are skewed toward shorter sequences, while DNA datasets contain significantly longer sequences. Because of the presence of long sequences, figures (a) and (b) are truncated before their cumulative frequencies reach 100 percent...... 49 5.2 Instruction mix for the homology detection problem. For each category of instructions, Scan rarely varies between the three classes of alignments per- formed, while NW Striped executes more instructions relative to any other case. Striped performs more scalar operations, while Scan performs more vector operations. Scan uses more vector memory and swizzle operations, while Striped is the only one of the two that uses vector mask creation operations...... 53 5.3 The relative performance of Scan versus Striped (a-c) shows that both ap- proaches have their merits in light of increasing the number of vector lanes. Shorter queries perform better for NW Striped, SG Scan, and SW Scan. Longer queries perform better for NW Scan, SG Striped, and SW Striped. The reasons for the relative performance differences can be attributed to the number of times the Striped approach must correct the column values before reaching convergence (d-f)...... 55
xii 5.4 Total compute times in seconds (Y-axis) for global (NW, left column), semi-global (SG, center column), and local (SW, right column) alignments using the bacteria 2K dataset for a homology detection application. The lane counts increase moving from the first row to the third row, increas- ing from 4 to 8 and lastly to 16. The fourth row consists of the results for KNC which is also 16 lanes. For each BLOSUM matrix analyzed, the default gap open and extension penalties from NCBI were used as in Section 5.1.3.5. By the time 8 lanes are used, NW Scan consistently out- performs NW Striped. At 16 lanes, Scan begins to outperform Striped for many of the selected scoring schemes...... 59
xiii Dedication
To my wife, Nicole. I’m afraid I have no way to repay you. And to my kids, Abigail, Grace, and Emmett — may you never remember my absence.
xiv CHAPTER ONE
INTRODUCTION
The field of bioinformatics and computational biology is currently experiencing a data revolution. The exciting prospect of making fundamental biological discoveries is fueling the rapid development and deployment of numerous cost-effective, high-throughput next- generation sequencing (NGS) technologies that have cropped up in a span of three to four years (AppliedBio; HelicosBio; Illumina; PACBIO; Roche454). Touted as next-generation sequencing, to now “3rd generation” technologies, these instruments are being aggressively adopted by large sequencing centers and small academic units alike. The result is that the DNA and protein sequence repositories are being bombarded with both raw sequence information (or “reads”) and processed sequence information (e.g., se- quenced genomes, genes, annotated proteins). Traditional databases such as the NCBI GenBank (NCBI) and UniProt (Consortium, 2015) are continuing to report a Moore’s law- like growth trajectory in their database sizes, roughly doubling every 18 months. Other projects such as the microbiome initiative (e.g., human microbiome, ocean microbiome) are contributing a significant volume of their own into metagenomic repositories (Sun et al., 2011; Markowitz et al., 2008). In what seems to be a paradigm-shift, individual projects are now capable of generating billions of raw sequence data that need to be analyzed in the presence of already annotated sequence information. Path-breaking endeavors such as personalized genomics (PersonalGenomics), cancer genome atlas (CancerGenomeAtlas), and the Earth Microbiome Project (Gilbert et al., 2010) foretell the continued explosive growth in genomics data and discovery. While it is clear that data-driven methods are becoming the mainstay in the field of com- putational life sciences, the algorithmic advancements essential for implementing complex
1 data analytics at scale have lagged behind (DOEKB; National Research Council Commit- tee on Metagenomics and Functional, 2007). With a few notable exceptions in sequence search routines (Rognes, 2011; Lin et al., 2008; Farrar, 2007; Oehmen and Nieplocha, 2006; Darling et al., 2003) and phylogenetic tree construction (Ott et al., 2007), bioinformatics continues to be largely dominated by low-throughput, serial tools originally designed for desktop computing. The method addressed in this dissertation is that of sequence homology detection. That is, given a set of N sequences, where N is large, detect all pairs of sequences that share a high degree of sequence homology as defined by a set of alignment criteria. The sequences are themselves typically short, a few hundred to few thousand characters in length. The method arises in the context of genome sequencing projects, where the goal is to recon- struct an unknown (target) genome by aligning the short DNA sequences (aka. “reads”) originally sequenced from the target genome (Emrich et al., 2005). The expectation is for reads sequenced from the same genomic location to exhibit significant end-to-end over- lap, which can be detected using sequence alignment computation. A similar use-case also arises in the context of transcriptomics studies (Wang et al., 2009) where the goals are to identify genes, and measure their level of activity (aka. expression) under various experimental conditions. A third, emerging use-case arises in the context of functionally characterizing metagenomics communities (Handelsman, 2004). Here, the goal is to iden- tify protein families (Bateman et al., 2004; Tatusov et al., 1997) that are represented in a newly sequenced environmental microbial community (e.g., human gut, soil, ocean). This is achieved by first performing sequence homology detection on the set of predicted protein sequences (aka. Open Reading Frames (ORFs)) obtained from the community, and subse- quently identifying groups of ORFs that are highly similar to one another (Yooseph et al., 2007; Wu and Kalyanaraman, 2008). At its core, the sequence homology detection problem involves the computation of a
2 large number of pairwise sequence alignment operations. A brute force computation of