NCBI C++ ToolKit
sr_search_impl.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: sr_search_impl.hpp 39387 2008-09-23 12:48:49Z morgulis $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: Aleksandr Morgulis
27  *
28  * File Description:
29  * Private declarations and template code for CSRSearch.
30  *
31  */
32 
33 #ifndef C_SR_SEARCH_IMPL_HPP
34 #define C_SR_SEARCH_IMPL_HPP
35 
38 
40 BEGIN_SCOPE( dbindex_search )
41 
43 USING_SCOPE( ncbi::blastdbindex );
44 
45 //----------------------------------------------------------------------------
46 template< typename index_t >
47 class CSRSearch_Impl : public CSRSearch
48 {
49  typedef index_t TIndex;
50 
51  public:
52 
54  : CSRSearch( index, d, dfuzz ),
55  index_impl_( dynamic_cast< TIndex & >(*index) )
56  {}
57 
58  private:
59 
60  typedef typename TIndex::TOffsetIterator TIter;
61 
62  virtual void search( const SSearchData & sdata, TResults & results );
63 
64  void copyOffsets( TSRResults & resutls, TIter & offsets );
65 
66  void mergeOffsets(
67  TSRResults & resutls, TIter & offsets, Uint4 step );
68 
69  void setResults4Idx(
70  Uint4 idx, bool fw_strand,
71  CResCache & res_cache, vector< TIter > & single_res_cache,
72  const vector< TSeqPos > & positions );
73 
74  bool searchExact(
75  const CSeqVector & seq,
76  const vector< TSeqPos > & positions,
77  bool fw_strand,
78  TSRResults & results,
79  TSeqPos & max_pos,
80  vector< TIter > & cache,
81  vector< Uint1 > & cache_set );
82 
83  bool searchOneMismatch(
84  const CSeqVector & seq,
85  const vector< TSeqPos > & positions,
86  Uint4 max_pos,
87  bool fw_strand,
88  CMismatchResultsInfo & results_info,
89  vector< TIter > & scache,
90  const vector< Uint1 > & scache_set,
91  CResCache & cache );
92 
94  vector< TIter > single_res_cache[2];
95  vector< Uint1 > single_res_cache_set[2];
96  vector< TIter > scache1[2];
97  vector< TIter > scache2[2];
98  vector< Uint1 > scache_set1[2];
99  vector< Uint1 > scache_set2[2];
100 };
101 
102 //----------------------------------------------------------------------------
103 template< typename index_t >
105  Uint4 idx, bool fw_strand, CResCache & res_cache,
106  vector< TIter > & single_res_cache,
107  const vector< TSeqPos > & positions )
108 {
109  res_cache.set( idx, fw_strand );
110  TSRResults & r = res_cache.at( idx, fw_strand );
111 
112  if( idx != single_res_cache.size() ) {
113  for( Uint4 i = 0; i < single_res_cache.size(); ++i )
114  if( i != idx ) {
115  Uint4 pos = positions[i];
116  TIter & s = single_res_cache[i];
117 
118  if( !s.end() ) {
119  if( r.empty() ) copyOffsets( r, s );
120  else {
121  Uint4 p = (idx == 0) ? pos - hkey_width_ : pos;
122  mergeOffsets( r, s, p );
123  if( r.empty() ) break;
124  }
125  }
126  else { r.clear(); break; }
127  }
128  }
129  else {
130  for( Uint4 i = 0, pos = 0;
131  i < single_res_cache.size() - 2; ++i, pos += hkey_width_ ) {
132  TIter & s = single_res_cache[i];
133 
134  if( !s.end() ) {
135  if( r.empty() ) copyOffsets( r, s );
136  else {
137  mergeOffsets( r, s, pos );
138  if( r.empty() ) break;
139  }
140  }
141  else { r.clear(); break; }
142  }
143  }
144 }
145 
146 //----------------------------------------------------------------------------
147 template< typename index_t >
149  TSRResults & results, TIter & offsets )
150 {
151  while( offsets.Advance() ) {
152  CDbIndex::TOffsetValue offset = offsets.getOffsetValue();
153  SSRResult r = { index_impl_.getLId( offset ),
154  index_impl_.getLOff( offset ) };
155  results.push_back( r );
156  }
157 
158  offsets.Reset();
159 }
160 
161 //----------------------------------------------------------------------------
162 template< typename index_t >
164  TSRResults & results, TIter & offsets, Uint4 step )
165 {
166  if( results.size() > 0 ) {
167  Uint4 put_ind = 0;
168 
169  if( !offsets.end() ) {
170  offsets.Advance();
171 
172  for( TSRResults::iterator ires = results.begin();
173  ires != results.end(); ++ires ) {
174  SSRResult offres = { 0, 0 };
175 
176  while( true ){
177  CDbIndex::TOffsetValue o = offsets.getOffsetValue();
178  offres.seqnum = index_impl_.getLId( o );
179  offres.soff = index_impl_.getLOff( o );
180 
181  if( offres.seqnum > ires->seqnum ||
182  ( offres.seqnum == ires->seqnum &&
183  offres.soff >= ires->soff + step ) )
184  break;
185  else if( !offsets.Advance() ) break;
186  }
187 
188  if( offsets.end() ) break;
189 
190  if( offres.seqnum == ires->seqnum &&
191  offres.soff == ires->soff + step )
192  results[put_ind++] = *ires;
193  }
194  }
195 
196  results.resize( put_ind );
197  }
198 
199  offsets.Reset();
200 }
201 
202 //----------------------------------------------------------------------------
203 template< typename index_t >
205  const CSeqVector & seq,
206  const vector< TSeqPos > & positions,
207  bool fw_strand, TSRResults & results, TSeqPos & max_pos,
208  vector< TIter > & cache, vector< Uint1 > & cache_set )
209 {
210  bool ambig;
211  Uint4 cache_idx = 0;
212  TSeqPos i = 0, pos = positions[0];
213  Uint4 key = getNMer( seq, pos, fw_strand, ambig );
214  if( ambig ) return true;
215  cache_set[cache_idx] = true;
216  TIter & offsets = cache[cache_idx];
217  offsets = index_impl_.OffsetIterator( key, hkey_width_ );
218 
219  if( !offsets.end() ) {
220  ++cache_idx;
221  copyOffsets( results, offsets );
222 
223  while( (++i) != positions.size() ) {
224  pos = positions[i];
225  key = getNMer( seq, pos, fw_strand, ambig );
226  if( ambig ) return true;
227  TIter & offsets = cache[cache_idx];
228  offsets = index_impl_.OffsetIterator( key, hkey_width_ );
229  mergeOffsets( results, offsets, pos );
230  cache_set[cache_idx] = true;
231  if( offsets.end() ) max_pos = pos + hkey_width_;
232  ++cache_idx;
233  }
234  }
235  else max_pos = hkey_width_;
236 
237  return false;
238 }
239 
240 //----------------------------------------------------------------------------
241 template< typename index_t >
243  const CSeqVector & seq, const vector< TSeqPos > & positions,
244  Uint4 max_pos, bool fw_strand, CMismatchResultsInfo & results_info,
245  vector< TIter > & scache, const vector< Uint1 > & scache_set,
246  CResCache & cache )
247 {
248  bool ambig;
249  results_info.clear();
250  static const Uint1 letters[4] = {'A', 'C', 'G', 'T' };
251 
252  for( TSeqPos i = 0; i < positions.size(); ++i )
253  if( !scache_set[i] ) {
254  Uint4 key = getNMer( seq, positions[i], fw_strand, ambig );
255  if( ambig ) return true;
256  scache[i] = index_impl_.OffsetIterator( key, hkey_width_ );
257  }
258 
259  for( TSeqPos i = 0; i < max_pos; ) {
260  SMismatchInfo mismatch_info;
261  pair< TSeqPos, TSeqPos > range =
262  Pos2Index( i, seq.size(), mismatch_info );
263 
264  if( !cache.is_set( mismatch_info.idx, fw_strand ) ) {
265  setResults4Idx(
266  mismatch_info.idx, fw_strand,
267  cache, scache, positions );
268  }
269 
270  TSRResults & r = cache.at( mismatch_info.idx, fw_strand );
271  if( r.empty() ) { i = range.second; continue; }
272 
273  for( i = range.first; i < range.second; ++i ) {
274  TSeqPos p = fw_strand ? i : seq.size() - i - 1;
275  Uint1 orig_letter = seq[p];
276 
277  for( Uint4 j = 0; j < 4; ++j )
278  if( letters[j] != orig_letter ) {
279  Uint1 subst_letter = letters[j];
280  Uint4 key = getNMer(
281  seq, mismatch_info.key_pos[0],
282  fw_strand, ambig, i, subst_letter );
283  if( ambig ) return true;
284  TIter offsets =
285  index_impl_.OffsetIterator( key, hkey_width_ );
286 
287  if( !offsets.end() ) {
288  Uint4 ris = results_info.size();
289  SMismatchResultsEntry & r_entry = results_info[ris];
290  r_entry.init( i, subst_letter, mismatch_info.key_pos[0] );
291  TSRResults & results = r_entry.results;
292  results.clear();
293  copyOffsets( results, offsets );
294 
295  if( mismatch_info.num_keys == 2 ) {
296  key = getNMer(
297  seq, mismatch_info.key_pos[1],
298  fw_strand, ambig, i, subst_letter );
299  if( ambig ) return true;
300  offsets =
301  index_impl_.OffsetIterator(
302  key, hkey_width_ );
303  mergeOffsets(
304  results, offsets,
305  mismatch_info.key_pos[1] -
306  mismatch_info.key_pos[0] );
307  }
308 
309  if( mismatch_info.idx == 0 )
310  mergeResults( results, r, hkey_width_ );
311  else {
312  mergeResults(
313  results, r, -mismatch_info.key_pos[0] );
314  }
315 
316  if( results.empty() ) results_info.resize( ris );
317  }
318  }
319  }
320  }
321 
322  return false;
323 }
324 
325 //----------------------------------------------------------------------------
326 template< typename index_t >
328  const SSearchData & sdata, TResults & outres )
329 {
330  bool paired = (sdata.seq_2 != 0);
331  hk_data_.reset();
332 
333  if( paired ) {
334  CResCache & res_cache1 = hk_data_.rc1;
335  CResCache & res_cache2 = hk_data_.rc2;
336  const CSeqVector & seq1 = *sdata.seq_1;
337  const CSeqVector & seq2 = *sdata.seq_2;
338  TSeqPos sz1 = seq1.size();
339  TSeqPos sz2 = seq2.size();
340  vector< TSeqPos > positions1 = GetQNmerPositions( sz1 );
341  vector< TSeqPos > positions2 = GetQNmerPositions( sz2 );
342 
343  if( positions1.empty() || positions2.empty() ) return;
344 
345  TSeqPos maxpos1[2] = { sz1, sz1 };
346  TSeqPos maxpos2[2] = { sz2, sz2 };
347  bool ambig;
348 
349  ELevel l = PE;
350  Uint4 nr = (l < sdata.rlevel_1) ? sdata.num_res
351  : sdata.num_res - sdata.nr_1;
352  outres.level_1 = l;
353  outres.level_2 = l;
354  outres.nres_1 = 0;
355 
356  for( Uint1 strand = 0; strand < 2; ++strand ) {
357  scache1[strand].clear();
358  scache_set1[strand].clear();
359  scache1[strand].resize( positions1.size() );
360  scache_set1[strand].resize( positions1.size(), 0 );
361  hk_data_.exact_1[strand].clear();
362  ambig = searchExact(
363  seq1, positions1, strand,
364  hk_data_.exact_1[strand], maxpos1[strand],
365  scache1[strand], scache_set1[strand] );
366  if( ambig ) break;
367  scache2[strand].clear();
368  scache_set2[strand].clear();
369  scache2[strand].resize( positions2.size() );
370  scache_set2[strand].resize( positions2.size(), 0 );
371  hk_data_.exact_2[strand].clear();
372  ambig = searchExact(
373  seq2, positions2, strand,
374  hk_data_.exact_2[strand], maxpos2[strand],
375  scache2[strand], scache_set2[strand] );
376  if( ambig ) break;
377  }
378 
379  if( ambig ) return;
380 
381  bool matches_found = false;
382 
383  for( Uint1 i = 0; i < 2; ++i )
384  if( !hk_data_.exact_1[i].empty() )
385  for( Uint1 j = 0; j < 2; ++j )
386  if( !hk_data_.exact_2[j].empty() ) {
387  TSRPairedResults & results = hk_data_.pres;
388  results.clear();
389  combine(
390  hk_data_.exact_1[i], hk_data_.exact_2[j],
391  results );
392 
393  if( !results.empty() ) {
394  matches_found = true;
395 
396  if( reportResults(
397  outres, nr,
398  sz1, sz2,
399  results, i, j ) ) {
400  outres.nres_1 = outres.res.size();
401  return;
402  }
403  }
404  }
405 
406  const bool & mismatch = sdata.mismatch;
407 
408  if( mismatch && !matches_found ) {
409  matches_found = false;
410  res_cache1.init( positions1.size() + 1 );
411  res_cache2.init( positions2.size() + 1 );
412  bool ambig;
413 
414  l = PM;
415  outres.level_1 = l;
416  outres.nres_1 = 0;
417  if( l > sdata.rlevel_1 ) return;
418  nr = (l < sdata.rlevel_1) ? sdata.num_res
419  : sdata.num_res - sdata.nr_1;
420 
421  for( Uint1 strand = 0; strand < 2; ++strand ) {
422  ambig = searchOneMismatch(
423  seq1, positions1, maxpos1[strand], strand,
424  hk_data_.mm_1[strand],
425  scache1[strand], scache_set1[strand],
426  res_cache1 );
427  if( ambig ) break;
428  ambig = searchOneMismatch(
429  seq2, positions2, maxpos2[strand], strand,
430  hk_data_.mm_2[strand],
431  scache2[strand], scache_set2[strand],
432  res_cache2 );
433  if( ambig ) break;
434  }
435 
436  if( ambig ) return;
437 
438  for( Uint1 i = 0; i < 2; ++i ) {
439  if( !hk_data_.exact_1[i].empty() ) {
440  for( Uint1 j = 0; j < 2; ++j ) {
441  if( !hk_data_.mm_2[j].empty() ) {
442  // exact1 vs mm2
443  for( Uint4 ind = 0; ind < hk_data_.mm_2[j].size(); ++ind ) {
444  SMismatchResultsEntry & it = hk_data_.mm_2[j][ind];
445  TSRPairedResults & results = hk_data_.pres;
446  results.clear();
447  combine(
448  hk_data_.exact_1[i], it.results,
449  results, -it.adjustment );
450 
451  if( !results.empty() ) {
452  matches_found = true;
453 
454  if( reportResults(
455  outres, nr,
456  sz1, sz2, results, i, j,
457  false, true,
458  0, it.mismatch_position,
459  (Uint1)'-', it.mismatch_letter,
460  0, it.adjustment ) ) {
461  outres.nres_1 = outres.res.size();
462  return;
463  }
464  }
465  }
466  }
467  }
468  }
469 
470  if( !hk_data_.mm_1[i].empty() ) {
471  for( Uint1 j = 0; j < 2; ++j ) {
472  if( !hk_data_.exact_2[j].empty() ) {
473  // mm1 vs exact2
474  for( Uint4 ind = 0; ind < hk_data_.mm_1[i].size(); ++ind ) {
475  SMismatchResultsEntry & it = hk_data_.mm_1[i][ind];
476  TSRPairedResults & results = hk_data_.pres;
477  results.clear();
478  combine(
479  it.results, hk_data_.exact_2[j],
480  results, it.adjustment );
481 
482  if( !results.empty() ) {
483  matches_found = true;
484 
485  if( reportResults(
486  outres, nr,
487  sz1, sz2, results, i, j,
488  true, false,
489  it.mismatch_position, 0,
490  it.mismatch_letter, (Uint1)'-',
491  it.adjustment, 0 ) ) {
492  outres.nres_1 = outres.res.size();
493  return;
494  }
495  }
496  }
497  }
498 
499  if( !hk_data_.mm_2[j].empty() ) {
500  // mm1 vs mm2
501  for( Uint4 iind = 0; iind < hk_data_.mm_1[i].size(); ++iind ) {
502  for( Uint4 jind = 0; jind < hk_data_.mm_2[j].size(); ++jind ) {
503  SMismatchResultsEntry & it = hk_data_.mm_1[i][iind];
504  SMismatchResultsEntry & jt = hk_data_.mm_2[j][jind];
505  TSRPairedResults & results = hk_data_.pres;
506  results.clear();
507  combine(
508  it.results, jt.results,
509  results,
510  it.adjustment - jt.adjustment );
511 
512  if( !results.empty() ) {
513  matches_found = true;
514 
515  if( reportResults(
516  outres, nr,
517  sz1, sz2, results, i, j,
518  true, true,
521  it.mismatch_letter,
522  jt.mismatch_letter,
523  it.adjustment,
524  jt.adjustment ) ) {
525  outres.nres_1 = outres.res.size();
526  return;
527  }
528  }
529  }
530  }
531  }
532  }
533  }
534  }
535  }
536 
537  if( !matches_found ) {
538  matches_found = false;
539 
540  l = SE;
541  outres.level_1 = l;
542  outres.level_2 = EM;
543  outres.nres_1 = 0;
544 
545  if( l <= sdata.rlevel_1 ) {
546  nr = (l < sdata.rlevel_1) ? sdata.num_res
547  : sdata.num_res - sdata.nr_1;
548 
549  for( Uint1 i = 0; i < 2; ++i )
550  if( !hk_data_.exact_1[i].empty() ) {
551  matches_found = true;
552 
553  if( reportResults(
554  outres, nr,
555  sz1, hk_data_.exact_1[i], i,
556  false, 0, (Uint1)'-', 0, 1 ) ) {
557  break;
558  }
559  }
560 
561  if( !matches_found ) {
562  l = SM;
563  outres.level_1 = l;
564 
565  if( l <= sdata.rlevel_1 ) {
566  nr = (l < sdata.rlevel_1) ? sdata.num_res
567  : sdata.num_res - sdata.nr_1;
568 
569  for( Uint1 i = 0; i < 2; ++i ) {
570  if( !hk_data_.mm_1[i].empty() ) {
571  matches_found = true;
572 
573  for( Uint4 ind = 0; ind < hk_data_.mm_1[i].size(); ++ind ) {
574  SMismatchResultsEntry & it = hk_data_.mm_1[i][ind];
575 
576  if( reportResults(
577  outres, nr,
578  sz1, it.results, i,
579  mismatch, it.mismatch_position,
580  it.mismatch_letter, it.adjustment,
581  1 ) ) {
582  break;
583  }
584  }
585  }
586  }
587  }
588  }
589  }
590 
591  if( !matches_found ) outres.level_1 = EM;
592  outres.nres_1 = outres.res.size();
593  matches_found = false;
594 
595  l = SE;
596  outres.level_2 = l;
597  if( l > sdata.rlevel_2 ) return;
598  nr = (l < sdata.rlevel_2) ? sdata.num_res
599  : sdata.num_res - sdata.nr_2;
600  nr += outres.res.size();
601 
602  for( Uint1 i = 0; i < 2; ++i )
603  if( !hk_data_.exact_2[i].empty() ) {
604  if( reportResults(
605  outres, nr,
606  sz2, hk_data_.exact_2[i], i,
607  false, 0, (Uint1)'-', 0, 2 ) ) {
608  return;
609  }
610 
611  matches_found = true;
612  }
613 
614  if( !matches_found ) {
615  l = SM;
616  outres.level_2 = l;
617  if( l > sdata.rlevel_2 ) return;
618  nr = (l < sdata.rlevel_2) ? sdata.num_res
619  : sdata.num_res - sdata.nr_2;
620  nr += outres.res.size();
621 
622  for( Uint1 i = 0; i < 2; ++i ) {
623  if( !hk_data_.mm_2[i].empty() )
624  for( Uint4 ind = 0; ind < hk_data_.mm_2[i].size(); ++ind ) {
625  SMismatchResultsEntry & it = hk_data_.mm_2[i][ind];
626 
627  if( reportResults(
628  outres, nr,
629  sz2, it.results, i,
630  mismatch, it.mismatch_position,
631  it.mismatch_letter, it.adjustment,
632  2 ) ) {
633  return;
634  }
635  }
636  }
637  }
638  }
639  else {
640  outres.nres_1 = outres.res.size();
641  }
642  }
643  else { // not paired
644  CResCache & res_cache = hk_data_.rc1;
645  const bool & mismatch = sdata.mismatch;
646  const CSeqVector & seq = *sdata.seq_1;
647  TSeqPos sz = seq.size();
648  vector< TSeqPos > positions = GetQNmerPositions( sz );
649  bool exact_matches_found = false;
650  TSeqPos max_mismatch_pos[2] = { sz, sz };
651 
652  ELevel l = SE;
653  outres.level_1 = l;
654  outres.level_2 = EM;
655  outres.nres_1 = 0;
656  if( l > sdata.rlevel_1 ) return;
657  Uint4 nr = (l < sdata.rlevel_1) ? sdata.num_res
658  : sdata.num_res - sdata.nr_1;
659 
660  if( !positions.empty() ) {
661  bool fw_strand = true;
662  res_cache.init( positions.size() + 1 );
663  bool ambig;
664 
665  do {
666  single_res_cache[fw_strand].clear();
667  single_res_cache_set[fw_strand].clear();
668  single_res_cache[fw_strand].resize( positions.size() );
669  single_res_cache_set[fw_strand].resize(
670  positions.size(), false );
671 
672  TSRResults & results = hk_data_.exact_1[0];
673  results.clear();
674  ambig = searchExact(
675  seq, positions, fw_strand, results,
676  max_mismatch_pos[fw_strand],
677  single_res_cache[fw_strand],
678  single_res_cache_set[fw_strand] );
679  if( ambig ) break;
680 
681  if( reportResults( outres, nr, sz, results, fw_strand ) ) {
682  outres.nres_1 = outres.res.size();
683  return;
684  }
685 
686  fw_strand = !fw_strand;
687  if( !results.empty() ) exact_matches_found = true;
688  }while( !fw_strand );
689 
690  if( ambig ) return;
691  }
692 
693  if( mismatch && !exact_matches_found ) {
694  bool fw_strand = true;
695  bool ambig;
696 
697  l = SM;
698  outres.level_1 = l;
699  outres.nres_1 = 0;
700  if( l > sdata.rlevel_1 ) return;
701  nr = (l < sdata.rlevel_1) ? sdata.num_res
702  : sdata.num_res - sdata.nr_1;
703 
704  do {
705  fw_strand = !fw_strand;
706  CMismatchResultsInfo & results_info = hk_data_.mm_1[fw_strand];
707  ambig = searchOneMismatch(
708  seq, positions,
709  max_mismatch_pos[fw_strand], fw_strand,
710  results_info,
711  single_res_cache[fw_strand],
712  single_res_cache_set[fw_strand],
713  res_cache );
714  if( ambig ) break;
715 
716  for( Uint4 ind = 0; ind < results_info.size(); ++ind ) {
717  SMismatchResultsEntry & it = results_info[ind];
718  if( reportResults(
719  outres, nr,
720  sz, it.results, fw_strand, mismatch,
722  it.adjustment ) ) {
723  outres.nres_1 = outres.res.size();
724  return;
725  }
726  }
727  }while( !fw_strand );
728 
729  if( ambig ) return;
730  }
731 
732  outres.nres_1 = outres.res.size();
733  }
734 }
735 
736 END_SCOPE( dbindex_search )
738 
739 #endif
740 
#define false
Definition: bool.h:36
void init(Uint4 sz)
Definition: sr_search.hpp:211
TSRResults & at(Uint4 idx, bool fw_strand)
Definition: sr_search.hpp:233
bool is_set(Uint4 idx, bool fw_strand) const
Definition: sr_search.hpp:218
void set(Uint4 idx, bool fw_strand)
Definition: sr_search.hpp:221
bool searchOneMismatch(const CSeqVector &seq, const vector< TSeqPos > &positions, Uint4 max_pos, bool fw_strand, CMismatchResultsInfo &results_info, vector< TIter > &scache, const vector< Uint1 > &scache_set, CResCache &cache)
void mergeOffsets(TSRResults &resutls, TIter &offsets, Uint4 step)
CSRSearch_Impl(CRef< CDbIndex > index, TSeqPos d, TSeqPos dfuzz)
void copyOffsets(TSRResults &resutls, TIter &offsets)
virtual void search(const SSearchData &sdata, TResults &results)
bool searchExact(const CSeqVector &seq, const vector< TSeqPos > &positions, bool fw_strand, TSRResults &results, TSeqPos &max_pos, vector< TIter > &cache, vector< Uint1 > &cache_set)
TIndex & index_impl_
TIndex::TOffsetIterator TIter
void setResults4Idx(Uint4 idx, bool fw_strand, CResCache &res_cache, vector< TIter > &single_res_cache, const vector< TSeqPos > &positions)
vector< SSRResult > TSRResults
Definition: sr_search.hpp:175
vector< TSRPairedResult > TSRPairedResults
Definition: sr_search.hpp:177
CSeqVector –.
Definition: seq_vector.hpp:65
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
TSeqPos size(void) const
Definition: seq_vector.hpp:291
uint8_t Uint1
1-byte (8-bit) unsigned integer
Definition: ncbitype.h:99
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
int i
range(_Ty, _Ty) -> range< _Ty >
const struct ncbi::grid::netcache::search::fields::KEY key
Magic spell ;-) needed for some weird compilers... very empiric.
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
int offset
Definition: replacements.h:160
USING_SCOPE(ncbi::objects)
void init(TSeqPos pos, Uint4 letter, Uint1 adj)
Definition: sr_search.hpp:260
vector< SResultData > res
Definition: sr_search.hpp:149
const CSeqVector * seq_2
Definition: sr_search.hpp:57
const CSeqVector * seq_1
Definition: sr_search.hpp:56
static bool ambig(char c)
Modified on Wed Feb 21 09:58:05 2024 by modify_doxy.py rev. 669887