GTfold: A Scalable Multicore Code for RNA Secondary Structure Prediction Amrita Mathuriya∗ David A. Bader† Christine E. Heitsch‡ Stephen C. Harvey§ Georgia Institute of Technology Atlanta, GA, USA ABSTRACT 1. INTRODUCTION The prediction of the correct secondary structures of large RNAs is one of the unsolved challenges of computational molecular biology. Among the major obstacles is the fact that accurate calculations scale as O(n4 ), so the computational requirements become prohibitive as the length increases. Existing folding programs implement heuristics and approximations to overcome these limitations. We present a new parallel multicore and scalable program called GTfold, which is one to two orders of magnitude faster than the de facto standard programs and achieves comparable accuracy of prediction. Development of GTfold opens up a new path for the algorithmic improvements and application of an improved thermodynamic model to increase the prediction accuracy. In this paper we analyze the algorithm’s concurrency and describe the parallelism for a shared memory environment such as a symmetric multiprocessor or multicore chip. In a remarkable demonstration, GTfold now optimally folds 11 picornaviral RNA sequences ranging from 7100 to 8200 nucleotides in 8 minutes, compared with the two months it took in a previous study. We are seeing a paradigm shift to multicore chips and parallelism must be explicitly addressed to continue gaining performance with each new generation of systems. We also show that the exact algorithms like internal loop speedup can be implemented with our method in an affordable amount of time. GTfold is freely available as open source from our website. RNA molecules perform a variety of different biological functions including the role of “small” RNAs (with tens or a few hundred of nucleotides) in gene splicing, editing, and regulation. At the other end of the size spectrum, the genomes of numerous viruses are lengthy single-stranded RNA sequences with many thousands of nucleotides. These single-stranded RNA sequences base pair to form molecular structures, and the secondary structure of viruses like dengue [3], ebola [18], and HIV [19] is known to have functional significance. Thus, disrupting functionally significant base pairings in RNA viral genomes is one potential method for treating or preventing the many RNA-related diseases. A G A A A C G U A U GA G A AG A A U U U A A C U A AG A AU AA A C C A AG U G A U A 4050 U G U C A AG C G U AA U A C AA U A U CG U AC G G C A GG UA G G U GA C A A UG U UU GA CC UA U G UGG U A A A AC A UG UCU G AG GCC A U U A CG G U A C A AU C G U A A AG U C A UG C C G C AA G G U C UA G UA A AC AG U G C A U A A A A A C G A CG G GA C G A C CU 4000 C A A AG A A G AU G A A U A AUGU A G U U U AG C C A A UU A AC C C G U A GG C U G C CA G A U C A U U A A A U U C G G G A A G U A 3800 U U U A AA GU C A AG G U C U A A UC C CA G AAC AGG U UA A C A A AGG A U C U AU U U UA G AA U UA 4450 U UG U AG A U A C UA G GA G C U AG U U U A A CA C G G G AA G A GAA A G G UA GUG A CA U CA G A A U G A GC U A C C U AA U GG U AU A G U A U UA G U AA A A G G U GAAA A G GCCC UG G U A A U G G GG GU A UGU C A CU A G AU C AA GC AA4250 UG G CU AA U GU CA UA UG AG AU AA UU 4400 4200 U C GAC A A UG U G C CA C C AAC U G U UGA G AA A A G A A A U GA A A C U A UU U AG GG C C AGC GA AC U C A A A A G A U A U G GC A A A A A GC AAU G G UAA A G AAA AAA C C C G A C A G A A C C G A G C A G 3700 AG G A A A C U A A G U C G G A C A A A G U U U A U U U A C U U G A U C A A C U U G U A G A C A A A A A A G A A C C U U U C U U C G G A G 2450 G U A U A U C G A A A A U A C A A C C C U C G U A A G C C A A G U U A C G G A C A A AA GGA C C G A A U G U A A C U A U A A U U A U G G U A G A C A2350 A A A G C C C G G A G G A G AU A A U A A A A U C C G A C G U C U C G G A U G U C U C C G G G GA A G G G G G C A U U C G C A A C CA U C U C C UU C C U U A U U C C A A U A G 3550A C U A C C U G C A G C A A A C G G U G U C A A G G A G A C G A G CA G U CA C U U U A G A G A G A A A G U A G C A G U A G A A A U AA U G A U A G C A U A A A U G 5000 AA C G A U U A U A A A C A A A G U A A A U A U 4900 C G A G A A A G U 2000 UAAAG C AAAC AC AU AC AG C C U A U A C G A U U A UC A C U U 6000 G G U CG U 5750 G GG C C A U G UG U U UC C A G CAC A U U G AUC AU A C UUG AG C A AA C G CC G A A G A U A C G C A C G G C A A G U CU A A 6050 U CG G U A G C G UC C C CA AG A GG GU G A C G AC C U G A G C A C A G U A C UA A A A A A U U U U A C A C U G A C C G A G C A U G AU A A A U U G C U G A G G C A C U U G A A A6100 C A U U U U G U A A AU U C AAC G AU U GA A C G A G G A G U C A A G U A A G U U A G A C GC A A G U U A A A G G A A G G U U A AG G A C U GA A U U U G A AA U A U A G A A A A G G U A G C AA 6150 U G A A U A U C G A U U G A U C GC C A U G A G A A U A G C U A 6250 GG CA A GA A U AC G C A G C AA GG A U U C C G A C AG C G G AU G A C U U G G A A C A G AG U A G U C A GG A G GA C G A U C G AC CA G G 6300 G A GA G U U U C G G C G C C U A A G AC AC G A U U G A A G G U U AA A A G A U A U A AU AA A U UU UGA A AG 6200 A AU U CA A 5650 A G U 5600 G C G C G A U C A A A AA A U A A C C AA A C G A U A A C G U A A U A U G C A U A C G A A U A G U A U G C A A CACCA G A C G C UA AA U A G C U C C G G G U A A A U G A A C A U A C G G A A GA C U GG U A U UA UA G C GG CC UG C A C U AG A 5700 A A GA A A A U A U UA C G U G U U G A G G UC A A G C C AAGU U A U A AG C G A U A C A U A A A C GG C G C A A G A 2050 G G A U AA A U A U A A 3600 A U A GG C C G G C G G G C U C C AG C C G G U G G A A 4650 C G U A C A G A A A C A U A U A C G G C A U U G U G A G G U U A U G G A A AA A G U C A A G U U G A A U C C C A A GG U A A A G A U C G C G A U U G A U A C A U U A A UC UA G C G C G C G C U A G U A C U U AA UUC G U A U A GC A U A GC A C AU G U U G U G 5800 A C A A A UG U GC C CU G CA U U U C AG G U A CG A C AU UU G C GA G G U 5950 G U C C A A U AA A A G U U C C A A A A 5550 A G C G C G G A A G U C ACA G CA A U A G A U G U U C G A A A G C G C A CA G UC 5500 C C C U A A U A C G A A G C U C U U C A C A G G A 2200 A A G U C C A A G G G G C C G C C A A G G A A C G A A A A C C G U U U G G G A U A 2100 2150 G A G G A A A C A CC GG U GGC CGA A CA U A U U U A A A A A AG 2250 2300 C CAG G A G A A AU U A G A A U AG A G C A U A G G GU CG UA AU A A U U A 4600 G GG G A G A CA C C C U G GU G U A AU U A CG GU G GU U A AA U CA C A A GA U C UA A U C CA G C U U GA A U U A G U A A U G AA A UU A AG A G A A U G C G A U G C UA A U A 5450 G A U CU G U A A A AU U G C G G C AG U U A UU U AG C U G U A UA A C G C U UG AAA A A U G U A G G A G G G U U CA G G CU G G CC G A U A 4850 U A C UU A A A C U G C G A U G U A G U C A C G G C C A U U C A G C GG G C A U C G A G G A AU A A AA U A GA U U G C A 4700 C G A A C A A G U A AG A C AU A U G U G A C G U AC A A A AC C G A U A U A AA A U A C A U A G C A U A A UG U C G C G U A A C G C G AA A GU C U A G C A A G G A U U A C G G C A AG C G G C A U A U C G 5050 C G U A U A G A A A A C G 2400 A A A U G U A G U G C G C G U A AC A A U A CA G A A A A G A A G A U C C GU A A C A A U U U A GA A GC G A G U G AA A A A A U A A G A A C A C U GA A A A A U A ACU 3300 G G U GC A C U A U C U GA A C A U CC A G A C G U A A G A G A A 3500 C U G G G C A A C A A G C G AC A G G A U G A U U GA A A G G U A A U A GUU A U G A U GAG A G GC AA A A C G A A G A GU C A AA UU UA AU A A AG G A C GU CU U U GA C A C G C A A A GGA GU C 3450 AG U G A GA A CU G U 3400 U A A C A C U GU U G C A G A UA U C G GA GC A A C AGU A A G CG U G U UU CG UG 3350 U A C A GC G C A A A U A U C C A A G C GA U U A G G A G U A A U U C C U U U A C U G G A G G G A U G G U A A U 4750 A G A C GA CA G G C U G G G G A G U A 3650 G U A G C A A U C AG A AA A U U U U A GA CU A GG 4550 C C A U A G U G C A A A G U A A C UG AU C GC A C G U A A A G A C U A U A A C U A C C A A A A A G A C 3250 A C G G A A A CAU G C C U U G C G U G A U G U G A C C A A A 4800 AA A GA C A U A G G C A U A G U A A A C A C G G G U A U C G A U G G C G G A U A U U G C A CA U A U A A A A A A G G G U A A A G U A UU G A C U U A G C A G G U 5900 C A U A A U U U U A 5100 G C U A A GA A AG C G C A A G CA C G G U A A G C AU GA A UU A AG U AA AUU CC AG A A A A A A U A UUG C A A U G 4150 AU U A C C A U A C G G U 2900 A A U A C C U G A U A G A A A AU A A G G U U A U A U A U G C C A U 3150 G C C A G U A A A A U G A A G A 3000 U G A A A U C G G U A U C U A U A U G G A A U U GU A U AA G G G A AAA A U A U A AA U AA 2750 U GC A U AA U C A G U C A A AA U G G 2800 U AAU AU A U U UA U A A A U C A G A A A U A U GUA C U G A G U A C CC U A C G C G G G A U A A G G G A A G GG U A G G A U A G G C C U C AC A G G G A AA G A G G U G C A A A C G A U C C A C A C A A U A A A C A A C G A U C C U A G G A C A U C A G U A C U C AA G U A A A A U U AG A U A U A U GA G U G A AG C A A G A A G G A A A A G G A U U G A U C CA G U AC A U U U U A 3050 U U C A A A U UC UA G U C C U A G AA A A A A C G A C A A A UA G U G A G C U 2850A C A ACUG U A A U UC A A 2700 A AUU G G U U C C UA 3200 A A A U G U G UG C C C C G C A A A A A G G C C U G U A G C A G A U U U A A G U G A A G G G A ACU C C G G A U U A C U U A C A A 2600 G U C G ACC U A A A U A G A A U G U A U G UG U G A C U G C U A C A U U C A 3100 A A A A C U 2650 U U A A G A A A A A GA U C C U A U A C AG A C C U 2550 U AA G C C A U G U G A G G G A A C U G U G G A U A G CG A U U C A A A C A G G C G A A C A A U A A A A U A U G A U U A U G G A U U G A C A U A G G A U AU C A A G A U A C G U U U A A A A 2500 C C U G U G U A G C A C A G U C A G A U A C C G U A C A A A C U U G A A C G C U A G UA A G A C A C A A GU A A AG GG U G CC U AU UG G AU U A GAA C A U U G U A U G AU A C U C G U C G CA G G U A A U A GU U U A U G C U A GC C G U G G U A A A G U G U 4300 A A A U C G GU UG CC GA U U AU C G G G G GC A A A G A C A C C CA GGC U A AA U A G U U A U 4500 A A U AA AUC G C U U A AA 4100 G C AG G U G A GC AC G A U A G UG C GU GG UC UA AU GG CU A UU 5850 GA GG A C G AC C AU AG U A C G U C A A U 5400 G G A U G C U A A U G CG G A C G A U UA U A C C G A G C A U U A U A AAGU U A G U C A A A A U UU A U A 3750 A 5350 A A A A U GA A C U A U A A U C G A C GC A ACU A A C C G G CU U GA G U AG U A A G U A G C G C C U UC 3850 AG CA GU CC AG A U GC G A GU A C A C C 5300 5150 A C G UG A 4350 G C A U A U G A C A A A G A UG AU C A AAU G C G C G C G C AG A GG C AU U C GG C C 5250 A U U A AG C A AU UA A A AU A G UA C G CC U GC G GA A U AG C G A U A G G G C C G A G G C C A U AA5200 U U U U A C UG A UG A U A A A U A U C G G C A A U A A UA U A CU G C U GG C A G U C CG A G CU UG U UA A A ACA GUGC CGG AA C A U A G GUC A G A UU G C C A G G A AA G G U A G G 3900 A G A G C 2950 U A U A A U U A 3950 G G C U U U A 1950 A AU A U 4950 A C U UC A G A A G A U G A U A G G C GA C G G G A A G G A C A A G C G U G C G U U G AA G C G C C U A 1900 A U U CA U C A G A A C C A GC G G G C C G A A G G A G A C G G C A U A GC U G A U C G C G U G U A GG C U G G A U U A GU C G U A G C A U A G G A U U A C UG A A A G A A GA UCA U G C U A A U G C U G G 1850 6350 A A C G A G A U C C U U A G GC C A U A C G G CA G U A G C C U U C CG U G 1800 CA G A A A G A A A U G AC A CG U G A A A C C A G U AA C U G AU UU C U C A U G G A U A A G1700 U C A A A C GA U A U G G G A A A A A G A U C U A U C U U G U C AA A A U G C A U A G G AG G A G 1750 C A C U A A A G A U U U U AGA C U A G U C A U A C U G A C U A U A U A A A A A A C U A C AU A G AG A U U G U C C U G UU U G GA C A G G CC A A U C C A G G G G A U U G A A U UA C A G U G C G A G U A UG C U C A G G A CU A G G A C G U G A C U U 9050 C U 9100 C C A A U A U UU G U 6400 G G A A G U A A G G CU C C A C A G G C A A A C U A A U G A C C U C C U U G A G A C U A C G G U G U G A A G A G C G C C G A C C U C G A A U A U G A G A GC C U C G A A A A G A G A A C U CA G U U U A G C A A 1350 U U G A G A U U GC A U G A U A C G G C AG U C G A C U G G G C U C C A G A CG C A CC G C AAA G A A G A U U G A G G C A U C A C CU A G UU G AG G G A U C C A C A A A U A A U G G G A A A UA C A G GG G AU A U A A U C U AC A U C 9200 C C UG AU AG UC CU GC G AC A A U A CAC G C U U U AA A A AA G GA AG A A A C G C A U G U U G A A A A U G G GC GA C AA G A U GA U A C U U U U A A G A G A U G G G A U U A U U U CA C U A A U G U A A A A G A A C U U C U U C G C A 6800 U A A A A G U A U A U A A C C A A G U U A U G G A U U A U G A U A A U G A G U A C U U U U A A U C C A G A C A C C 8400 G U C A G C C C C G A A G A C U C G U G C G C C A G G A A G U U A A C U C C U U C A C U G G G G U C U A AA G U U G U C 6650 A G A C AA C G G C A U A G U A U G A 8900 A C U A A C U G A A A U C G A G A U U G A A U U G G U G A GC A A C U AA A G C G G A G A G AU U G U A U U G A G G G G A A G C C G C A C C C U C G U A U U A A G A U A C C U 8650 G A U G A U G C C G U A U G G C C A G U A C G A A U 6700 G C U A G A G C A GG C 9250 C U 6750 A A G A A C U AG A G C U G U A G G U A U C C U G CC U C C G A A A C 6900 U G A A A C G C C A A U U CAU C C U U U A G G U U A A G G U G G G A U G U U G C A A U C C C U A U G C U U C A U C A G G A G U U C A UU C C G A A CC GG U G AU GU G GG C G A U G U 8500 A G G U AC U G U G 6950 G C C C C G G G U A G A G A U U A A A G C U G G U U U UA U G C G A A A A C G G A C C A U U C G A A A A A A A U A A A U G C G C U A A U A A G A G C A A U U A 8200 A G G A A G A U U A A U U A UA AUA A GACG A U C U G A A C A G G A C C U C U A U G A C A A G C C A U A A U G G C A U A C A A C U A G U A U G A U A A C C A 7000 C C A U U C A A U U AAC A G G G G C G U A G U A A U U C U A G C A C A U A A A 8450 G U GU G G C AC U C A AG G U U C GG CC A A U A UG GAC A 8550 C C U A G G UA A C U G U A A C A G C A G U GA C C A A A U A A G A A A G U A A G GU U C G A A U A G G A A C G A G G A C AG C A A C A A C C A A U A A U A G C U G A A A A U 7150 G C G A C A AC 7050 U A A U G A C G 7100 G U G U G C U AU A U C G C A A C A G UA C G A C AC C U U U U A A A G A U C A U C G A U U G A C G A A C U A C U A C U U U G A A A G A A G A U G A C A C U A A A A A G U U G A U A A A A A A U C U G G A U U G U C G A C A A C A G GA A C U A G A A G C A C A G G G A U C G A U A A G C A 8150 7200 A A U CG U G A G A A A 7300 A G A U C U U A A U U A U A G A AG G GU U A C AA A A A A C C A A A U U U A C U G A G G G G C A AU G U U A C A U A G C G G G AA A A U G G A C A G A A U C U C G A C A A A A A G G A A C C U A G G U C A C A G A 7250 A G U G G A A A U G G A G A U A U G A U U A G 7350 C A C U U U C A AA U AA U A A A 8100 G G A A AG C A A U A U G C G U U A A 7400 A A U A U A C U U A U A A A G U U U A A G A U U G A U G A C U AU U AC A A A A A GU U A G C A G U C C U A A U A G C C C A A U U A G C G UA GA U GU G U G A A A A C C U A A A A G G G U A U G A C U G U AA G A U AA U A G A U A A A G G A G GA GA G A A A A G AG AC A G G A U C G U C G G G A U U U U C G CG U U U U U C U A G U A U C G GA C A U A C C A U A AC G U U UG C UG A C C A 7650 G A U U C G G G U A C A A C A C A C A U A G U U G U U U A CA A C CU CU U C C C C CU C U G A UG A A A A G G A U G C A U 7700 7750 U A U A G U U U A U A U C U 7600 A G A A C A A A G G G G G A G G G U A G G A G U G U C A C U U C G A A C A A A U C G A A AA A A U U A G U G A C C C U C U C C C A A U G U A C G C G A G A G G A A A U C U A A G U G A G A G A A C G G U GUAA GA A G U A C A C G G G A U AG A GA C GU C A G U 7550 7450 U A A A A U C A U A U A C G U C A A G A A A U A A A GAG C A A U G AA CA G G U AC C C G AA A U GUG G A C AAUAAG G C A C 7500 A G GAGA C G G A U G U U A A U A G G G G A AG U G C C CG C 7800 C U C U C U U G UA U G U G U A A C A A A A A 8050 U G C G C C G G AUU U U G U C U G G A G U G A G U C G A U C U C C A G G G U U AG U A G A A C A A 8000 G C U G A U G G A G C G G A G U C C U A A A C GC A A U GC U A G A G U A U U A U U U A A G C G U U 8250 A U A C GA G U C A G U A U G U C G A U A C A C C A A G A U G G G A U AG G GG C A U U 8800 U A U G G A G C U C U G U G A A G G U A G C C G U G A U U G G UG U G U A U A G C A A C U U G C G A A C AAG C A AU C U A C C A 6850 U G C U G A U G U U G G U U G A A C U A U U G U C G G A U A C A C C U A A C A G U U A A U A U C A U U G G U A G U C G A GU A A U G U U A U U U G 8300 A G U A A U A G U U U C G U U A A G A U G G G U A A C G U A 8350 U C A U A A C G C G U C GA U A G A UU C C G A A A A C G U A U A A A C A U 8600 C G C A G A G U AC G AC G UG U A8750 UC C AG A 8700 A AU U GU AC A G UG G A AC C GA G U U AG A C C UC U G AU A G U A G U U C A A U G G G C G U G G G A U A G U C U G AC C 8850 U G AG G A U CA G AC G U AU A G G G GC A AU A U G C G G G C G U A G C A U G C G U G A G A A 7900 G C G G G C A A U C U A A C C C G G C U A 7950 C G U U G G U G G G A U G ACA A G U A A A UU G U U G A C U C C CA G C G G U U UC U C G C A C C CA G G GC C U AGAG A AG AG CC G UG G C GA U A GA A U UC C A A CU A U GG C C G G CU A G U G U AA C U A A C U G C GA U G U 7850 A G A A U C G C G G G UU A U C GG C A G A C U U U AAA C G A A U C G G C C G C G G G C AG U C G U G G C C A A U A A 9500 C U U C G U GA G C G C A G C C G G G C AG C G C G G C U A U G U A C C C G A C G U A C U UU C A G C A U UA U C G A C U A G C CC G A GA G U A C CA AUGG A GA C U A AA U G A A A AG U AU U C G U G C A C U C A G C U C A G C U G G C C A C 6550 G U C A U A A A A U G G G A A C C U A 6500 C U A A C G C A G C A U U C C C A A A A G A A A C A U A A G U G G U A A G A U A A U U G U U U G U U C G A G U U G U A G A U A U A A C GA A AA A U U G A C A G G U U U G A U G A A A C AC C A G G A G A C A C U G U G U A A A G C A A A U G C G A C 8950 A C U A U G 6600 C A C C A U G A G A A A C C G U G A U G U G G A U A A A C C A A A G C A A C G A GG C AG G A U A A C G 9450 U A G C 1300 A U A U GA G A U A A A G U A A C G G A U C A A U AG C U A G A U A U C 6450 A G A G G U A C U C A C G U G U C A G G CA G C UAA U C GAG U C U A CG A A G U G C C G A U U G C G A U U GA G C A 9350 AA A C G G CG CA C U A A A GCU G 9400 C G UC UA G G C C G C C AA G U A U C C G A U GC U AU G U G A UG A G GU U A A A G A C 1400 A C A G A A A G C A U A U A U C G U A A G A U U U U G U G C G A A C A C G A A A AG GU AGG C UA CCA C CA A GG U CU GC A AC CA A G A AA U U CU U C AG G U A C UC A A U C U A C AG U CU U G A G G C G C G U AGA U A G A G G A C C A G C U A G UG 1450 C U C U G A G G A 9000 CC G A A G C A U C A CU A AA 9150 AGAG A U A G A C GG AC G G G C A U U C G G A U A A C CA G C G C A 1500 UU G A A C C U G A G U A U C A A C U G A A A G A A U AC U G U U G A A G G A A A CA CA G 9300 A C C G G C A U G U A C G G A A U UC AA G A 1550 U A G C A G A UA C G U AG C C U U C UC C G A G G U A C G AU U U C A U A CA G G GA A U 1600 C A C U A UA A A C U A U G G U A A U U A A U G A A G A G U A G A U A G AA G A 1650 A A U A A A U A A C G C G C G G C U C C C G C G A U A A G A C G A C U 1200 1250 U A U C G A A G C G C A C A U C G G C G G A U C G G UU A U C A C G A G GC AAUA UA G C U A G C C G U G G C C G A U C G C G U AC G C A A U G C A U U G U C G A U A U U G C G C G G GC C A U A GAA A A U G A A A A C A A 1150 G G U G 9550 G G C A U G C G U G C A U U G C G A A U U U A C G A G C G C U A C G U AU C U C G G C A G AC U C G A G C A A A U G C A U A A G 9650 A A U A C G A G G A C G G U A A C C C A U U A U A U A C C C G A GC A U AA A A U C A U 9600 C G C G G C C G C G A U G U A A AG U G C UA GA A A C A G C AG U GA C G C U AA U C G C U G G U AA U C AGA U A G G A A A C GG U GA U A A C G C G G U G C A G 950 A U U C G A G C G G C A G C A U G A A G 1100 U CA A UA G G U UA UA AU G A GC U U U A U C AG G G UC U C CA A U AG G C U A G C UAC C A A C U C C A G G AU U U U G A U A G A U G C A U 1050 AA A U C G A U U C A G U A 9700 U G G C G A U U 900 A A A A A A A A G G A A A G GC AG A U U G C A U U A C G C G G U C G A U A AC A C G A A G A G U A A C G U AU G UA AA U AG C U G C G C U G A 1000 G A C G U G U U A G A U U C U G U G U AA C A C A G A C U C C C U A CC A A C A G A C A G G C G C A U A A U C G A C G U A G A G A A G UU A U A A A A G G U G C A A A A 850 G U G A A 9750 C GU GC C A G G G U A G G AG G A G A C G C UA U A U G U A U G A C U A C G G U G C GA A G UAAG G C U A GCA C U U G A UUG U U A A A A ACG CU A G 800 A U C GG G U AU G GG U AG GC G ∗ College of Computing, Georgia Institute of Technology College of Computing, Georgia Institute of Technology ‡ School of Mathematics, Georgia Institute of Technology § School of Biology, Georgia Institute of Technology † Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. SAC’09 March 8-12, 2009, Honolulu, Hawaii, U.S.A. Copyright 2009 ACM 978-1-60558-166-8/09/03 ...$5.00. G G C A A A U U U C U C G U G C U A G C A U G C G C G G C CU A G G G A CUGGA G U CU G GA CU C U GA C C AA U AG GU A CU G CU G G GC G U A U C U C G C U G C UG U A U G UC AU GG C C G CC G C G C G G U G A AG G G G A A U U 350 A GAC UUU A G C AG UC C G UG GC C G U AC U A U A GU GG C G C C G A U CC U A G G GG CC G U GG A U A U U 400 C G U C G C A C U GG G C U C U G G A CU G G CC A A G G G U UG A C A A G U U CCA A A A C AA C A U GG C A UCCGGG U GAA CU U G G A G AC G U A U GA C U A A U C AC G UA G A C GAG AG C A A U U UA C A A U 50 C U A G C GA C U C G UC U AG C A GC U G AG C CC G U A UA G A C G GUC AG C G UC C AG A AA U CA G AA AU G G U U C GA U A G C G G A A U U U G C G A 200 U A U A U C G C G A G C G A C C C C A A G A G A GA AU C U A C G G CC U A UU 150 G G C U A UA AU CA C C GU A G UG U A U G CG C A A C G G C C A C U Computational Biology, Parallel Algorithms, Ribosomal and Viral RNA GCU G A U A C U C G A UCG GU U UAA U C U G C GCA U C G CC G G AC U CG UC C U GA GA CA A GA U A A A A G 700 GG U U A GU UA CUA G C A U G 650 U U G U A A 5’ C G C G C G 450 C Keywords A A U A A G C A C U U U G C C U A A U A C G GC CC GG GU UG CG GC G C A CG GG A 550 A AG C G AC AGUAC UU U GU C GC CA A U UG G GA C GC UUU G 600 G U U C G 500 GC C AGU C U A G 750 G A C C C G C C G C A C C A G G 100 AU U G U C G GA G CG C A C CA CG G U A U AU G G C C G A G C A U A U A C AU GG C A U C G 300 A A GA AU C C C U G A C U G G C G U G A A G AA UU UG AC C U AC GC G A A A C U U A A 250 G U A U U A C G A C G G U G A C G C G A G C G A G U U U Figure 1: The optimal secondary structure of an HIV-1 virus with 9,781 nucleotides predicted using GTfold in 84 seconds using 16 dual core CPUs. The minimum free energy of the structure is -2,879.20 Kcal/mole. Viral sequences range in length from about 1,000 to over 1,000,000 nucleotides in the recently discovered virophage. Length of the viral sequences poses significant computational challenges for the current computer programs. Free energy minimization excluding pseudoknots is a conventional approach for predicting secondary structures. The mfold [21, 12] and RNAfold [9] programs are the standard programs used by the molecular biology community for the last several decades. Recently, other folding programs such as simfold [1] have been developed. These programs predict structures with good accuracy for the RNA molecules hav- ing fewer than 1,000 nucleotides. However, for longer RNA molecules, prediction accuracy is very low. According to the thermodynamic hypothesis, the structure having the minimum free energy (MFE) is predicted as the secondary structure of the molecule. The free energy of a secondary structure is the independent sum of the free energies of distinct substructures called loops. The optimization is performed using the dynamic programming algorithm given by Zuker and Stiegler in 1981 [22] which is similar to the algorithm for sequence alignment but far more complex. The algorithm explores all the possibilities when computing the MFE structure. There are heuristics and approximations which have been applied to satisfy the computational requirements in the existing folding programs. One potential approach to improve the accuracy of the predicted secondary structures is to implement advanced thermodynamic details and exact algorithms. However, while the incorporation of these improvements can significantly increase the accuracy of the prediction, it also drastically increases running time and space needs for the execution. We use shared memory parallelism to overcome the computational challenges of the problem. We have designed and implemented a new parallel and scalable program called GTfold for predicting secondary structures of RNA sequences. Our program runs one to two orders of magnitude faster than the current sequential programs for viral sequences on an IBM P5 570, 16 core dual CPU symmetric multiprocessor system and achieves comparable accuracy in the prediction. We have parallelized the dynamic programming algorithm at a coarse-grain and the individual functions which calculate the free energy of various loops at a fine-grain. We demonstrate that GTfold executes exact algorithms in an affordable amount of time for large RNA sequences. Our implementation includes an exact and optimized algorithm in place of the usually adopted heuristic option for internal loop calculations, the most significant part of the whole computation. GTfold takes just minutes (instead of 9 hours) to predict the structure of a Homo sapiens 23S ribosomal RNA sequence with 5,184 nucleotides. Development of GTfold opens up the path for applying essential improvements in the prediction programs to increase the accuracy of the predicted structures. The algorithm has complicated data dependencies among various elements, including five different 2D arrays. The energy of the subsequences of equal length can be computed independently of each other without violating the dependencies pattern introduced by the dynamic programming with a set of five tables. Our approach calculates the optimal energy of the equal length sequences in parallel starting from the smallest to the largest subsequences and finally the optimal free energy of the full sequence. We also describe the nature of individual functions for calculating the energy of various loops and strategies for parallelization. 2. RELATED WORK Several parallel approaches have been taken for RNA secondary structure prediction. Nakaya et al. [14] presented an approximation approach for generating secondary structures using minimum free energy criterion. The parallel approach enumerates all stacking regions of an RNA sequence and combines the ones which can coexist together to produce multiple secondary structures. Another parallel approximation approach by Taufer et al. [17] samples the RNA sequence systematically and extensively and rebuilds the whole structure by combining the structures of the chunks according to various criteria. However, these approximation approaches do not explore the entire search space and can miss the candidates that do not follow the usual behavior. Also, the success of these kinds of approaches is dependent upon the ability of rebuilding methods to identify motifs correctly by consistently combining the substructures into a full structure. Several distributed memory implementations [9, 8, 5] for RNA secondary structure prediction have been developed which parallelizes the exact dynamic programming algorithm for free energy minimization. Hofacker et al. [9, 8] partition the triangular portion of 2D arrays into equal sectors that are calculated by different processors and data is reorganized after computing each diagonal in order to minimize the space requirements. In this implementation the tables are not stored permanently due to which traceback for all suboptimal secondary structures is not possible. Fekete et al. [5] uses a similar technique to parallelize the folding procedure and increases communication to store the tables in order to facilitate the full traceback. However, these implementations may not be portable to current parallel computers and also the implementation of the optimized algorithms such as internal loop speedup algorithm whose access pattern differs from the general access pattern become complex for distributed memory environment. In [8], the authors observe that to fold the HIV virus, memory of 1 to 2GB is required, dictating the use distributed memory supercomputers; yet in our work, we demonstrate that this can now be solved efficiently on most personal computers. In our work, for the first time, we give scientists the ability to solve very large folding problems on their desktop by leveraging multicore computing. Zhou and Lowenthal [20] also studied a parallel, out-ofcore distributed memory algorithm for the RNA secondary structure prediction problem including pseudoknots. However, their approach does not implement the full structure prediction but rather studies a synthetic data transformation that improves just one of the dependencies found in the full dynamic programming algorithm. 3. RNA SECONDARY STRUCTURE RNA molecules are made up of A, C, G, and U, nucleotides which can pair up according to the rules in {(A,U), (U,A), (G,C), (C,G), (G,U), (U,G)}. Nested base pairings result into 2D structures called secondary structures. There are 3D interactions among the elements of the secondary structures which result into 3D structures called tertiary structures. Pairings among nucleotides form various kinds of loops, which can be classified based on the number of branches present in them. Nearest neighbor thermodynamic model (NNTM) provides a set of functions and sequence dependent parameters to calculate the energy of various kinds of loops. The free energy of a secondary structure is calculated by adding up the energy of all loops and stacking present in the structure. Figure 2 shows an MFE secondary structure predicted by GTfold of a sequence with 79 nucleotides. Various loops annotated in the figure are named as hairpin loops, internal loops, multiloops, stacks, bulges and external loops. Loops formed by two consecutive base pairs are called stacks. Loops having one enclosed base pair and one closing base pair are called internal or interior loops. Internal loops with length of one side as zero are called bulges. Loops with two or more enclosed base pairs and one closing base pair are called multiloops or multibranched loops. The open loop which is not closed by any base pair is called an external or exterior loop. Hairpin Loop 30 A A A A C G C Internal Loop G G C G C G 20 C G A A C A A A A C A A G C 40 G G Multiloop Hairpin Loop C C 10 G G A C G A A 50 A C A A A A G CA C G G C C G 5’ G C C G A A A A C G C G C G A G C G C G C A A A A A 70 60 Stack External Loop Figure 2: A sample RNA secondary structure with 79 nucleotides. 4. THERMODYNAMIC PREDICTION ALGORITHM Prediction of secondary structures with the free energy minimization is an optimization problem like the SmithWaterman local alignment algorithm. There is a well-defined scoring function which can be optimized via dynamic programming, and structures achieving the optimum can be found through traceback. However, while sequence alignment can be performed with one table and a relatively simple processing order, RNA secondary structure prediction requires five tables with complex dependencies. Each class of loop has a different energy function which is dependent upon the sequence and parameters. For the internal loops and multiloops with one or more branches, all enclosed base pairs need to be searched which make the loop optimal for the closing base pair. The algorithm can be defined with recursive minimization formulas. Simplified recursion formulas are reproduced here from [11] for convenience. Pseudocode of our algorithm that implements thermodynamically equipped recursion formulas is presented in the technical report [13]. Consider an RNA sequence of length N , free energy W (N ), and index values i and j which vary over the sequence such that 1 ≤ i < j ≤ N . The optimal free energy of a subsequence from 1 to j is given with the following formula: W (j) = min{W (j − 1), min {V (i, j) + W (i − 1)}} 1≤i<j (1) In Eq. (1), V (i, j) is the optimal energy of the subsequence from i to j, if it forms a base pair (i, j). It is defined by the following equation. ⎧ eH(i, j), ⎪ ⎨ eS(i, j) + V (i + 1, j − 1), V (i, j) = min ⎪ ⎩ V BI(i, j), V M (i, j) (2) Eq. (2) considers loops that a base pair (i, j) can close. The eH(i, j) function returns the energy of a hairpin loop closed by base pair (i, j). Function eS(i, j) returns the energy of a stack formed by base pairs (i, j) and (i + 1, j − 1). V BI(i, j) and V M (i, j) are the optimal free energies of the subsequence from i to j in the case when the (i, j) base pair closes an internal loop or a multiloop, respectively. V BI(i, j) = min i<i <j <j where, i − i + j − j − 2 > 0. The formulation of the multiloop energy function has linear dependence upon the number of single stranded bases present in the multiloop. The standard is to introduce a 2D array W M to facilitate the calculation of V M array. Eq. (4) and (5) shows calculations of W M (i, j) and V M (i, j) respectively. ⎧ V (i, j) + b, ⎪ ⎨ W M (i, j − 1) + c, W M (i, j) = min ⎪ ⎩ W M (i + 1, j) + c, mini<k≤j {W M (i, k − 1) + W M (k, j)} (4) {eL(i, j, i , j ) + V (i , j )} (3) V M (i, j) = min i+1<k≤j−1 {W M (i+1, k −1)+W M (k, j −1)+a} (5) These minimization formulas can be implemented recursively as well as iteratively. We implement an iterative formulation of the algorithm in GTfold, described later in this paper. The implementation uses various 1D and 2D arrays corresponding to W (j) and V (i, j), V BI(i, j), V M (i, j), W M (i, j) values. Also we use calcW (j), calcV (i, j), calcV BI(i, j), calcV M (i, j) and calcW M (i, j) functions to calculate the values of W (j), V (i, j), V BI(i, j), V M (i, j) and W M (i, j) array elements. 4.1 Parallelism The dynamic programming algorithm is computationally intensive both in terms of running time and space. Its space requirements are of O(n2 ) as it uses four 2D arrays named V (i, j), V BI(i, j), V M (i, j) and W M (i, j) that are filled up during the algorithm’s execution. The main issue is running time rather than memory requirements. For instance, GTfold has a memory footprints of less than 2GB (common in most desktop PCs) even for sequences with 10,000 nucleotides. The filled up arrays are traced in the backwards direction to determine the secondary structures. The traceback for a single structure takes far less time than filling up these arrays. Time complexity of the dynamic programming algorithm is O(n3 ) with the currently adopted thermodynamic model. The two indices i and j are varied over the entire sequence, and every type of loop for every possible base pair (i, j) is calculated. This results in the asymptotic time complexity of O(n2 )× maximum time complexity of any type of loop for a base pair (i, j). Computations of internal loops and multiloops are the most expensive parts of the algorithm. We can see from Eq. (3) that, in the calculation of V BI(i, j), all possible internal loops with the closing base pair (i, j) are considered by varying indices i and j over the subsequence from i + 1 to j − 1 such that i < j . This results in the overall time complexity of O(n4 ). To avoid large running time, a commonly used heuristic is to limit the size of internal loops to a threshold k usually set as 30. This significantly reduces running time from O(n4 ) to O(k2 n2 ). The heuristic is adopted in most of the standard RNA folding programs. Lyngsø et al. [11, 10] suggest that the limit is a little bit small for predictions at higher temperatures and give an optimized and exact algorithm for internal loop calculations which has the time complexity of O(n3 ) with the same O(n2 ) space. The algorithm searches for all possible internal loops closed by base pair (i, j). Practically, this algorithm is far slower than the heuristic. Choosing one of the options is a tradeoff of running time versus accuracy. In GTfold we provide an option for the user to select the heuristic or internal loop speedup algorithm. Also, our parallelization scheme is valid for both the options. Thermodynamics of multiloops are still not understood fully, but improvements continue to be made. Searching for an optimal multiloop closed by a base pair (i, j) requires searching for all enclosed base pairs which make the loop optimal. To make the multiloop energy function feasible to compute, it may be approximated in O(n3 ) time. This function has linear dependence upon the number of single stranded bases in the multiloop. Time complexity of the algorithm to implement a relatively more realistic multiloop energy function having logarithmic dependence upon the single stranded bases in the loop is exponential. Also, many other advanced thermodynamic details such as coaxial dangling energies are not implemented in the multiloop energy calculations during the optimization, as it significantly increases the running time. Both running time and space needs are expected to increase with the use of better thermodynamic models. While memory requirements can be satisfied with today’s high-end servers with 256GB or more memory, running time will continue to play as a major prohibitive factor in solving these grand challenge problems. Our parallelization approach in GTfold is designed to keep all these factors in consideration. 5. the sides is less than a constant c. The algorithm scores these small internal loops as special cases by applying a function derived from the general internal loop energy function. If an enclosed base pair (ip , jp ) is better than another candidate of the enclosed base pair (ip1 , jp1 ) for the closing base pair (i, j) where jp − ip = jp1 − ip1 , then the enclosed base pair (ip , jp ) will also be better than (ip1 , jp1 ) for the closing base pairs of the form (i − b, j + b), where b is a positive integer such that 1 ≤ b ≤ min{i − 1, N − j}. This algorithm uses the best enclosed base pair (ip , jp ) for the closing base pair (i, j) to evaluate all internal loops closed by the base pairs of the form (i − b, j + b) at the same time. This way, at element (i, j), the elements of the form (i − b, j + b) are also accessed. The access pattern of this algorithm is shown in Figure 4 excluding the calculation of special cases. j i GTFOLD 5.1 Dependencies and Access Patterns Figure 3 shows a general ij plane. A valid base pair is defined as (i, j) where j > i. Thus, only the upper right triangle is valid. Secondary structures can have only nested base pairings, meaning if there are two base pairs (i, j) and (i , j ) such that i < i < j then the constraint i < i < j < j is also satisfied. This assumption of nested base pairings results in the general dependency of an element (i, j) on the elements in the Δ ABC as shown in Figure 3. To find the optimal loop formed by a base pair (i, j), we need to search for all enclosed base pairs over the subsequence from i + 1 to j − 1. In the case of internal loops we need to search for one enclosed base pair while for a multiloop we need to search for more than one base pair. In this fashion, the computation of all types of loops for an element (i, j) follows the above dependency pattern. j Figure 4: The access pattern of V BI(i, j) for the internal loop speedup algorithm 5.2 Approach In the region of the general 2D ij plane corresponding to j > i, a point (i, j) corresponds to the computation of energy of the subsequence from i to j. The dependency pattern shown in Figure 3 allows the calculation of all the elements existing on a line j−i = k to be independent of each other, where k is any integer from the set {0, 1, 2, . . . , N −1}. This way the computation on the line j − i = k can be performed in parallel, and the whole space can be computed by considering subsequent lines from k = 0 to k = N − 1. Note that the points on one of the lines corresponds to the equal length subsequences. j B A (i, j) i i C Figure 3: The implicit dependency of point A on the elements present in the triangle ABC The speedup algorithm for internal loop calculations follows the same general technique but its access pattern differs. It updates the elements outside the dependency triangle Δ ABC shown in Figure 3 for the element A. It is an optimized algorithm to reduce the space complexity. We define a small internal loop as a loop in which at least one of Figure 5: Showing the pattern of computation implemented in GTfold Algorithm 1 arranges the nested for loops to compute in the manner described above. The first for loop runs for different lines starting from j = i to j = i + N − 1 and the second for loop calculates all the points on one line in parallel. Figure 5 shows the sequence of these computations. This parallelization strategy is suitable for future improvements to the thermodynamic model or to optimizations for computing the various energy functions. This coarser level of parallelism enables us to exploit more concurrency while offering compatibility for possible future improvements. There are other orderings of the computation that cover the whole space without violating the dependency pattern. One way is to compute the elements column-wise, starting from j = 1 to j = N . On one column the computation is done for the increasing values of j − i, i.e. from row i = j to row i = 1. A second way is to compute the elements row-wise, starting from i = N to i = 1. On one row the computation is done for the increasing values of j − i, i.e. from column j = i to column j = N . These two ways achieve a higher degree of spatial locality but they are inherently sequential. input : Sequence of Length N output: Optimal Energy of the sequence begin for b ← 0 to N − 1 do #pragma omp parallel for schedule (guided) for i ← 1 to N − b do j ← i + b; calcVBI(i, j); calcVM(i, j); calcV(i, j); calcWM(i, j); end calcW(b + 1); end return W (N ); end Algorithm 1: Main function to compute the secondary structure of an RNA sequence 5.3 Implementation Details We use OpenMP [15] to implement shared memory parallelism. All the subsequent diagonals are considered with the upper for loop and parallelism is implemented by applying an OpenMP for loop pragma over the inner for loop to parallelize the computation on the diagonal in consideration as shown in Algorithm 1. The guided scheduling strategy works best for this parallelization. This is because there may not be equal amounts of work for every point on the diagonal. If the bases i and j are not able to make a pair then it is not necessary to compute for the whole calculation. In this case, for the heuristic option of internal loop calculations, only W M (i, j) needs to be calculated. And for the speedup algorithm V BI(i, j) also needs to be calculated with W M (i, j). We explore the function level parallelism for the last few diagonals by deciding a threshold variable A, such that the parallelism is implemented at the higher level for the diagonals up to j − i = A and implement only the function level parallelism starting from the diagonal j − i = A + 1 to j − i = N − 1. This facilitates the use of more threads to exploit more parallelism at the time when there are not enough points on the diagonals. However this technique did not give us a performance advantage. Cache locality For this algorithm the ratio of computation to the memory accesses is low. Energy of a secondary structure is calculated by adding up the energies of various loops present in the structure. Energy of a structure is the sum of various energy terms of which some are read directly from the energy tables and others are calculated by the program. Therefore, large cache sizes and locality in reference for accessing various data elements play an important role in reducing the running time of GTfold. Computing the elements row-wise or column-wise as described in Section 5.2 provides better cache locality than computing the elements on the subsequent diagonals. However, these two ways are inherently sequential. Parallelism at individual functions 6. EXPERIMENTAL RESULTS Parallelism can also be exploited at the finer level of individual functions which compute the energies for the various kinds of loops for a closing base pair (i, j). The general pattern of different functions for calculating the energy of these kinds of loops is the same except for the function that computes internal loop energies using the speedup algorithm. The general pattern is to consider various possible options of the corresponding type of loop and select the option that gives the minimum energy. In simplified terms, this pattern of calculation performs minimization over several possible values. These types of calculations are easily done in parallel by assigning equal-sized chunks of minimization work to all threads, collecting the results, and taking the global minimum over all values. The speedup algorithm for internal loop calculations can be parallelized only for special cases. The computations of general internal loops using the extension principle are inherently sequential. However the generally adopted heuristic option for internal loops has the general minimization pattern, is easily parallelizable, and uses two nested for loops which results in a complexity of O(k2 ) for a particular (i, j). Multiloop calculations also follow the general minimization pattern for the V M and W M arrays, have O(n) time complexity for an element (i, j), and are amenable to parallelization as well. We have performed several experiments to establish that GTfold runs faster than competing folding programs such as mfold and RNAfold and achieves accuracy comparable with them. For the running time and accuracy comparisons, we are using RNAfold distributed with Vienna RNA Package version 1.7.2 and UNAFold version 3.6, which supersedes mfold. 6.1 Energy and Structure Comparison To establish the accuracy of GTfold, we compare the structures obtained from GTfold, mfold, and RNAfold, with the correct structures determined with the more reliable method of comparative sequence analysis [6, 7]. Please note that the comparative sequence analysis method requires large data sets for the prediction of secondary structures, and therefore, its application is limited with the availability of the required datasets. Doshi et al. [4] take a phylogenetically diverse dataset of ribosomal RNA sequences and compare the optimal secondary structures predicted using mfold 2.3 and mfold 3.1 with the correct structures. Here we are using the 16S and 23S ribosomal RNA sequences from Figure 1 and Table 4 of their study [4] for accuracy comparisons and are taken from the Gutell database [2]. We provide a GenBank accession number for each of these sequences. For predicting structures with UNAFold and RNAfold their command line default options are used. Accuracy of the structures is calculated in the same manner as in [4] with one difference. We include non-canonical base pairs in the comparison instead of excluding them. This affects the accuracy of all three programs in the same manner because none of them is able to predict non-canonical base pairs due to the lack of energy parameters for them. The accuracy is calculated as a percentage of correctly predicted base pairs which are also present in the correct secondary structure. Table 1: Free energy (in Kcal/mole) comparison of GTfold, UNAFold and RNAfold for 16S rRNA sequences Sequence Length GTfold UNAFold RNAfold X00794 1962 -741.90 -722.70 -746.60 X54253 701 -149.00 -141.30 -149.03 X54252 697 -142.50 -137.50 -142.52 Z17224 1550 -564.80 -549.10 -565.12 X65063 1432 -582.00 -570.80 -581.94 Z17210 1435 -761.90 -626.60 -762.70 X52949 1452 -802.70 -794.50 -804.40 X98467 1295 -487.00 -460.00 -489.31 Y00266/M24612 1244 -325.60 -317.30 -328.80 X59604 1701 -573.00 -491.40 -574.70 K00421 1474 -687.00 -682.10 -687.01 Table 2: Accuracy comparison (in percent) of GTfold, UNAFold and RNAfold for 16S rRNA sequences of Table 1 Sequence GTfold UNAFold RNAfold X00794 30.33 31.65 27.91 X54253 25.67 20.32 25.13 X54252 21.16 21.64 21.16 Z17224 26.03 24.57 24.57 X65063 24.09 22.02 23.83 Z17210 24.46 25.98 24.71 X52949 15.07 16.08 15.07 X98467 17.09 10.97 16.33 Y00266/M24612 19.19 17.30 18.11 X59604 27.49 24.83 27.49 K00421 76.42 75.76 76.42 Table 1 shows the optimal free energy of various 16S ribosomal RNA sequences predicted with GTfold, UNAFold and RNAfold. Table 2 shows the accuracy comparison for the three programs for the sequences of Table 1. Similarly Table 3 shows the optimal free energy obtained using the programs for 23S ribosomal RNA sequences, and Table 4 shows the accuracy comparison for the sequences of Table 3. The small differences in the optimal free energy scores predicted using the three programs are due to the algorithmic issues and policies related to thermodynamic aspects. Energy comparisons shown in Tables 1 and 4 demonstrate that our energy scores for the various sequences lie in the very small range of these standard programs. Accuracy percentages shown in Tables 2 and 3 establish that GTfold achieves accuracy comparable with UNAFold and RNAfold for the diverse dataset chosen. Accuracy comparisons for various ribosomal sequences show that in general the accuracy of the prediction programs are very low. The prediction accuracy is expected to improve with the inclusion of advanced Table 3: Free energy (in Kcal/mole) comparison of GTfold, UNAFold and RNAfold for 23S rRNA sequences Sequence Length GTfold UNAFold RNAfold X14386 3105 -791.30 -775.10 -792.65 X54252 953 -180.20 -173.50 -179.71 X52392 1621 -395.80 -389.70 -397.85 J01527 3273 -700.60 -684.60 -702.87 K01868 3514 -1328.50 -1294.30 -1333.95 X53361 4052 -1693.60 -1665.60 -1696.49 X52949 2850 -1707.90 -1689.20 -1709.80 M67497 3029 -1666.10 -1647.10 -1668.12 Table 4: Accuracy comparison (in percent) of GTfold, UNAFold and RNAfold for 23S rRNA sequences of Table 3 Sequence GTfold UNAFold RNAfold X14386 21.77 18.79 18.32 X54252 23.74 21.92 23.29 X52392 24.44 25.56 24.16 J01527 24.72 30.11 25.14 K01868 20.67 22.01 17.85 X53361 22.21 16.59 15.44 X52949 34.44 31.24 26.69 M67497 64.05 63.6 63.94 thermodynamic details that are not presently incorporated due to high computational cost. The development of GTfold facilitates the implementation of these improvements. 6.2 Running Time Comparison GTfold implements parallelism for shared memory multiprocessor and multicore systems. Running time experiments are performed on an IBM P5-570 server with 16 dual core 1.9 GHz CPUs and 256 GB of main memory with L2 cache of 1.9 MB per CPU. GTfold is compiled with IBM xlC compiler Enterprise Edition 7.0, with -q64 option for the 64 bit compilation, -O3 level of optimization and -qsmp=omp option for OpenMP support. RNAfold and UNAFold are compiled with their default compiler and compilation options. An additional flag -maix64 is set while compiling UNAFold and RNAfold due to the runtime memory limitations on the system for 32-bit compilations. Palmenberg and Sgro in 1997 [16] investigated the optimal and suboptimal secondary structures of 11 picornaviral RNA sequences using mfold version 2.2. The length of the sequences varies from 7124 to 8214 nucleotides. They report that each sequence required 5-7 days of CPU time using a modern workstation so that all 11 sequences took 2 to 3 months of time. In stark comparison, GTfold finishes the execution of this set of sequences in approximately 8 minutes using 32 threads. In Figure 6 we compare the running time of GTfold with 32 threads, UNAFold, and RNAfold, for all the picornaviral sequences using the same machine. We can see that GTfold runs one to two orders of magnitude faster than the standard sequential programs UNAFold and RNAfold. Figure 7 compares the running time of GTfold, UNAFold, and RNAfold, for an HIV-1 sequence (accession number Z11530) with 9,781 nucleotides. The secondary structure predicted with GTfold of the viral sequence is shown in Figure 1. All three programs implement the heuristic option Figure 6: Comparison of running times for predicting the RNA secondary structures of 11 picornaviral sequences. The sequences are arranged in increasing order of length from 7124 to 8214 nucleotides. and limit the internal loop size to 30. It is clear from the graph that GTfold with one thread performs much better than UNAfold and is comparable with RNAfold. The running time of GTfold decreases with the increasing number of threads. Even with two threads GTfold runs 2.06 times faster than RNAfold. GTfold folds the entire HIV viral sequence in 84 seconds with 32 threads in comparison to UNAFold and RNAfold which take approximately 2.4 hours and 27 minutes, respectively. GTfold also implements an exact algorithm for finding the optimal internal loops called Internal Loop Speedup Algorithm (ILSA). Though internal loops with sizes longer than 30 are observed, they are usually rare. ILSA can catch these exceptional cases occurring with rarity in nature. It is far more expensive to run this algorithm than the commonly used heuristic. Figure 8 shows the running time of GTfold with the varying number of threads for a 5,184 length 23S Ribosomal RNA sequence of Homo sapiens with accession number J01866/M11167. GTfold is able to reduce the running time from 512 minutes (approximately 9 hours) to 21.5 minutes by using 32 threads. This way, we show that optimized algorithms such as internal loop speedup algorithm can be executed with GTfold in an affordable time. Please note that UNAFold and RNAfold do not implement the ILSA algorithm and can miss the rare possibilities. Figure 7: Comparison of running times for predicting the RNA secondary structure of the HIV1 virus. The dashed horizontal lines represent the sequential running time of UNAFold and RNAfold. Figure 9: Speedups obtained by GTfold with the heuristic algorithm for the HIV-1 virus and with the internal loop speedup algorithm for the Homo sapiens ribosomal RNA sequence. Speedup is with respect to GTfold running on one processor for each series. Figure 8: GTfold running time statistics for a Homo sapiens 23S ribosomal RNA sequence with accession number J01866/M11167 using the Internal Loop Speedup Algorithm Figure 9 shows the speedup achieved using 2, 4, 8, 16, and 32, threads for GTfold using the internal loop speedup algorithm (ILSA) option for the sequence with accession number J01866/M11167 and the heuristic options with an HIV viral sequence. The maximum speedup achieved in the first and second cases is approximately 23.8 and 19.8, respectively. We have achieved slightly superlinear speedups for 2, 4, and 8, threads in the case of the heuristic option due to the better cache locality when the number of threads is more than one. 7. CONCLUSIONS We have developed GTfold, a parallel and multicore code for predicting RNA secondary structures that achieves 19.8 fold speedups over the current best sequential program for large, important RNA sequences and has accuracy comparable to the existing standard folding programs. We have recognized the computational requirements of the problem and implemented shared memory parallelism for the problem. Development of GTfold solves the problem of prohibitive running time factor for large RNA sequences and will help the molecular biology community to work towards the problem of predicting more accurate secondary structures. We have reduced the running time from approximately 2 months to 8 minutes for folding 11 picornaviral sequences. 8. ACKNOWLEDGMENTS This work was supported in part by National Institutes of Health grant NIH NIGMS R01 GM083621, and by NSF Grants CNS-0614915 and DBI-04-20513. Additionally, the research of Christine E. Heitsch, Ph.D., is supported in part by a Career Award at the Scientific Interface (CASI) from the Burroughs Wellcome Fund (BWF). We acknowledge visiting students Gregory Nou, Sonny Hernández, and Manoj Soni, who helped with the implementation of GTfold. 9. REFERENCES [1] M. Andronescu, R. Aguirre-Hernandez, A. Condon, and H. Hoos. RNAsoft: a suite of RNA secondary structure prediction and design software tools. Nucleic Acids Research, 31(13):3416–3422, 2003. [2] J. Cannone, S. Subramanian, M. Schnare, J. Collett, L. D’Souza, Y. Du, B. Feng, N. Lin, L. Madabusi, K. Müller, N. Pande, Z. Shang, N. Yu, and R. Gutell. The Comparative RNA Web (CRW) Site: an online database of comparative sequence and structure information for ribosomal, intron, and other RNAs. BMC Bioinformatics, 3(1), 2002. [3] K. Clyde and E. Harris. RNA secondary structure in the coding region of dengue virus type 2 directs translation start codon selection and is required for viral replication. J. Virol., 80(5):2170–2082, 2006. [4] K. Doshi, J. Cannone, C. Cobaugh, and R. Gutell. Evaluation of the suitability of free-energy minimization using nearest-neighbor energy parameters for RNA secondary structure prediction. BMC Bioinformatics, 2004. [5] M. Fekete, I. Hofacker, and P. Stadler. Prediction of RNA base pairing probabilities on massively parallel computers. J. Computational Biology, 7(1-2):171–182, 2000. [6] P. Gardner and R. Giegerich. A comprehensive comparison of comparative RNA structure prediction approaches. BMC Bioinformatics, 5(140), 2004. [7] R. Gutell, J. Lee, and J. Cannone. The accuracy of ribosomal RNA comparative structure models. Curr. Opin. Struct. Biol., 12(3):301–310, 2002. [8] I. Hofacker, M. Huynen, P. Stadler, and P. Stolorz. Knowledge discovery in RNA sequence families of HIV using scalable computers. In Proc. of the 2nd Int’l Conf. on Knowledge Discovery and Data Mining, Portland, OR, 1996. [9] I. Hofacker, P. Stadler, L. Bonhoeffer, M. Tacker, and P. Schuster. Fast folding and comparison of RNA secondary structures. Monatshefte für Chemie, 125:167–188, 1994. [10] R. Lyngsø, M. Zuker, and C. Pedersen. Fast evaluation of internal loops in RNA secondary structure prediction. Bioinformatics, 15:440–445, 1999. [11] R. Lyngsø, M. Zuker, and C. Pedersen. Internal loops in RNA secondary structure prediction. In Proc. of the 3rd Ann. Int’l Conf. on Computational Molecular Biology (RECOMB), pages 260–267, 1999. [12] D. Mathews, J. Sabina, M. Zuker, and D. Turner. Expanded sequence dependence of thermodynamic parameters improves prediction of RNA secondary structure. J. Mol. Biol., 288:911–940, 1999. [13] A. Mathuriya, D. Bader, C. Heitsch, and S. Harvey. GTfold: A scalable multicore code for RNA secondary structure prediction. Technical report, Georgia Institute of Technology, Atlanta, GA, Aug. 2008. [14] A. Nakaya, K. Yamamoto, and A. Yonezawa. RNA secondary structure prediction using highly parallel computers. Bioinformatics, 11(6):685–692, 1995. [15] OpenMP Architecture Review Board. OpenMP Application Program Interface, 3.0 edition, May 2008. [16] A. Palmenberg and J.-Y. Sgro. Topological organization of picornaviral genomes: Statistical prediction of RNA structural signals. Sem. Virol., 8:231–241, 1997. [17] M. Taufer, T. Solorio, A. Licon, D. Mireles, and M.-Y. Leung. On the effectiveness of rebuilding RNA secondary structures from sequence chunks. In 7th IEEE Int’l Workshop on High Performance Computational Biology (HiCOMB), pages 1–8, 2008. [18] M. Weik, J. Modrof, H.-D. Klenk, S. Becker, and E. Mühlberger. Ebola virus VP30-mediated transcription is regulated by RNA secondary structure formation. J. Virol., 76(17):8532–8539, 2002. [19] E. Westerhout, M. Ooms, M. Vink, A. Das, and B. Berkhout. HIV-1 can escape from RNA interference by evolving an alternative structure in its RNA genome. Nucleic Acids Research, 33(2):796–804, 2005. [20] W. Zhou and D. Lowenthal. A parallel, out-of-core algorithm for RNA secondary structure prediction. In Int’l Conf. on Parallel Processing (ICPP), pages 74–81, 2006. [21] M. Zuker. Mfold web server for nucleic acid folding and hybridization prediction. Nucleic Acids Research, 31(13):3406–3415, 2003. [22] M. Zuker and P. Stiegler. Optimal computer folding of large RNA sequences using thermodynamic and auxiliary information. Nucleic Acids Research, 9(1):133–148, 1981.