->thick_backbone[index].num_used;
64 Int4num_hits =
lookup->thick_backbone[index].num_used;
70lookup_pos =
lookup->thick_backbone[index].payload.entries;
72lookup_pos =
lookup->overflow +
73 lookup->thick_backbone[index].payload.overflow_cursor;
76 for(
i=0;
i<num_hits;
i++) {
101 Uint1*abs_start, *s_end;
111abs_start =
subject->sequence;
115 for(; s <= s_end; s++) {
117 Int4index = s[0] << 8 | s[1];
122 if(num_hits > (max_hits - total_hits))
127offset_pairs + total_hits,
129total_hits += num_hits;
160 Int4lut_word_length;
165abs_start =
subject->sequence;
167scan_step =
lookup->scan_step;
168lut_word_length =
lookup->lut_word_length;
172 if(lut_word_length > 5) {
189 Int4shift = 2 * (8 - lut_word_length);
193 for(; s <= s_end; s += scan_step) {
194index = s[0] << 8 | s[1];
195index = index >> shift;
200 if(num_hits > (max_hits - total_hits))
205offset_pairs + total_hits,
207total_hits += num_hits;
224 for(; scan_range[0] <= scan_range[1]; scan_range[0] += scan_step) {
229index = s[0] << 16 | s[1] << 8 | s[2];
230index = (index >> shift) &
mask;
236 if(num_hits > (max_hits - total_hits))
241offset_pairs + total_hits, scan_range[0]);
242total_hits += num_hits;
254 for(; scan_range[0] <= scan_range[1]; scan_range[0] += scan_step) {
259index = s[0] << 8 | s[1];
260index = (index >> shift) &
mask;
266 if(num_hits > (max_hits - total_hits))
271offset_pairs + total_hits,
273total_hits += num_hits;
290 if(
lookup->lut_word_length == 8 &&
lookup->scan_step == 4)
311offset_pairs[total_hits].qs_offsets.q_off = index;
312offset_pairs[total_hits].qs_offsets.s_off = s_off;
317 Int4src_off = -index;
318index = overflow[src_off++];
320offset_pairs[total_hits+num_hits].qs_offsets.q_off = index;
321offset_pairs[total_hits+num_hits].qs_offsets.s_off = s_off;
323index = overflow[src_off++];
324}
while(index >= 0);
331 #define SMALL_NA_ACCESS_HITS(x) \ 333 if (total_hits > max_hits) { \ 334 scan_range[0] += (x); \ 337 total_hits += s_BlastSmallNaRetrieveHits(offset_pairs, \ 338 index, scan_range[0] + (x), \ 361 const Int4kLutWordLength = 8;
362 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
363 Int4num_words = (scan_range[1] - scan_range[0]) / 4 + 1;
374max_hits -=
lookup->longest_chain;
377 switch(num_words % 8) {
378 case1: s -= 7; scan_range[0] -= 28;
gotobyte_7;
379 case2: s -= 6; scan_range[0] -= 24;
gotobyte_6;
380 case3: s -= 5; scan_range[0] -= 20;
gotobyte_5;
381 case4: s -= 4; scan_range[0] -= 16;
gotobyte_4;
382 case5: s -= 3; scan_range[0] -= 12;
gotobyte_3;
383 case6: s -= 2; scan_range[0] -= 8;
gotobyte_2;
384 case7: s -= 1; scan_range[0] -= 4;
gotobyte_1;
387 while(scan_range[0] <= scan_range[1]) {
389init_index = init_index << 8 | s[1];
390index = backbone[init_index & kLutWordMask];
393init_index = init_index << 8 | s[2];
394index = backbone[init_index & kLutWordMask];
397init_index = init_index << 8 | s[3];
398index = backbone[init_index & kLutWordMask];
401init_index = init_index << 8 | s[4];
402index = backbone[init_index & kLutWordMask];
405init_index = init_index << 8 | s[5];
406index = backbone[init_index & kLutWordMask];
409init_index = init_index << 8 | s[6];
410index = backbone[init_index & kLutWordMask];
413init_index = init_index << 8 | s[7];
414index = backbone[init_index & kLutWordMask];
417init_index = init_index << 8 | s[8];
419index = backbone[init_index & kLutWordMask];
452 Int4lut_word_length =
lookup->lut_word_length;
458max_hits -=
lookup->longest_chain;
460 if(lut_word_length > 5) {
477 Int4shift = 2 * (8 - lut_word_length);
481 for(; s <= s_end; s += scan_step) {
482index = s[0] << 8 | s[1];
483index = backbone[index >> shift];
485 if(total_hits > max_hits)
510 for(; scan_range[0] <= scan_range[1]; scan_range[0] += scan_step) {
515index = s[0] << 16 | s[1] << 8 | s[2];
516index = backbone[(index >> shift) &
mask];
529 for(; scan_range[0] <= scan_range[1]; scan_range[0] += scan_step) {
534index = s[0] << 8 | s[1];
535index = backbone[(index >> shift) &
mask];
562 const Int4kLutWordLength = 4;
563 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
571max_hits -=
lookup->longest_chain;
581init_index = s[0] << 8 | s[1];
584init_index = s[0] << 8 | s[1];
588 while(scan_range[0] <= scan_range[1]) {
591index = backbone[init_index];
596 if(scan_range[0] > scan_range[1])
599init_index = init_index << 8 | s[1];
600index = backbone[(init_index >> 6) & kLutWordMask];
605 if(scan_range[0] > scan_range[1])
608index = backbone[(init_index >> 4) & kLutWordMask];
613 if(scan_range[0] > scan_range[1])
617index = backbone[(init_index >> 2) & kLutWordMask];
644 const Int4kLutWordLength = 5;
645 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
653max_hits -=
lookup->longest_chain;
660init_index = s[0] << 8 | s[1];
663init_index = s[0] << 8 | s[1];
666init_index = s[0] << 8 | s[1];
670 while(scan_range[0] <= scan_range[1]) {
672init_index = s[0] << 8 | s[1];
673index = backbone[init_index >> 6];
678 if(scan_range[0] > scan_range[1])
681index = backbone[(init_index >> 4) & kLutWordMask];
686 if(scan_range[0] > scan_range[1])
689index = backbone[(init_index >> 2) & kLutWordMask];
694 if(scan_range[0] > scan_range[1])
698index = backbone[init_index & kLutWordMask];
724 const Int4kLutWordLength = 6;
725 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
733max_hits -=
lookup->longest_chain;
740init_index = s[0] << 8 | s[1];
743init_index = s[0] << 8 | s[1];
746init_index = s[0] << 8 | s[1];
750 while(scan_range[0] <= scan_range[1]) {
752init_index = s[0] << 8 | s[1];
753index = backbone[init_index >> 4];
758 if(scan_range[0] > scan_range[1])
761index = backbone[(init_index >> 2) & kLutWordMask];
766 if(scan_range[0] > scan_range[1])
769index = backbone[init_index & kLutWordMask];
774 if(scan_range[0] > scan_range[1])
777init_index = init_index << 8 | s[2];
779index = backbone[(init_index >> 6) & kLutWordMask];
805 const Int4kLutWordLength = 6;
806 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
814max_hits -=
lookup->longest_chain;
820init_index = s[0] << 8 | s[1];
824 while(scan_range[0] <= scan_range[1]) {
826init_index = s[0] << 8 | s[1];
827index = backbone[init_index >> 4];
832 if(scan_range[0] > scan_range[1])
836index = backbone[init_index & kLutWordMask];
862 const Int4kLutWordLength = 7;
863 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
871max_hits -=
lookup->longest_chain;
878init_index = s[0] << 8 | s[1];
881init_index = s[0] << 8 | s[1];
884init_index = s[0] << 16 | s[1] << 8 | s[2];
888 while(scan_range[0] <= scan_range[1]) {
890init_index = s[0] << 8 | s[1];
891index = backbone[init_index >> 2];
896 if(scan_range[0] > scan_range[1])
899index = backbone[init_index & kLutWordMask];
904 if(scan_range[0] > scan_range[1])
907init_index = init_index << 8 | s[2];
908index = backbone[(init_index >> 6) & kLutWordMask];
913 if(scan_range[0] > scan_range[1])
917index = backbone[(init_index >> 4) & kLutWordMask];
943 const Int4kLutWordLength = 7;
944 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
952max_hits -=
lookup->longest_chain;
958init_index = s[0] << 8 | s[1];
962 while(scan_range[0] <= scan_range[1]) {
964init_index = s[0] << 8 | s[1];
965index = backbone[init_index >> 2];
970 if(scan_range[0] > scan_range[1])
973init_index = init_index << 8 | s[2];
975index = backbone[(init_index >> 6) & kLutWordMask];
1001 const Int4kLutWordLength = 7;
1002 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
1004 Int4total_hits = 0;
1010max_hits -=
lookup->longest_chain;
1017init_index = s[0] << 8 | s[1];
1021init_index = s[0] << 8 | s[1];
1025init_index = s[0] << 8 | s[1];
1029 while(scan_range[0] <= scan_range[1]) {
1031init_index = s[0] << 8 | s[1];
1032index = backbone[(init_index >> 2) & kLutWordMask];
1037 if(scan_range[0] > scan_range[1])
1040init_index = init_index << 8 | s[2];
1041index = backbone[(init_index >> 4) & kLutWordMask];
1046 if(scan_range[0] > scan_range[1])
1049init_index = init_index << 8 | s[3];
1050index = backbone[(init_index >> 6) & kLutWordMask];
1055 if(scan_range[0] > scan_range[1])
1059index = backbone[init_index & kLutWordMask];
1086 const Int4kLutWordLength = 8;
1087 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
1091 Int4total_hits = 0;
1096max_hits -=
lookup->longest_chain;
1102 case1:
gotobase_1;
1103 case2:
gotobase_2;
1104 case3:
gotobase_3;
1107 while(scan_range[0] <= scan_range[1]) {
1109index = s[0] << 8 | s[1];
1110s += scan_step_byte;
1111index = backbone[index];
1113scan_range[0] += scan_step;
1116 if(scan_range[0] > scan_range[1])
1119index = s[0] << 16 | s[1] << 8 | s[2];
1120s += scan_step_byte;
1121index = backbone[(index >> 6) & kLutWordMask];
1123scan_range[0] += scan_step;
1126 if(scan_range[0] > scan_range[1])
1129index = s[0] << 16 | s[1] << 8 | s[2];
1130s += scan_step_byte;
1131index = backbone[(index >> 4) & kLutWordMask];
1133scan_range[0] += scan_step;
1136 if(scan_range[0] > scan_range[1])
1139index = s[0] << 16 | s[1] << 8 | s[2];
1140s += scan_step_byte + 1;
1141index = backbone[(index >> 2) & kLutWordMask];
1143scan_range[0] += scan_step;
1168 const Int4kLutWordLength = 8;
1169 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
1173 Int4total_hits = 0;
1178max_hits -=
lookup->longest_chain;
1186 while(scan_range[0] <= scan_range[1]) {
1188index = s[0] << 8 | s[1];
1189s += scan_step_byte;
1190index = backbone[index];
1192scan_range[0] += scan_step;
1195 if(scan_range[0] > scan_range[1])
1198index = s[0] << 16 | s[1] << 8 | s[2];
1199s += scan_step_byte + 1;
1200index = backbone[(index >> 4) & kLutWordMask];
1202scan_range[0] += scan_step;
1227 const Int4kLutWordLength = 8;
1228 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
1232 Int4total_hits = 0;
1237max_hits -=
lookup->longest_chain;
1253 while(scan_range[0] <= scan_range[1]) {
1255index = s[0] << 8 | s[1];
1256s += scan_step_byte;
1257index = backbone[index];
1259scan_range[0] += scan_step;
1262 if(scan_range[0] > scan_range[1])
1265index = s[0] << 16 | s[1] << 8 | s[2];
1266s += scan_step_byte;
1267index = backbone[(index >> 2) & kLutWordMask];
1269scan_range[0] += scan_step;
1272 if(scan_range[0] > scan_range[1])
1275index = s[1] << 16 | s[2] << 8 | s[3];
1276s += scan_step_byte;
1277index = backbone[(index >> 4) & kLutWordMask];
1279scan_range[0] += scan_step;
1282 if(scan_range[0] > scan_range[1])
1285index = s[2] << 16 | s[3] << 8 | s[4];
1286s += scan_step_byte + 3;
1287index = backbone[(index >> 6) & kLutWordMask];
1289scan_range[0] += scan_step;
1317 switch(
lookup->lut_word_length) {
1335 else if(scan_step == 2)
1344 else if(scan_step == 2)
1346 else if(scan_step == 3)
1353 if(scan_step == 4) {
1359 lookup->scansub_callback =
1363 lookup->scansub_callback =
1367 lookup->scansub_callback =
1371 lookup->scansub_callback =
1392 if(
PV_TEST(pv, index, pv_array_bts))
1417q_off =
lookup->next_pos[q_off];
1441q_off =
lookup->next_pos2[q_off];
1447 #define MB_ACCESS_HITS() \ 1448 if (s_BlastMBLookupHasHits(mb_lt, index)) { \ 1449 if (total_hits >= max_hits) \ 1451 total_hits += s_BlastMBLookupRetrieve(mb_lt, \ 1452 index, offset_pairs + total_hits, \ 1457 #define MB_ACCESS_HITS2() \ 1458 if (total_hits >= max_hits) \ 1460 if (s_BlastMBLookupHasHits(mb_lt, index)) { \ 1461 total_hits += s_BlastMBLookupRetrieve(mb_lt, \ 1462 index, offset_pairs + total_hits, \ 1465 if (s_BlastMBLookupHasHits(mb_lt, index2)) { \ 1466 total_hits += s_BlastMBLookupRetrieve2(mb_lt, \ 1467 index2, offset_pairs + total_hits, \ 1493 Int4total_hits = 0;
1498 ASSERT(lut_word_length == 9 ||
1499lut_word_length == 10 ||
1500lut_word_length == 11 ||
1501lut_word_length == 12 ||
1502lut_word_length == 16);
1519 Int4shift = 2 * (12 - lut_word_length);
1523 for( ; s <= s_end; s += scan_step) {
1525index = s[0] << 16 | s[1] << 8 | s[2];
1526index = index >> shift;
1529 if(total_hits >= max_hits)
1534offset_pairs + total_hits,
1540}
else if(lut_word_length == 16 && scan_step == 1) {
1546w = (
Int8)s[0] << 24 | (
Int8)s[1] << 16 | (
Int8)s[2] << 8 | s[3];
1548w = (w << 8) | (
Int8)s[4];
1551 for(; scan_range[0] <= scan_range[1]; scan_range[0] += scan_step) {
1555w = (w << 8) | (
Int8)s[4];
1559index = (w >> shift) &
mask;
1566}
else if(lut_word_length == 16) {
1568 for(; scan_range[0] <= scan_range[1]; scan_range[0] += scan_step) {
1573(
Int8)s[3] << 8 | s[4];
1575index = (w >> shift) &
mask;
1580}
else if(lut_word_length > 9) {
1581 ASSERT(lut_word_length <= 12);
1598 for(; scan_range[0] <= scan_range[1]; scan_range[0] += scan_step) {
1603index = s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3];
1604index = (index >> shift) &
mask;
1614 for(; scan_range[0] <= scan_range[1]; scan_range[0] += scan_step) {
1619index = s[0] << 16 | s[1] << 8 | s[2];
1620index = (index >> shift) &
mask;
1645 const Int4kLutWordLength = 9;
1646 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
1649 Int4total_hits = 0;
1659init_index = s[0] << 16 | s[1] << 8 | s[2];
1662init_index = s[0] << 16 | s[1] << 8 | s[2];
1665init_index = s[0] << 16 | s[1] << 8 | s[2];
1669 while(scan_range[0] <= scan_range[1]) {
1671init_index = s[0] << 16 | s[1] << 8 | s[2];
1672index = init_index >> 6;
1677 if(scan_range[0] > scan_range[1])
1680index = (init_index >> 4) & kLutWordMask;
1685 if(scan_range[0] > scan_range[1])
1688index = (init_index >> 2) & kLutWordMask;
1693 if(scan_range[0] > scan_range[1])
1696index = init_index & kLutWordMask;
1721 const Int4kLutWordLength = 9;
1722 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
1725 Int4total_hits = 0;
1734init_index = s[0] << 16 | s[1] << 8 | s[2];
1738 while(scan_range[0] <= scan_range[1]) {
1740init_index = s[0] << 16 | s[1] << 8 | s[2];
1741index = init_index >> 6;
1746 if(scan_range[0] > scan_range[1])
1749index = (init_index >> 2) & kLutWordMask;
1774 const Int4kLutWordLength = 10;
1775 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
1778 Int4total_hits = 0;
1788init_index = s[0] << 16 | s[1] << 8 | s[2];
1791init_index = s[0] << 16 | s[1] << 8 | s[2];
1794init_index = s[0] << 16 | s[1] << 8 | s[2];
1798 while(scan_range[0] <= scan_range[1]) {
1800init_index = s[0] << 16 | s[1] << 8 | s[2];
1801index = init_index >> 4;
1806 if(scan_range[0] > scan_range[1])
1809index = (init_index >> 2) & kLutWordMask;
1814 if(scan_range[0] > scan_range[1])
1817index = init_index & kLutWordMask;
1822 if(scan_range[0] > scan_range[1])
1825init_index = init_index << 8 | s[3];
1826index = (init_index >> 6) & kLutWordMask;
1851 const Int4kLutWordLength = 10;
1852 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
1855 Int4total_hits = 0;
1864init_index = s[0] << 16 | s[1] << 8 | s[2];
1868 while(scan_range[0] <= scan_range[1]) {
1870init_index = s[0] << 16 | s[1] << 8 | s[2];
1871index = init_index >> 4;
1876 if(scan_range[0] > scan_range[1])
1879index = init_index & kLutWordMask;
1904 const Int4kLutWordLength = 10;
1905 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
1908 Int4total_hits = 0;
1918init_index = s[0] << 8 | s[1];
1922init_index = s[0] << 16 | s[1] << 8 | s[2];
1926init_index = s[0] << 16 | s[1] << 8 | s[2];
1930 while(scan_range[0] <= scan_range[1]) {
1932init_index = s[0] << 16 | s[1] << 8 | s[2];
1933index = init_index >> 4;
1938 if(scan_range[0] > scan_range[1])
1941init_index = init_index << 8 | s[3];
1942index = (init_index >> 6) & kLutWordMask;
1947 if(scan_range[0] > scan_range[1])
1950index = init_index & kLutWordMask;
1955 if(scan_range[0] > scan_range[1])
1958init_index = init_index << 8 | s[4];
1959index = (init_index >> 2) & kLutWordMask;
1984 const Int4kLutWordLength = 11;
1985 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
1987 Int4total_hits = 0;
1998 case1:
gotobase_1;
1999 case2:
gotobase_2;
2000 case3:
gotobase_3;
2003 while(scan_range[0] <= scan_range[1]) {
2005index = s[0] << 16 | s[1] << 8 | s[2];
2007s += scan_step_byte;
2009scan_range[0] += scan_step;
2012 if(scan_range[0] > scan_range[1])
2015index = s[0] << 16 | s[1] << 8 | s[2];
2016index = index & kLutWordMask;
2017s += scan_step_byte;
2019scan_range[0] += scan_step;
2022 if(scan_range[0] > scan_range[1])
2025index = s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3];
2026index = (index >> 6) & kLutWordMask;
2027s += scan_step_byte;
2029scan_range[0] += scan_step;
2032 if(scan_range[0] > scan_range[1])
2035index = s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3];
2036index = (index >> 4) & kLutWordMask;
2037s += scan_step_byte + 1;
2039scan_range[0] += scan_step;
2061 const Int4kLutWordLength = 11;
2062 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
2064 Int4total_hits = 0;
2068 Int4top_shift, bottom_shift;
2075 if( (scan_range[0] % 2) == 0)
2089 while(scan_range[0] <= scan_range[1]) {
2090index = s[0] << 16 | s[1] << 8 | s[2];
2091index = (index >> top_shift) & kLutWordMask;
2092s += scan_step_byte;
2094scan_range[0] += scan_step;
2097 if(scan_range[0] > scan_range[1])
2100index = s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3];
2101index = (index >> bottom_shift) & kLutWordMask;
2102s += scan_step_byte + 1;
2104scan_range[0] += scan_step;
2126 const Int4kLutWordLength = 11;
2127 const Int4kLutWordMask = (1 << (2 * kLutWordLength)) - 1;
2129 Int4total_hits = 0;
2150 while(scan_range[0] <= scan_range[1]) {
2152index = s[0] << 16 | s[1] << 8 | s[2];
2154s += scan_step_byte;
2156scan_range[0] += scan_step;
2159 if(scan_range[0] > scan_range[1])
2162index = s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3];
2163index = (index >> 4) & kLutWordMask;
2164s += scan_step_byte;
2166scan_range[0] += scan_step;
2169 if(scan_range[0] > scan_range[1])
2172index = s[1] << 24 | s[2] << 16 | s[3] << 8 | s[4];
2173index = (index >> 6) & kLutWordMask;
2174s += scan_step_byte;
2176scan_range[0] += scan_step;
2179 if(scan_range[0] > scan_range[1])
2182index = s[2] << 16 | s[3] << 8 | s[4];
2183index = index & kLutWordMask;
2184s += scan_step_byte + 3;
2186scan_range[0] += scan_step;
2209 Int4total_hits = 0;
2220 while(index < scan_range[0] + template_length) {
2221accum = accum << 8 | *s++;
2228 switch(index - (scan_range[0] + template_length)) {
2242 while(scan_range[0] <= scan_range[1]) {
2249 if(scan_range[0] > scan_range[1])
2252accum = accum << 8 | *s++;
2258 if(scan_range[0] > scan_range[1])
2266 if(scan_range[0] > scan_range[1])
2297 Int4total_hits = 0;
2309 while(index < scan_range[0] + template_length) {
2310accum = accum << 8 | *s++;
2317 switch(index - (scan_range[0] + template_length)) {
2331 while(scan_range[0] <= scan_range[1]) {
2339 if(scan_range[0] > scan_range[1])
2342accum = accum << 8 | *s++;
2349 if(scan_range[0] > scan_range[1])
2358 if(scan_range[0] > scan_range[1])
2389 Int4total_hits = 0;
2391 const Int4kTemplateLength = 18;
2403 while(index < scan_range[0] + kTemplateLength) {
2404hi = (hi << 8) | (lo >> 24);
2405lo = lo << 8 | *s++;
2409 switch(index - (scan_range[0] + kTemplateLength)) {
2416lo = (lo >> 8) | (hi << 24);
2421 while(scan_range[0] <= scan_range[1]) {
2423index = ((lo & 0x00000003) ) |
2424((lo & 0x000000f0) >> 2) |
2425((lo & 0x00003c00) >> 4) |
2426((lo & 0x00030000) >> 6) |
2427((lo & 0x03c00000) >> 10) |
2428((lo & 0xf0000000) >> 12) |
2429((hi & 0x0000000c) << 18);
2434 if(scan_range[0] > scan_range[1])
2437hi = (hi << 8) | (lo >> 24);
2438lo = lo << 8 | *s++;
2440index = ((lo & 0x000000c0) >> 6) |
2441((lo & 0x00003c00) >> 8) |
2442((lo & 0x000f0000) >> 10) |
2443((lo & 0x00c00000) >> 12) |
2444((lo & 0xf0000000) >> 16) |
2445((hi & 0x0000003c) << 14) |
2446((hi & 0x00000300) << 12);
2451 if(scan_range[0] > scan_range[1])
2454index = ((lo & 0x00000030) >> 4) |
2455((lo & 0x00000f00) >> 6) |
2456((lo & 0x0003c000) >> 8) |
2457((lo & 0x00300000) >> 10) |
2458((lo & 0x3c000000) >> 14) |
2459((hi & 0x0000000f) << 16) |
2460((hi & 0x000000c0) << 14);
2465 if(scan_range[0] > scan_range[1])
2468index = ((lo & 0x0000000c) >> 2) |
2469((lo & 0x000003c0) >> 4) |
2470((lo & 0x0000f000) >> 6) |
2471((lo & 0x000c0000) >> 8) |
2472((lo & 0x0f000000) >> 12) |
2473((lo & 0xc0000000) >> 14) |
2474((hi & 0x00000003) << 18) |
2475((hi & 0x00000030) << 16);
2502 Int4total_hits = 0;
2504 const Int4kTemplateLength = 21;
2515 while(index < scan_range[0] + kTemplateLength) {
2516hi = (hi << 8) | (lo >> 24);
2517lo = lo << 8 | *s++;
2521 switch(index - (scan_range[0] + kTemplateLength)) {
2528lo = (lo >> 8) | (hi << 24);
2533 while(scan_range[0] <= scan_range[1]) {
2535index = ((lo & 0x00000003) ) |
2536((lo & 0x000000f0) >> 2) |
2537((lo & 0x00000c00) >> 4) |
2538((lo & 0x000f0000) >> 8) |
2539((lo & 0x00c00000) >> 10) |
2540((lo & 0xf0000000) >> 14) |
2541((hi & 0x0000000c) << 16) |
2542((hi & 0x00000300) << 12);
2547 if(scan_range[0] > scan_range[1])
2550hi = (hi << 8) | (lo >> 24);
2551lo = lo << 8 | *s++;
2553index = ((lo & 0x000000c0) >> 6) |
2554((lo & 0x00003c00) >> 8) |
2555((lo & 0x00030000) >> 10) |
2556((lo & 0x03c00000) >> 14) |
2557((lo & 0x30000000) >> 16) |
2558((hi & 0x0000003c) << 12) |
2559((hi & 0x00000300) << 10) |
2560((hi & 0x0000c000) << 6);
2565 if(scan_range[0] > scan_range[1])
2568index = ((lo & 0x00000030) >> 4) |
2569((lo & 0x00000f00) >> 6) |
2570((lo & 0x0000c000) >> 8) |
2571((lo & 0x00f00000) >> 12) |
2572((lo & 0x0c000000) >> 14) |
2573((hi & 0x0000000f) << 14) |
2574((hi & 0x000000c0) << 12) |
2575((hi & 0x00003000) << 8);
2580 if(scan_range[0] > scan_range[1])
2583index = ((lo & 0x0000000c) >> 2) |
2584((lo & 0x000003c0) >> 4) |
2585((lo & 0x00003000) >> 6) |
2586((lo & 0x003c0000) >> 10) |
2587((lo & 0x03000000) >> 12) |
2588((lo & 0xc0000000) >> 16) |
2589((hi & 0x00000003) << 16) |
2590((hi & 0x00000030) << 14) |
2591((hi & 0x00000c00) << 10);
2644 else if(scan_step == 2)
2646 else if(scan_step == 3)
2701 const Int4pv_array_bts =
lookup->pv_array_bts;
2717 if(
lookup->thick_backbone[hashed_index].num_words > 0) {
2719 lookup->thick_backbone + hashed_index;
2725((
lookup->thick_backbone[hashed_index].num_words < 5) ?
2726 lookup->thick_backbone[hashed_index].num_words - 1 :
2747 for(j = 0;j <
i;j++) {
2753offset_pairs[num_hits].qs_offsets.q_off
2756offset_pairs[num_hits].qs_offsets.s_off
2759 ASSERT(offset_pairs[num_hits].qs_offsets.q_off
2795 for(k = 0; k < cell->
num_words; k++) {
2797 Int4num_offsets = overflow[1];
2800 if(word != index) {
2801overflow += num_offsets + 2;
2810 for(
i= 0;
i< num_offsets;
i++) {
2811offset_pairs[num_hits +
i].qs_offsets.q_off =
2814offset_pairs[num_hits +
i].qs_offsets.s_off =
2817 ASSERT(offset_pairs[num_hits +
i].
2862 Int4total_hits = 0;
2863 Int4lut_word_length =
lookup->lut_word_length;
2872 ASSERT(lut_word_length == 16);
2876max_hits -=
lookup->longest_chain;
2878 if(lut_word_length == 16 && scan_step == 1) {
2886w = (
Int8)s[0] << 24 | (
Int8)s[1] << 16 | (
Int8)s[2] << 8 | s[3];
2888w = (w << 8) | (
Int8)s[4];
2891 for(; scan_range[0] <= scan_range[1]; scan_range[0] += scan_step) {
2895w = (w << 8) | (
Int8)s[4];
2899index = (
Uint4)((w >> shift) &
mask);
2904 if(total_hits >= max_hits)
2909scan_range[0], offset_pairs + total_hits,
2913 else if(lut_word_length == 16) {
2919 for(; scan_range[0] <= scan_range[1]; scan_range[0] += scan_step) {
2922w = (
Int8)s[0] << 24 | (
Int8)s[1] << 16 | (
Int8)s[2] << 8 | s[3];
2924w = (w << 8) | (
Int8)s[4];
2926index = (
Uint4)((w >> shift) &
mask);
2932 if(total_hits >= max_hits)
2936scan_range[0], offset_pairs + total_hits,
2948printf(
"Num words not in PV:\t%d\n", diags.
not_pv);
2949printf(
"Num words not in backbone\t%d\n", diags.
not_backbone);
2950printf(
"Num hash value hits in backbone:\t%d\n", diags.
hits);
2951printf(
"\tNum query words with the same hash value\tCount\n");
2954 for(ii = 0;ii < 5;ii++) {
2955printf(
"\t%d\t%d\n", ii + 1, diags.
h_num_words[ii]);
2958printf(
"Num backbone misses:\t%d\n", diags.
missed);
2959printf(
"Num word hits:\t%d\n", diags.
present);
2960printf(
"Total hits:\t%d\n", total_hits);
#define COMPRESSION_RATIO
Compression ratio of nucleotide bases (4 bases in 1 byte)
#define PV_ARRAY_BTS
bits-to-shift from lookup_index to pv_array index.
#define PV_TEST(lookup, index, shift)
Test the bit at position 'index' in the PV array bitfield within 'lookup'.
Uint4(* TNaLookupHashFunction)(Uint1 *, Uint4)
Hash function type for the lookup table.
#define PV_ARRAY_TYPE
The pv_array 'native' type.
Routines for creating nucleotide BLAST lookup tables.
#define NA_OFFSETS_PER_HASH
#define NA_WORDS_PER_HASH
static NCBI_INLINE Int4 ComputeDiscontiguousIndex(Uint8 accum, EDiscTemplateType template_type)
Given an accumulator containing packed bases, compute the discontiguous word index specified by templ...
EDiscTemplateType
Enumeration of all discontiguous word templates; the enumerated values encode the weight,...
@ eDiscTemplate_11_21_Coding
@ eDiscTemplate_11_18_Coding
#define NA_HITS_PER_CELL
maximum number of hits in one lookup table cell
static Int4 s_MBScanSubject_10_2(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 10-letter word hits with stride 2.
static Int4 s_BlastNaHashLookupRetieveHits(BlastNaHashLookupTable *lookup, Uint4 index, Int4 s_off, BlastOffsetPair *offset_pairs, SNaHashLookupScanDiags *diags)
static Int4 s_BlastSmallNaScanSubject_4_1(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 4-letter word hits with stride 1.
static Int4 s_BlastSmallNaScanSubject_7_1(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 7-letter word hits with stride 1.
static Int4 s_MB_DiscWordScanSubject_11_18_1(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning discontiguous words corresponding to the 11-of-18 cod...
static Int4 s_MBScanSubject_10_3(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 10-letter word hits with stride 3.
static Int4 s_BlastSmallNaScanSubject_7_3(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 7-letter word hits with stride 3.
struct SNaHashLookupScanDiags SNaHashLookupScanDiags
Diagnostics for scanning with NaHashLookupTable.
static Int4 s_BlastSmallNaScanSubject_5_1(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 5-letter word hits with stride 1.
static Int4 s_MB_DiscWordScanSubject_TwoTemplates_1(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 11- or 12-letter discontiguous words with stride 1 an...
static Int4 s_MBScanSubject_11_1Mod4(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 11-letter word hits with stride one plus a multiple o...
static Int4 s_BlastSmallNaScanSubject_Any(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 4-to-8-letter word hits with arbitrary stride.
static Int4 s_BlastSmallNaScanSubject_8_4(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 8-letter word hits with stride 4.
static Int4 s_BlastNaHashScanSubject_Any(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 9-to-12 letter word hits with arbitrary stride.
static Int4 s_BlastSmallNaScanSubject_8_3Mod4(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 8-letter word hits with stride of three plus a multip...
static Int4 s_BlastNaScanSubject_Any(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 4-to-8 letter word hits at arbitrary stride.
static Int4 s_MB_DiscWordScanSubject_11_21_1(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning discontiguous words corresponding to the 11-of-21 cod...
static NCBI_INLINE Int4 s_BlastMBLookupRetrieve2(BlastMBLookupTable *lookup, Int8 index, BlastOffsetPair *offset_pairs, Int4 s_off)
Like s_BlastMBLookupRetrieve, except the second hashtable is accessed.
static void s_SmallNaChooseScanSubject(LookupTableWrap *lookup_wrap)
Choose the most appropriate function to scan through subject sequences, assuming a small-query blastn...
static NCBI_INLINE Int4 s_BlastSmallNaRetrieveHits(BlastOffsetPair *offset_pairs, Int4 index, Int4 s_off, Int4 total_hits, Int2 *overflow)
Copy query offsets from a BlastSmallNaLookupTable.
static Int4 s_MBScanSubject_Any(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 9-to-12 letter word hits with arbitrary stride.
static NCBI_INLINE Int4 s_BlastLookupGetNumHits(BlastNaLookupTable *lookup, Int4 index)
Retrieve the number of query offsets associated with this subject word.
void * BlastChooseNucleotideScanSubjectAny(LookupTableWrap *lookup_wrap)
Return the most generic function to scan through nucleotide subject sequences.
static void s_NaHashChooseScanSubject(LookupTableWrap *lookup_wrap)
Choose the most appropriate function to scan through subject sequences, assuming a standard blastn lo...
#define SMALL_NA_ACCESS_HITS(x)
access the small-query lookup table
static void s_MBChooseScanSubject(LookupTableWrap *lookup_wrap)
Choose the most appropriate function to scan through subject sequences, assuming a megablast lookup t...
static Int4 s_BlastNaScanSubject_8_4(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 8-letter word hits with stride 4.
static NCBI_INLINE Int4 s_BlastMBLookupHasHits(BlastMBLookupTable *lookup, Int8 index)
Determine if this subject word occurs in the query.
static Int4 s_MBScanSubject_11_3Mod4(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 11-letter word hits with stride three plus a multiple...
static void s_NaChooseScanSubject(LookupTableWrap *lookup_wrap)
Choose the most appropriate function to scan through subject sequences, assuming a standard blastn lo...
#define MB_ACCESS_HITS()
access the megablast lookup table
#define MB_ACCESS_HITS2()
access the megablast lookup table with two templates
static Int4 s_MBScanSubject_9_2(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 9-letter word hits with stride 2.
static Int4 s_MB_DiscWordScanSubject_1(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 11- or 12-letter discontiguous words with stride 1.
static Int4 s_MBScanSubject_9_1(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 9-letter word hits with stride 1.
static Int4 s_MBScanSubject_10_1(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 10-letter word hits with stride 1.
static Int4 s_BlastSmallNaScanSubject_6_1(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 6-letter word hits with stride 1.
static NCBI_INLINE Int4 s_BlastMBLookupRetrieve(BlastMBLookupTable *lookup, Int8 index, BlastOffsetPair *offset_pairs, Int4 s_off)
Copy query offsets from the lookup table to the array of offset pairs.
static Int4 s_MBScanSubject_11_2Mod4(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 11-letter word hits with stride two plus a multiple o...
static Int4 s_BlastSmallNaScanSubject_8_2Mod4(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 8-letter word hits with stride of two plus a multiple...
static NCBI_INLINE void s_BlastLookupRetrieve(BlastNaLookupTable *lookup, Int4 index, BlastOffsetPair *offset_pairs, Int4 s_off)
Copy query offsets from the lookup table to the array of offset pairs.
static Int4 s_BlastSmallNaScanSubject_8_1Mod4(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 8-letter word hits with stride of one plus a multiple...
static Int4 s_BlastSmallNaScanSubject_7_2(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 7-letter word hits with stride 2.
void BlastChooseNucleotideScanSubject(LookupTableWrap *lookup_wrap)
Choose the most appropriate function to scan through nucleotide subject sequences.
static Int4 s_BlastSmallNaScanSubject_6_2(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *scan_range)
Scan the compressed subject sequence, returning 6-letter word hits with stride 2.
Routines for scanning nucleotide BLAST lookup tables.
@ eSmallNaLookupTable
lookup table for blastn with small query
@ eNaLookupTable
blastn lookup table
@ eMBLookupTable
megablast lookup table (includes both contiguous and discontiguous megablast)
@ eNaHashLookupTable
used for 16-base words
Various auxiliary BLAST utility functions.
ncbi::TMaskedQueryRegions mask
static int lookup(const char *name, const struct lookup_int *table)
uint8_t Uint1
1-byte (8-bit) unsigned integer
int16_t Int2
2-byte (16-bit) signed integer
int32_t Int4
4-byte (32-bit) signed integer
uint32_t Uint4
4-byte (32-bit) unsigned integer
int64_t Int8
8-byte (64-bit) signed integer
uint64_t Uint8
8-byte (64-bit) unsigned integer
if(yy_accept[yy_current_state])
#define INT4_MAX
largest nubmer represented by signed int
#define NCBI_INLINE
"inline" seems to work on our remaining in-house compilers (WorkShop, Compaq, ICC,...
#define ASSERT
macro for assert.
Structure to hold a sequence.
The lookup table structure used for Mega BLAST.
Int4 lut_word_length
number of letters in a lookup table word
void * scansub_callback
function for scanning subject sequences
Int8 hashsize
= 4^(lut_word_length)
EDiscTemplateType template_type
Type of the discontiguous word template.
Int4 scan_step
Step size for scanning the database.
Int4 longest_chain
Largest number of query positions for a given word.
Boolean discontiguous
Are discontiguous words used?
Boolean two_templates
Use two templates simultaneously.
EDiscTemplateType second_template_type
Type of the second discontiguous word template.
Int4 template_length
Length of the discontiguous word template.
The basic lookup table structure for blastn searches.
Lookup table structure for blastn searches with small queries.
Wrapper structure for different types of BLAST lookup tables.
void * lut
Pointer to the actual lookup table structure.
ELookupTableType lut_type
What kind of a lookup table it is?
Structure defining one cell of the compacted lookup table.
Int1 num_offsets[3]
number of offsets for each word if there are fewer than 3
Uint4 words[3]
words stored under this hash value
Int4 offsets[9]
offset locations for each word
Int1 num_words
number of words stored under the same hash value
Diagnostics for scanning with NaHashLookupTable.
This symbol enables the verbose option in makeblastdb and other BLAST+ search command line applicatio...
Uint4 q_off
Query offset.
Uint4 s_off
Subject offset.
struct BlastOffsetPair::@6 qs_offsets
Query/subject offset pair.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4