Debian Codegraph @

seagen/thr-search.C

raw symbols SCIP
1 #include "searchGENOME.H"
2 #include "encodedQuery.H"
3
4 // If you really, really, really want to know the exact number
5 // of bases left in the query, use the interval list. Otherwise,
6 // it's faster to guess.
7 //
8 //#define USEEXACTSIZE
9
10 void
11 doSearch(searcherState *state,
12 encodedQuery *query,
13 bool isReverse) {
14
15 // Get the hits
16 double startTime = getTime();
17 uint64 count = 0;
18
19 hitMatrix *matrix = new hitMatrix(query->bpTotal(),
20 query->bpCovered(false),
21 query->IID());
22
23 for (uint32 qi=0; qi<query->numberOfMers(); qi++)
24 if ((query->getSkip(qi, isReverse) == false) &&
25 (config._positions->getExact(query->getMer(qi, isReverse),
26 state->posn,
27 state->posnMax,
28 state->posnLen,
29 count)))
30 matrix->addHits(qi, state->posn, state->posnLen);
31
32 state->searchTime += getTime() - startTime;
33
34
35 // Filter, storing the resutls into theOutput
36 startTime = getTime();
37
38 matrix->filter(query, isReverse);
39 delete matrix;
40
41 state->filterTime += getTime() - startTime;
42 }
43
44
45
46 void
47 searchThread(void *U, void *T, void *Q) {
48 searcherState *state = (searcherState *)T;
49 encodedQuery *query = (encodedQuery *)Q;
50
51 // Finish building the query -- mask out repetitive junk
52 //
53 double startTime = getTime();
54
55 if (config._maskDB)
56 for (uint32 qi=0; qi<query->numberOfMers(); qi++)
57 if ((query->getSkip(qi, false) == false) &&
58 (config._maskDB->exists(query->getMer(qi, false))))
59 query->setSkip(qi, false);
60
61 if (config._onlyDB)
62 for (uint32 qi=0; qi<query->numberOfMers(); qi++)
63 if ((query->getSkip(qi, false) == false) &&
64 (!config._onlyDB->exists(query->getMer(qi, false))))
65 query->setSkip(qi, false);
66
67 state->maskTime += getTime() - startTime;
68
69
70 // Do searches.
71 //
72 if (config._doForward)
73 doSearch(state, query, false);
74 if (config._doReverse)
75 doSearch(state, query, true);
76 }