| 1 | #cxx . . $ `<file>/seatac/seatac.H`/include <stdio.h> |
| 2 | #include <stdlib.h> |
| 3 | #include <unistd.h> |
| 4 | #include <string.h> |
| 5 | #include <sys/time.h> |
| 6 | #include <sys/types.h> |
| 7 | #include <sys/stat.h> |
| 8 | #include <sys/resource.h> |
| 9 | #include <sys/utsname.h> |
| 10 | #include <fcntl.h> |
| 11 | #include <assert.h> |
| 12 | #include <math.h> |
| 13 | |
| 14 | // At one time, this was needed for pthread.h or semaphore.h |
| 15 | typedef unsigned short ushortcxx . . $ ushort#; |
| 16 | |
| 17 | #include <pthread.h> |
| 18 | #include <semaphore.h> |
| 19 | |
| 20 | #include "bio++.H"cxx . . $ `<file>/libbio/bio++.H`/ |
| 21 | |
| 22 | #include "seqCache.H"cxx . . $ `<file>/libseq/seqCache.H`/ |
| 23 | |
| 24 | #include "existDB.H"cxx . . $ `<file>/libkmer/existDB.H`/ |
| 25 | #include "positionDB.H"cxx . . $ `<file>/libkmer/positionDB.H`/ |
| 26 | |
| 27 | #include "hitMatrix.H"cxx . . $ `<file>/seatac/hitMatrix.H`/ |
| 28 | |
| 29 | #include "filterObj.H"cxx . . $ `<file>/seatac/filterObj.H`/ |
| 30 | #include "statObj.H"cxx . . $ `<file>/seatac/statObj.H`/ |
| 31 | |
| 32 | class encodedQuerycxx . . $ encodedQuery# { |
| 33 | private: |
| 34 | char const *_seqcxx . . $ encodedQuery#_seq.; |
| 35 | uint32cxx . . $ uint32# _seqLencxx . . $ encodedQuery#_seqLen.; |
| 36 | uint32cxx . . $ uint32# _merSizecxx . . $ encodedQuery#_merSize.; |
| 37 | bool _rccxx . . $ encodedQuery#_rc.; |
| 38 | |
| 39 | uint32cxx . . $ uint32# _seqPoscxx . . $ encodedQuery#_seqPos.; |
| 40 | |
| 41 | int32cxx . . $ int32# _timeUntilValidcxx . . $ encodedQuery#_timeUntilValid.; |
| 42 | |
| 43 | uint64cxx . . $ uint64# _substringcxx . . $ encodedQuery#_substring.; |
| 44 | uint64cxx . . $ uint64# _mermaskcxx . . $ encodedQuery#_mermask.; |
| 45 | public: |
| 46 | encodedQuerycxx . . $ encodedQuery#encodedQuery(3aee4054b2a94996).(char const *seq, |
| 47 | uint32cxx . . $ uint32# seqLen, |
| 48 | uint32cxx . . $ uint32# k, |
| 49 | bool rc); |
| 50 | ~cxx . . $ encodedQuery#`~encodedQuery`(ced63f7c635d850d).encodedQuerycxx . . $ encodedQuery#(); |
| 51 | |
| 52 | bool getMercxx . . $ encodedQuery#getMer(4c1b2b38f691f6d0).(uint64cxx . . $ uint64# &mer, uint32cxx . . $ uint32# &pos); |
| 53 | }; |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | // |
| 59 | // A singleton for working with the command line parameters. |
| 60 | // |
| 61 | #define MAX_THREADScxx . . $ `seatac/seatac.H:61:9`! 64 |
| 62 | |
| 63 | |
| 64 | class configurationcxx . . $ configuration# { |
| 65 | public: |
| 66 | bool _beVerbosecxx . . $ configuration#_beVerbose.; |
| 67 | |
| 68 | uint32cxx . . $ uint32# _merSizecxx . . $ configuration#_merSize.; |
| 69 | uint32cxx . . $ uint32# _merSkipcxx . . $ configuration#_merSkip.; |
| 70 | uint32cxx . . $ uint32# _numSearchThreadscxx . . $ configuration#_numSearchThreads.; |
| 71 | |
| 72 | bool _doReversecxx . . $ configuration#_doReverse.; |
| 73 | bool _doForwardcxx . . $ configuration#_doForward.; |
| 74 | |
| 75 | uint32cxx . . $ uint32# _maxDiagonalcxx . . $ configuration#_maxDiagonal.; |
| 76 | uint32cxx . . $ uint32# _maxGapcxx . . $ configuration#_maxGap.; |
| 77 | uint32cxx . . $ uint32# _qsOverlapcxx . . $ configuration#_qsOverlap.; |
| 78 | uint32cxx . . $ uint32# _dsOverlapcxx . . $ configuration#_dsOverlap.; |
| 79 | |
| 80 | uint32cxx . . $ uint32# _minLengthcxx . . $ configuration#_minLength.; |
| 81 | |
| 82 | char *_dbFileNamecxx . . $ configuration#_dbFileName.; |
| 83 | char *_qsFileNamecxx . . $ configuration#_qsFileName.; |
| 84 | char *_maskFileNamecxx . . $ configuration#_maskFileName.; |
| 85 | char *_onlyFileNamecxx . . $ configuration#_onlyFileName.; |
| 86 | char *_outputFileNamecxx . . $ configuration#_outputFileName.; |
| 87 | char *_statsFileNamecxx . . $ configuration#_statsFileName.; |
| 88 | |
| 89 | char *_tableFileNamecxx . . $ configuration#_tableFileName.; |
| 90 | bool _tableBuildOnlycxx . . $ configuration#_tableBuildOnly.; |
| 91 | |
| 92 | seqStreamcxx . . $ seqStream# *_genomecxx . . $ configuration#_genome.; |
| 93 | |
| 94 | // Filter parameters |
| 95 | // |
| 96 | char *_filternamecxx . . $ configuration#_filtername.; |
| 97 | char *_filteroptscxx . . $ configuration#_filteropts.; |
| 98 | sharedObjcxx . . $ sharedObj# *_filterObjcxx . . $ configuration#_filterObj.; |
| 99 | |
| 100 | // Wall clock times |
| 101 | // |
| 102 | double _startTimecxx . . $ configuration#_startTime.; |
| 103 | double _initTimecxx . . $ configuration#_initTime.; |
| 104 | double _buildTimecxx . . $ configuration#_buildTime.; |
| 105 | double _searchTimecxx . . $ configuration#_searchTime.; |
| 106 | double _totalTimecxx . . $ configuration#_totalTime.; |
| 107 | |
| 108 | // Loader parameters |
| 109 | // |
| 110 | uint32cxx . . $ uint32# _loaderHighWaterMarkcxx . . $ configuration#_loaderHighWaterMark.; |
| 111 | struct timespec _loaderSleepcxx . . $ configuration#_loaderSleep.; |
| 112 | bool _loaderWarningscxx . . $ configuration#_loaderWarnings.; |
| 113 | |
| 114 | // Search parameters |
| 115 | // |
| 116 | struct timespec _searchSleepcxx . . $ configuration#_searchSleep.; |
| 117 | |
| 118 | // Output parameters |
| 119 | // |
| 120 | uint32cxx . . $ uint32# _writerHighWaterMarkcxx . . $ configuration#_writerHighWaterMark.; |
| 121 | struct timespec _writerSleepcxx . . $ configuration#_writerSleep.; |
| 122 | bool _writerWarningscxx . . $ configuration#_writerWarnings.; |
| 123 | |
| 124 | configurationcxx . . $ configuration#configuration(49f6e7a06ebc5aa8).(); |
| 125 | ~cxx . . $ configuration#`~configuration`(49f6e7a06ebc5aa8).configurationcxx . . $ configuration#(); |
| 126 | |
| 127 | void usagecxx . . $ configuration#usage(fda57c8427c60377).(char *name); |
| 128 | void readcxx . . $ configuration#read(c759356ac01a31e7).(int argc, char **argv); |
| 129 | void writeATACheadercxx . . $ configuration#writeATACheader(8d4262d45fc644ab).(FILE *out); |
| 130 | |
| 131 | void setTimecxx . . $ configuration#setTime(ac28bcc6049edbea).(struct timespec *ts, double t) { |
| 132 | ts->tv_sec = (time_t)floorcxx . . $ floor(fee4f1d22bc8e617).(t); |
| 133 | ts->tv_nsec = (long)((t - ts->tv_sec) * 1e9); |
| 134 | }; |
| 135 | }; |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | // Shared data |
| 144 | // |
| 145 | extern configurationcxx . . $ configuration# configcxx . . $ config.; |
| 146 | |
| 147 | extern seqCachecxx . . $ seqCache# *qsFASTAcxx . . $ qsFASTA.; // Used exclusively by thr-loader.C |
| 148 | |
| 149 | extern positionDBcxx . . $ positionDB# *positionscxx . . $ positions.; |
| 150 | |
| 151 | extern volatile uint32cxx . . $ uint32# numberOfQueriescxx . . $ numberOfQueries.; |
| 152 | |
| 153 | extern filterObjcxx . . $ filterObj# **outputcxx . . $ output.; |
| 154 | |
| 155 | extern pthread_mutex_t inputTailMutexcxx . . $ inputTailMutex.; |
| 156 | extern seqInCorecxx . . $ seqInCore# **inputcxx . . $ input.; |
| 157 | extern volatile uint32cxx . . $ uint32# inputHeadcxx . . $ inputHead.; |
| 158 | extern volatile uint32cxx . . $ uint32# inputTailcxx . . $ inputTail.; |
| 159 | |
| 160 | extern volatile uint32cxx . . $ uint32# outputPoscxx . . $ outputPos.; |
| 161 | |
| 162 | extern char *threadStatscxx . . $ threadStats.[MAX_THREADScxx . . $ `seatac/seatac.H:61:9`!]; |
| 163 | |
| 164 | void *deadlockDetectorcxx . . $ deadlockDetector(9f162e79bfc6c74).(void *U); |
| 165 | void *deadlockCheckercxx . . $ deadlockChecker(9f162e79bfc6c74).(void *U); |
| 166 | |
| 167 | void *loaderThreadcxx . . $ loaderThread(9f162e79bfc6c74).(void *U); |
| 168 | void *searchThreadcxx . . $ searchThread(9f162e79bfc6c74).(void *U); |