2 * This is a fragment, included from multiple places in ebwt_search.cpp.
3 * It implements the logic of the first phase of the seeded, quality-
4 * aware search routine. It is implemented as a code fragment so that
5 * it can be reused in both the half-index-in-memory and full-index-in-
9 btf1.setReportExacts(true);
10 bt1.setReportExacts(true);
13 cout << patFw << ":" << qual << ", " << patRc << ":" << qualRev << endl;
19 cerr << "Warning: Skipping read (" << name << ") because it is less than 4 characters long" << endl;
23 // Check and see if the distribution of Ns disqualifies
24 // this read right off the bat
25 size_t slen = min<size_t>(plen, seedLen);
27 for(size_t i = 0; i < slen; i++) {
28 if((int)(Dna5)patFw[i] == 4) {
38 ASSERT_NO_HITS_FW(true);
39 ASSERT_NO_HITS_RC(true);
42 sink->finishRead(*patsrc, true, true);
47 // Do an exact-match search on the forward pattern, just in
48 // case we can pick it off early here
50 btf1.setQuery(patsrc->bufa());
51 btf1.setOffs(0, plen, plen, plen, plen, plen);
52 if(btf1.backtrack()) {
59 // Set up backtracker with reverse complement
61 // Set up special seed bounds
63 bt1.setOffs(0, 0, (seedMms > 0)? qs5 : qs,
64 (seedMms > 1)? qs5 : qs,
65 (seedMms > 2)? qs5 : qs,
66 (seedMms > 3)? qs5 : qs);
68 bt1.setOffs(0, 0, (seedMms > 0)? s5 : s,
69 (seedMms > 1)? s5 : s,
70 (seedMms > 2)? s5 : s,
71 (seedMms > 3)? s5 : s);
73 bt1.setQuery(patsrc->bufa());
75 // If we reach here, then we obtained a hit for case
76 // 1R, 2R or 3R and can stop considering this read
80 // If we reach here, then cases 1R, 2R, and 3R have
81 // been eliminated and the read needs further
85 if(nofw && sink->finishedWithStratum(0)) { // no more exact hits are possible