| 1 | #cxx . . $ `<file>/seagen/searchGENOME.C`/include <stdio.h> |
| 2 | #include <stdlib.h> |
| 3 | #include <new> |
| 4 | #include "searchGENOME.H"cxx . . $ `<file>/seagen/searchGENOME.H`/ |
| 5 | |
| 6 | configurationcxx . . $ configuration# configcxx . . $ config.; |
| 7 | |
| 8 | |
| 9 | void *loaderThreadcxx . . $ loaderThread(9f162e79bfc6c74).(void *U); |
| 10 | void searchThreadcxx . . $ searchThread(49f36ff46ae528d5).(void *U, void *T, void *Q); |
| 11 | void writerThreadcxx . . $ writerThread(6c58c5e2437d25a2).(void *U, void *Q); |
| 12 | |
| 13 | |
| 14 | |
| 15 | int |
| 16 | maincxx . . $ main(afcd3168fc1188a4).(int argc, char **argv) { |
| 17 | |
| 18 | // Read the configuration from the command line |
| 19 | // |
| 20 | configcxx . . $ config..readcxx . . $ configuration#read(c759356ac01a31e7).(argc, argv); |
| 21 | |
| 22 | // Open and init the query sequence |
| 23 | // |
| 24 | if (configcxx . . $ config.._beVerbosecxx . . $ configuration#_beVerbose.) |
| 25 | fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Opening the cDNA sequences.\n"); |
| 26 | |
| 27 | configcxx . . $ config.._qsFASTAcxx . . $ configuration#_qsFASTA. = new seqCachecxx . . $ seqCache#seqCache(cc76bd1196c143a3).(configcxx . . $ config.._qsFileNamecxx . . $ configuration#_qsFileName.); |
| 28 | configcxx . . $ config.._dbSTREAMcxx . . $ configuration#_dbSTREAM. = new seqStreamcxx . . $ seqStream#(configcxx . . $ config.._dbFileNamecxx . . $ configuration#_dbFileName.); |
| 29 | |
| 30 | // Complete the configuration |
| 31 | // |
| 32 | configcxx . . $ config.._initTimecxx . . $ configuration#_initTime. = getTime(); |
| 33 | |
| 34 | |
| 35 | // |
| 36 | // Build the positions |
| 37 | // |
| 38 | |
| 39 | // Read in the positionDB if it's already built, or build a new one. |
| 40 | // |
| 41 | if ((configcxx . . $ config.._tableFileNamecxx . . $ configuration#_tableFileName.) && (fileExists(configcxx . . $ config.._tableFileNamecxx . . $ configuration#_tableFileName.))) { |
| 42 | if (configcxx . . $ config.._tableBuildOnlycxx . . $ configuration#_tableBuildOnly.) { |
| 43 | fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "All done. Table '%s' already built.\n", configcxx . . $ config.._tableFileNamecxx . . $ configuration#_tableFileName.); |
| 44 | exitcxx . . $ exit(44ed87f96534fad7).(1); |
| 45 | } else { |
| 46 | fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Loading positionDB state from '%s'\n", configcxx . . $ config.._tableFileNamecxx . . $ configuration#_tableFileName.); |
| 47 | configcxx . . $ config.._positionscxx . . $ configuration#_positions. = new positionDBcxx . . $ positionDB#(configcxx . . $ config.._tableFileNamecxx . . $ configuration#_tableFileName., configcxx . . $ config.._merSizecxx . . $ configuration#_merSize., configcxx . . $ config.._merSkipcxx . . $ configuration#_merSkip., 0); |
| 48 | } |
| 49 | } else { |
| 50 | merStreamcxx . . $ merStream# *MS = new merStreamcxx . . $ merStream#(new kMerBuildercxx . . $ kMerBuilder#(configcxx . . $ config.._merSizecxx . . $ configuration#_merSize.), |
| 51 | configcxx . . $ config.._dbSTREAMcxx . . $ configuration#_dbSTREAM., |
| 52 | true, false); |
| 53 | configcxx . . $ config.._positionscxx . . $ configuration#_positions. = new positionDBcxx . . $ positionDB#(MS, configcxx . . $ config.._merSizecxx . . $ configuration#_merSize., configcxx . . $ config.._merSkipcxx . . $ configuration#_merSkip., 0L, 0L, 0L, 0, 0, 0, 0, configcxx . . $ config.._beVerbosecxx . . $ configuration#_beVerbose.); |
| 54 | delete MS; |
| 55 | |
| 56 | if (configcxx . . $ config.._tableFileNamecxx . . $ configuration#_tableFileName.) { |
| 57 | if (configcxx . . $ config.._beVerbosecxx . . $ configuration#_beVerbose.) |
| 58 | fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Dumping positions table to '%s'\n", configcxx . . $ config.._tableFileNamecxx . . $ configuration#_tableFileName.); |
| 59 | |
| 60 | configcxx . . $ config.._positionscxx . . $ configuration#_positions.->saveStatecxx . . $ positionDB#saveState(85c52e162fed56f9).(configcxx . . $ config.._tableFileNamecxx . . $ configuration#_tableFileName.); |
| 61 | |
| 62 | if (configcxx . . $ config.._tableBuildOnlycxx . . $ configuration#_tableBuildOnly.) |
| 63 | exitcxx . . $ exit(44ed87f96534fad7).(0); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | // Build the masking database. |
| 68 | // |
| 69 | // Previous versions build the existDB takeing the posDB as a |
| 70 | // parameter. The existDB would then be exclude mers not in the |
| 71 | // posDB. A neat and nice feature, but with only 45,000 to 70,000 |
| 72 | // mers in the masks, hardly worth the effort. |
| 73 | // |
| 74 | if (configcxx . . $ config.._maskFileNamecxx . . $ configuration#_maskFileName.) { |
| 75 | if (configcxx . . $ config.._beVerbosecxx . . $ configuration#_beVerbose.) |
| 76 | fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Building maskDB from '%s'\n", configcxx . . $ config.._maskFileNamecxx . . $ configuration#_maskFileName.); |
| 77 | configcxx . . $ config.._maskDBcxx . . $ configuration#_maskDB. = new existDBcxx . . $ existDB#existDB(910019288b8a3aea).(configcxx . . $ config.._maskFileNamecxx . . $ configuration#_maskFileName., configcxx . . $ config.._merSizecxx . . $ configuration#_merSize., existDBnoFlagscxx . . $ existDBnoFlags., 0, ~uint32ZEROcxx . . $ `libutil/util.h:60:10`!); |
| 78 | } |
| 79 | |
| 80 | if (configcxx . . $ config.._onlyFileNamecxx . . $ configuration#_onlyFileName.) { |
| 81 | if (configcxx . . $ config.._beVerbosecxx . . $ configuration#_beVerbose.) |
| 82 | fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Building onlyDB from '%s'\n", configcxx . . $ config.._onlyFileNamecxx . . $ configuration#_onlyFileName.); |
| 83 | configcxx . . $ config.._onlyDBcxx . . $ configuration#_onlyDB. = new existDBcxx . . $ existDB#existDB(910019288b8a3aea).(configcxx . . $ config.._onlyFileNamecxx . . $ configuration#_onlyFileName., configcxx . . $ config.._merSizecxx . . $ configuration#_merSize., existDBnoFlagscxx . . $ existDBnoFlags., 0, ~uint32ZEROcxx . . $ `libutil/util.h:60:10`!); |
| 84 | } |
| 85 | |
| 86 | configcxx . . $ config.._buildTimecxx . . $ configuration#_buildTime. = getTime(); |
| 87 | |
| 88 | #if 0 |
| 89 | // Maybe we don't need this anymore! |
| 90 | #ifdef __alpha |
| 91 | // Start the deadlock detection threads |
| 92 | // |
| 93 | fprintf(stderr, "Deadlock detection enabled!\n"); |
| 94 | pthread_create(&threadID, &threadAttr, deadlockDetector, 0L); |
| 95 | pthread_create(&threadID, &threadAttr, deadlockChecker, 0L); |
| 96 | #endif |
| 97 | #endif |
| 98 | |
| 99 | sweatShopcxx . . $ sweatShop# *ss = new sweatShopcxx . . $ sweatShop#(loaderThreadcxx . . $ loaderThread(9f162e79bfc6c74)., |
| 100 | searchThreadcxx . . $ searchThread(49f36ff46ae528d5)., |
| 101 | writerThreadcxx . . $ writerThread(6c58c5e2437d25a2).); |
| 102 | |
| 103 | ss->setNumberOfWorkerscxx . . $ sweatShop#setNumberOfWorkers(cb2f890c2fdad230).(configcxx . . $ config.._numSearchThreadscxx . . $ configuration#_numSearchThreads.); |
| 104 | |
| 105 | for (uint32cxx . . $ uint32# i=0; i<configcxx . . $ config.._numSearchThreadscxx . . $ configuration#_numSearchThreads.; i++) |
| 106 | ss->setThreadDatacxx . . $ sweatShop#setThreadData(15326d06e62ce759).(i, new searcherStatecxx . . $ searcherState#); |
| 107 | |
| 108 | ss->setLoaderQueueSizecxx . . $ sweatShop#setLoaderQueueSize(cb2f890c2fdad230).(configcxx . . $ config.._loaderQueuecxx . . $ configuration#_loaderQueue.); |
| 109 | ss->setWriterQueueSizecxx . . $ sweatShop#setWriterQueueSize(cb2f890c2fdad230).(configcxx . . $ config.._writerQueuecxx . . $ configuration#_writerQueue.); |
| 110 | |
| 111 | ss->runcxx . . $ sweatShop#run(b81e5e1865225ade).(0L, configcxx . . $ config.._beVerbosecxx . . $ configuration#_beVerbose.); |
| 112 | |
| 113 | configcxx . . $ config.._searchTimecxx . . $ configuration#_searchTime. = getTime(); |
| 114 | |
| 115 | // the configuration does most cleanup, and it's on the stack. |
| 116 | |
| 117 | return(0); |
| 118 | } |
| 119 |