;
110m_LookupSegments=
NULL;
111m_BlastMessage=
NULL;
112m_ScoreParams =
NULL;
115m_EffLenParams=
NULL;
137BOOST_REQUIRE(writer_info ==
NULL);
148query_blk, query_info, 1.0, &m_LookupSegments,
NULL,
160query_info, m_ScoreBlk, &m_ScoreParams,
161&m_ExtParams, &m_HitParams, &m_EffLenParams,
172hsp_stream, query_blk, query_info, seq_src,
173m_GapAlign, m_ScoreParams, m_ExtParams, m_HitParams, m_EffLenParams,
205BOOST_REQUIRE(new_hsp ==
NULL);
207BOOST_REQUIRE(gap_align ==
NULL);
211 const intk_num_hsps_start = 9;
212 const intk_num_hsps_end = 7;
215unique_ptr<SSeqLoc> qsl(
218unique_ptr<SSeqLoc> ssl(
232 prog, strand_opt, &query_info);
234query_info, &query_blk,
prog, strand_opt, blast_msg);
236BOOST_REQUIRE(m->empty());
248hsp_list->
hspcnt= k_num_hsps_start;
250hsp_list->
hsp_max= k_num_hsps_start;
256 const intquery_offset[k_num_hsps_start] = { 6020, 6022, 6622, 6622, 5295, 5199, 7191, 3818, 7408};
257 const intquery_end[k_num_hsps_start] = { 6032, 6161, 6730, 6753, 5386, 5219, 7227, 3830, 7419};
258 const intsubject_offset[k_num_hsps_start] = { 98, 104, 241, 241, 16, 0, 378, 71, 63};
259 const intsubject_end[k_num_hsps_start] = { 110, 241, 350, 376, 107, 20, 415, 83, 74};
260 const intscore[k_num_hsps_start] = { 17, 115, 93, 91, 91, 20, 17, 12, 11};
261 const int context[k_num_hsps_start] = { 0, 0, 0, 0, 0, 0, 0, 1, 1};
262 const intsubject_frame[k_num_hsps_start] = { 1, 1, 1, 1, 1, 1, 1, 1, 1};
263 const intquery_gapped_start[k_num_hsps_start] = { 20, 6035, 6625, 6745, 5295, 5199, 7193, 3819, 7409};
264 const intsubject_gapped_start[k_num_hsps_start] = { 115, 116, 244, 368, 16, 0, 380, 72, 64};
266 for(
intindex=0; index<k_num_hsps_start; index++)
298hsp_stream, query_blk, query_info, seq_src, &
results);
302 const intquery_offset_final[k_num_hsps_end] = { 6022, 6622, 5295, 7191, 5199, 7396, 3818};
303 const intquery_end_final[k_num_hsps_end] = { 6161, 6759, 5386, 7231, 5219, 7425, 3830};
304 const intsubject_offset_final[k_num_hsps_end] = { 104, 241, 16, 378, 0, 51, 71};
305 const intsubject_end_final[k_num_hsps_end] = { 241, 383, 107, 419, 20, 80, 83};
306 const intscore_final[k_num_hsps_end] = { 252, 226, 182, 54, 40, 27, 24};
307 const intcontext_final[k_num_hsps_end] = { 0, 0, 0, 0, 0, 1, 1};
308 const intsubject_frame_final[k_num_hsps_end] = { 1, 1, 1, 1, 1, 1, 1};
309 const intquery_gapped_start_final[k_num_hsps_end] = { 6035, 6625, 5295, 7193, 5199, 7409, 3819};
310 const intsubject_gapped_start_final[k_num_hsps_end] = { 116, 244, 16, 380, 0, 64, 72};
311 const intnum_ident_final[k_num_hsps_end] = { 135, 134, 91, 36, 20, 25, 12};
317BOOST_REQUIRE(hsp_list !=
NULL);
318BOOST_REQUIRE_EQUAL(k_num_hsps_end, hsp_list->
hspcnt);
319 for(
intindex=0; index<k_num_hsps_end; index++)
322BOOST_REQUIRE_EQUAL(query_offset_final[index], tmp_hsp->
query.
offset);
323BOOST_REQUIRE_EQUAL(query_end_final[index], tmp_hsp->
query.
end);
324BOOST_REQUIRE_EQUAL(subject_offset_final[index], tmp_hsp->
subject.
offset);
325BOOST_REQUIRE_EQUAL(subject_end_final[index], tmp_hsp->
subject.
end);
326BOOST_REQUIRE_EQUAL(score_final[index], tmp_hsp->
score);
327BOOST_REQUIRE_EQUAL(context_final[index], (
int) tmp_hsp->
context);
328BOOST_REQUIRE_EQUAL(subject_frame_final[index], (
int) tmp_hsp->
subject.
frame);
329BOOST_REQUIRE_EQUAL(query_gapped_start_final[index], tmp_hsp->
query.
gapped_start);
331BOOST_REQUIRE_EQUAL(num_ident_final[index], tmp_hsp->
num_ident);
337BOOST_REQUIRE(seq_src ==
NULL);
341 const intk_num_hsps_start = 3;
342 const intk_num_hsps_end = 1;
345unique_ptr<SSeqLoc> qsl(
348unique_ptr<SSeqLoc> ssl(
356 CBl2Seqblaster(*qsl, *ssl, opts_handle);
367 prog, strand_opt, &query_info);
369query_info, &query_blk,
prog, strand_opt, blast_msg);
372BOOST_REQUIRE(m->empty());
384hsp_list->
hspcnt= k_num_hsps_start;
386hsp_list->
hsp_max= k_num_hsps_start;
392 const intquery_offset[k_num_hsps_start] = { 25194, 13986, 22457};
393 const intquery_end[k_num_hsps_start] = { 31512, 17712, 25019};
394 const intsubject_offset[k_num_hsps_start] = {11211, 0, 8471};
395 const intsubject_end[k_num_hsps_start] = { 17529, 3726, 11036};
396 const intscore[k_num_hsps_start] = { 12433, 7421, 4870};
397 const int context[k_num_hsps_start] = { 1, 1, 1};
398 const intsubject_frame[k_num_hsps_start] = { 1, 1, 1};
399 const intquery_gapped_start[k_num_hsps_start] = { 26671, 13986, 23372};
400 const intsubject_gapped_start[k_num_hsps_start] = { 12688, 0, 9388};
402 for(
intindex=0; index<k_num_hsps_start; index++)
434hsp_stream, query_blk, query_info, seq_src, &
results);
438 const intquery_offset_final[k_num_hsps_end] = { 13986};
439 const intquery_end_final[k_num_hsps_end] = { 41877};
440 const intsubject_offset_final[k_num_hsps_end] = { 0};
441 const intsubject_end_final[k_num_hsps_end] = { 27888};
442 const intscore_final[k_num_hsps_end] = { 55540};
443 const intcontext_final[k_num_hsps_end] = { 1};
444 const intsubject_frame_final[k_num_hsps_end] = { 1};
445 const intquery_gapped_start_final[k_num_hsps_end] = { 26671};
446 const intsubject_gapped_start_final[k_num_hsps_end] = { 12688};
447 const intnum_ident_final[k_num_hsps_end] = { 27856};
453BOOST_REQUIRE(hsp_list !=
NULL);
454BOOST_REQUIRE_EQUAL(k_num_hsps_end, hsp_list->
hspcnt);
455 for(
intindex=0; index<k_num_hsps_end; index++)
458BOOST_REQUIRE_EQUAL(query_offset_final[index], tmp_hsp->
query.
offset);
459BOOST_REQUIRE_EQUAL(query_end_final[index], tmp_hsp->
query.
end);
460BOOST_REQUIRE_EQUAL(subject_offset_final[index], tmp_hsp->
subject.
offset);
461BOOST_REQUIRE_EQUAL(subject_end_final[index], tmp_hsp->
subject.
end);
462BOOST_REQUIRE_EQUAL(score_final[index], tmp_hsp->
score);
463BOOST_REQUIRE_EQUAL(context_final[index], (
int) tmp_hsp->
context);
464BOOST_REQUIRE_EQUAL(subject_frame_final[index], (
int) tmp_hsp->
subject.
frame);
465BOOST_REQUIRE_EQUAL(query_gapped_start_final[index], tmp_hsp->
query.
gapped_start);
467BOOST_REQUIRE_EQUAL(num_ident_final[index], tmp_hsp->
num_ident);
473BOOST_REQUIRE(seq_src ==
NULL);
477 const intk_num_hsps_start = 12;
478 const intk_num_hsps_end = 10;
483unique_ptr<SSeqLoc> qsl(
485unique_ptr<SSeqLoc> ssl(
489 CBl2Seqblaster(*qsl, *ssl, opts_handle);
500 prog, strand_opt, &query_info);
502query_info, &query_blk,
prog, strand_opt, blast_msg);
504BOOST_REQUIRE(m->empty());
516hsp_list->
hspcnt= k_num_hsps_start;
518hsp_list->
hsp_max= k_num_hsps_start;
524 const intquery_offset[k_num_hsps_start] = { 0, 3864, 3254, 1828, 2189, 795, 607, 1780, 1363, 2751, 3599, 242};
525 const intquery_end[k_num_hsps_start] = { 307, 4287, 3556, 2058, 2269, 914, 741, 1821, 1451, 2810, 3631, 285};
526 const intsubject_offset[k_num_hsps_start] = { 1, 2723, 2267, 1028, 1292, 634, 501, 925, 1195, 1795, 477, 1233};
527 const intsubject_end[k_num_hsps_start] = { 321, 3171, 2537, 1243, 1371, 749, 618, 966, 1286, 1869, 509, 1276};
528 const intscore[k_num_hsps_start] = { 370, 319, 139, 120, 89, 84, 75, 70, 69, 60, 47, 43};
529 const intquery_gapped_start[k_num_hsps_start] = { 47, 4181, 3286, 2034, 2228, 871, 632, 1798, 1383, 2759, 3606, 259};
530 const intsubject_gapped_start[k_num_hsps_start] = { 48, 3073, 2299, 1219, 1330, 709, 526, 943, 1215, 1803, 484, 1250};
532 for(
intindex=0; index<k_num_hsps_start; index++)
562hsp_stream, query_blk, query_info, seq_src, &
results);
566 const intquery_offset_final[k_num_hsps_end] = { 0, 3864, 3254, 1780, 2189, 607, 1363, 2751, 3599, 242};
567 const intquery_end_final[k_num_hsps_end] = { 307, 4287, 3556, 2058, 2599, 914, 1451, 2810, 3631, 285};
568 const intsubject_offset_final[k_num_hsps_end] = { 1, 2723, 2267, 925, 1292, 501, 1195, 1795, 477, 1233};
569 const intsubject_end_final[k_num_hsps_end] = { 321, 3171, 2537, 1243, 1704, 749, 1286, 1869, 509, 1276};
570 const intscore_final[k_num_hsps_end] = { 367, 319, 139, 131, 122, 104, 69, 60, 47, 43};
571 const intquery_gapped_start_final[k_num_hsps_end] = { 47, 4181, 3286, 2034, 2228, 871, 1383, 2759, 3606, 259};
572 const intsubject_gapped_start_final[k_num_hsps_end] = { 48, 3073, 2299, 1219, 1330, 709, 1215, 1803, 484, 1250};
573 const intnum_ident_final[k_num_hsps_end] = { 100, 122, 70, 61, 92, 54, 22, 18, 11, 9};
579BOOST_REQUIRE(hsp_list !=
NULL);
580BOOST_REQUIRE_EQUAL(k_num_hsps_end, hsp_list->
hspcnt);
581 for(
intindex=0; index<k_num_hsps_end; index++)
584BOOST_REQUIRE_EQUAL(query_offset_final[index], tmp_hsp->
query.
offset);
585BOOST_REQUIRE_EQUAL(query_end_final[index], tmp_hsp->
query.
end);
586BOOST_REQUIRE_EQUAL(subject_offset_final[index], tmp_hsp->
subject.
offset);
587BOOST_REQUIRE_EQUAL(subject_end_final[index], tmp_hsp->
subject.
end);
588BOOST_REQUIRE_EQUAL(score_final[index], tmp_hsp->
score);
589BOOST_REQUIRE_EQUAL(query_gapped_start_final[index], tmp_hsp->
query.
gapped_start);
591BOOST_REQUIRE_EQUAL(num_ident_final[index], tmp_hsp->
num_ident);
597BOOST_REQUIRE(seq_src ==
NULL);
601 const intk_num_hsps_start = 16;
602 const intk_num_hsps_end = 11;
607unique_ptr<SSeqLoc> qsl(
609unique_ptr<SSeqLoc> ssl(
616 CBl2Seqblaster(*qsl, *ssl, opts_handle);
627 prog, strand_opt, &query_info);
629query_info, &query_blk,
prog, strand_opt, blast_msg);
631BOOST_REQUIRE(m->empty());
643hsp_list->
hspcnt= k_num_hsps_start;
645hsp_list->
hsp_max= k_num_hsps_start;
651 const intquery_offset[k_num_hsps_start] = { 149, 606, 656, 313, 221, 701, 57,
652472, 0, 532, 404, 279, 125, 32, 371, 913};
653 const intquery_end[k_num_hsps_start] = { 189, 662, 705, 377, 281, 747, 138,
654533, 33, 575, 472, 312, 150, 59, 405, 941};
655 const intsubject_offset[k_num_hsps_start] = { 58604, 59751, 59831, 58974,
65658732, 59910, 58411, 59474, 58102, 59566, 59363, 58890, 58552, 58165, 59129, 9193};
657 const intsubject_end[k_num_hsps_start] = { 58644, 59807, 59880, 59038, 58792,
65859956, 58489, 59535, 58135, 59609, 59432, 58923, 58577, 58192, 59163, 9221};
659 const intscore[k_num_hsps_start] = { 253, 237, 214, 193, 183, 178, 168, 165, 162,
660149, 125, 120, 120, 113, 100, 55};
661 const intsubject_frame[k_num_hsps_start] = { -3, -2, -2, -2, -3, -2, -1, -3, -2,
662-1, -2, -2, -3, -3, -3, 3};
663 const intquery_gapped_start[k_num_hsps_start] = { 173, 611, 662, 319, 254, 719, 72,
664491, 11, 554, 438, 286, 131, 39, 379, 929};
665 const intsubject_gapped_start[k_num_hsps_start] = { 58629, 59756, 59837, 58980, 58765,
66659928, 58426, 59493, 58113, 59588, 59399, 58897, 58558, 58172, 59137, 9209};
668 for(
intindex=0; index<k_num_hsps_start; index++)
699hsp_stream, query_blk, query_info, seq_src, &
results);
703 const intquery_offset_final[k_num_hsps_end] = {606, 125, 279, 57, 472, 0, 532,
705 const intquery_end_final[k_num_hsps_end] = {747, 281, 377, 138, 533, 33, 575,
707 const intsubject_offset_final[k_num_hsps_end] = {59751, 58552, 58890, 58411, 59474,
70858102, 59566, 59389, 58165, 59129, 9193};
709 const intsubject_end_final[k_num_hsps_end] = {59956, 58792, 59038, 58489, 59535,
71058135, 59609, 59432, 58192, 59163, 9221};
711 const intscore_final[k_num_hsps_end] = {525, 465, 250, 167, 165, 162, 149,
713 const intsubject_frame_final[k_num_hsps_end] = {-2, -3, -2, -1, -3, -2,
715 const intquery_gapped_start_final[k_num_hsps_end] = {611, 173, 319, 72, 491,
71611, 554, 438, 39, 379, 929};
717 const intsubject_gapped_start_final[k_num_hsps_end] = {59756, 58629,
71858980, 58426, 59493, 58113, 59588, 59399, 58172, 59137, 9209};
719 const intnum_ident_final[k_num_hsps_end] = {116, 105, 54, 44, 27, 31, 29,
721 const intnums[k_num_hsps_end] = {1, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1};
726BOOST_REQUIRE(hsp_list !=
NULL);
727BOOST_REQUIRE_EQUAL(k_num_hsps_end, hsp_list->
hspcnt);
728 for(
intindex=0; index<k_num_hsps_end; index++)
732BOOST_REQUIRE_EQUAL(query_offset_final[index], tmp_hsp->
query.
offset);
733BOOST_REQUIRE_EQUAL(query_end_final[index], tmp_hsp->
query.
end);
734BOOST_REQUIRE_EQUAL(subject_offset_final[index], tmp_hsp->
subject.
offset);
735BOOST_REQUIRE_EQUAL(subject_end_final[index], tmp_hsp->
subject.
end);
736BOOST_REQUIRE_EQUAL(score_final[index], tmp_hsp->
score);
737BOOST_REQUIRE_EQUAL(subject_frame_final[index], (
int) tmp_hsp->
subject.
frame);
738BOOST_REQUIRE_EQUAL(query_gapped_start_final[index], tmp_hsp->
query.
gapped_start);
740BOOST_REQUIRE_EQUAL(num_ident_final[index], tmp_hsp->
num_ident);
741BOOST_REQUIRE_EQUAL(nums[index], tmp_hsp->
num);
747BOOST_REQUIRE(seq_src ==
NULL);
753 const intkNumHsps = 3;
754 const intq_offsets[kNumHsps] = { 1, 144, 203 };
755 const intq_ends[kNumHsps] = { 151, 191, 226 };
756 const intq_gapped_starts[kNumHsps] = { 23, 153, 209 };
757 const ints_offsets[kNumHsps] = { 501, 655, 736 };
758 const ints_ends[kNumHsps] = { 648, 702, 756 };
759 const ints_gapped_starts[kNumHsps] = { 523, 664, 742 };
760 const ints_frames[kNumHsps] = { 3, 1, 3 };
761 const intscores[kNumHsps] = { 211, 91, 52 };
762 const Int8kSearchSp = 20763230804LL;
763 const stringkDbName(
"data/nt.41646578");
778 for(
intindex = 0; index < kNumHsps; ++index) {
780hsp->
score= scores[index];
789hsp_list->
hspcnt= kNumHsps;
807BOOST_REQUIRE(writer_info ==
NULL);
809kProgramType, ext_options,
FALSE, 1, writer);
812BOOST_REQUIRE(hit_options ==
NULL);
814BOOST_REQUIRE(scoring_options ==
NULL);
816BOOST_REQUIRE(ext_options ==
NULL);
843BOOST_REQUIRE_EQUAL(kNumHsps, (
int)crs[0].GetSeqAlign()->Size());
847 const intk_num_hsps_start = 12;
848 const intk_num_hsps_filtered = 6;
853unique_ptr<SSeqLoc> qsl(
855unique_ptr<SSeqLoc> ssl(
859 CBl2Seqblaster(*qsl, *ssl, opts_handle);
870 prog, strand_opt, &query_info);
872query_info, &query_blk,
prog, strand_opt, blast_msg);
874BOOST_REQUIRE(m->empty());
886hsp_list->
hspcnt= k_num_hsps_start;
888hsp_list->
hsp_max= k_num_hsps_start;
894 const intquery_offset[k_num_hsps_start] = { 0, 3864, 3254, 1828, 2189, 795, 607, 1780, 1363, 2751, 3599, 242};
895 const intquery_end[k_num_hsps_start] = { 307, 4287, 3556, 2058, 2269, 914, 741, 1821, 1451, 2810, 3631, 285};
896 const intsubject_offset[k_num_hsps_start] = { 1, 2723, 2267, 1028, 1292, 634, 501, 925, 1195, 1795, 477, 1233};
897 const intsubject_end[k_num_hsps_start] = { 321, 3171, 2537, 1243, 1371, 749, 618, 966, 1286, 1869, 509, 1276};
898 const intscore[k_num_hsps_start] = { 370, 319, 139, 120, 89, 84, 75, 70, 69, 60, 47, 43};
899 const intquery_gapped_start[k_num_hsps_start] = { 47, 4181, 3286, 2034, 2228, 871, 632, 1798, 1383, 2759, 3606, 259};
900 const intsubject_gapped_start[k_num_hsps_start] = { 48, 3073, 2299, 1219, 1330, 709, 526, 943, 1215, 1803, 484, 1250};
902 for(
intindex=0; index<k_num_hsps_start; index++)
933hsp_stream, query_blk, query_info, seq_src, &
results);
941BOOST_REQUIRE(hsp_list !=
NULL);
942BOOST_REQUIRE_EQUAL(k_num_hsps_filtered, hsp_list->
hspcnt);
947BOOST_REQUIRE(seq_src ==
NULL);
952 const intk_num_hsps_start = 9;
953 const intk_num_hsps_filtered = 4;
956unique_ptr<SSeqLoc> qsl(
959unique_ptr<SSeqLoc> ssl(
973 prog, strand_opt, &query_info);
975query_info, &query_blk,
prog, strand_opt, blast_msg);
977BOOST_REQUIRE(m->empty());
989hsp_list->
hspcnt= k_num_hsps_start;
991hsp_list->
hsp_max= k_num_hsps_start;
997 const intquery_offset[k_num_hsps_start] = { 6020, 6022, 6622, 6622, 5295, 5199, 7191, 3818, 7408};
998 const intquery_end[k_num_hsps_start] = { 6032, 6161, 6730, 6753, 5386, 5219, 7227, 3830, 7419};
999 const intsubject_offset[k_num_hsps_start] = { 98, 104, 241, 241, 16, 0, 378, 71, 63};
1000 const intsubject_end[k_num_hsps_start] = { 110, 241, 350, 376, 107, 20, 415, 83, 74};
1001 const intscore[k_num_hsps_start] = { 17, 115, 93, 91, 91, 20, 17, 12, 11};
1002 const int context[k_num_hsps_start] = { 0, 0, 0, 0, 0, 0, 0, 1, 1};
1003 const intsubject_frame[k_num_hsps_start] = { 1, 1, 1, 1, 1, 1, 1, 1, 1};
1004 const intquery_gapped_start[k_num_hsps_start] = { 20, 6035, 6625, 6745, 5295, 5199, 7193, 3819, 7409};
1005 const intsubject_gapped_start[k_num_hsps_start] = { 115, 116, 244, 368, 16, 0, 380, 72, 64};
1007 for(
intindex=0; index<k_num_hsps_start; index++)
1040hsp_stream, query_blk, query_info, seq_src, &
results);
1048BOOST_REQUIRE(hsp_list !=
NULL);
1049BOOST_REQUIRE_EQUAL(k_num_hsps_filtered, hsp_list->
hspcnt);
1054BOOST_REQUIRE(seq_src ==
NULL);
1060hsp_list->
oid= oid;
1061hsp_list->
hspcnt= num_hsps;
1063hsp_list->
hsp_max= num_hsps;
1067vector<int> subject_offset;
1068 for(
int i=0;
i< num_hsps;
i++) {
1069subject_offset.push_back(rand()%(
len-range_len));
1072 for(
intindex=0; index < num_hsps; index++) {
1089 stringrel_path =
"blast/algo/unit_tests/api/data/long_seqs";
1096cout <<
"testUnit_TestsDataPath: Can't access: "<< (
NCBI_GetTestDataPath() + rel_path ) << endl;
1098BOOST_REQUIRE(seqSrc !=
NULL);
1104 stringrel_path =
"blast/algo/unit_tests/api/data/long_seqs";
1109BOOST_REQUIRE(seqSrc !=
NULL);
1112 const intk_num_hsps = 6;
1115hsp_list->
hspcnt= k_num_hsps;
1117hsp_list->
hsp_max= k_num_hsps;
1121 const intsubject_offset[k_num_hsps] = { 0, 1110000, 98765, 1430868, 2134657, 25285936};
1123 for(
intindex=0; index<k_num_hsps; index++) {
1141BOOST_REQUIRE_EQUAL(ranges->
num_ranges, 6);
1142BOOST_REQUIRE_EQUAL(ranges->
ranges[0], 0);
1143BOOST_REQUIRE_EQUAL(ranges->
ranges[11],
len);
1148 stringrel_path =
"blast/algo/unit_tests/api/data/long_seqs";
1153BOOST_REQUIRE(seqSrc !=
NULL);
1156 const intkMaxNum = 36;
1157 const intkRangeLen = 10000;
1162seq_arg_ref.
oid= kOid;
1174 #pragma omp parallel for default(none) num_threads(8) schedule(guided) shared(seqSrc, len, kOid, seq_arg_array, hsp_list_array) 1175 for(
i= 0;
i< kMaxNum;
i++) {
1177hsp_list_array[
i] = hsp_list;
1180seq_arg->
oid= hsp_list->
oid;
1186seq_arg_array[
i] = seq_arg;
1194 for(
intk=0; k < kMaxNum; k++) {
1197 for(
intj =0; j < hsp_list->
hspcnt; j++){
1204 free(seq_arg_array[k]);
1205 free(hsp_list_array[k]);
1207 free(seq_arg_array);
1208 free(hsp_list_array);
Declares the CBl2Seq (BLAST 2 Sequences) class.
BlastSeqLoc * BlastSeqLocFree(BlastSeqLoc *loc)
Deallocate all BlastSeqLoc objects in a chain.
Structures and functions prototypes used for BLAST gapped extension.
BlastGapAlignStruct * BLAST_GapAlignStructFree(BlastGapAlignStruct *gap_align)
Deallocates memory in the BlastGapAlignStruct structure.
BlastHSP * Blast_HSPNew(void)
Allocate and zeros out memory for an HSP structure.
BlastHSPResults * Blast_HSPResultsFree(BlastHSPResults *results)
Deallocate memory for BLAST results.
BlastHSPList * Blast_HSPListNew(Int4 hsp_max)
Creates HSP list structure with a default size HSP array.
BlastHSP * Blast_HSPFree(BlastHSP *hsp)
Deallocate memory for an HSP structure.
void Blast_HSPListSortByScore(BlastHSPList *hsp_list)
Sort the HSPs in an HSP list by score.
BlastHSPWriter * BlastHSPWriterNew(BlastHSPWriterInfo **writer_info, BlastQueryInfo *query_info, BLAST_SequenceBlk *query)
A generic function to create writer.
Declaration of ADT to save and retrieve lists of HSPs in the BLAST engine.
int BlastHSPStreamWrite(BlastHSPStream *hsp_stream, BlastHSPList **hsp_list)
Invokes the user-specified write function for this BlastHSPStream implementation.
BlastHSPStream * BlastHSPStreamFree(BlastHSPStream *hsp_stream)
Frees the BlastHSPStream structure by invoking the destructor function set by the user-defined constr...
BlastHSPStream * BlastHSPStreamNew(EBlastProgramType program, const BlastExtensionOptions *extn_opts, Boolean sort_on_read, Int4 num_queries, BlastHSPWriter *writer)
Initialize the HSP stream.
Common definitions for protein and nucleotide lookup tables.
Blast_Message * Blast_MessageFree(Blast_Message *blast_msg)
Deallocates message memory.
Declares the CBlastNucleotideOptionsHandle class.
Definitions which are dependant on the NCBI C++ Object Manager.
BlastHitSavingOptions * BlastHitSavingOptionsFree(BlastHitSavingOptions *options)
Deallocate memory for BlastHitSavingOptions.
Int2 BlastScoringOptionsNew(EBlastProgramType program, BlastScoringOptions **options)
Allocate memory for BlastScoringOptions and fill with default values.
BlastExtensionOptions * BlastExtensionOptionsFree(BlastExtensionOptions *options)
Deallocate memory for BlastExtensionOptions.
Int2 BlastHitSavingOptionsNew(EBlastProgramType program, BlastHitSavingOptions **options, Boolean gapped_calculation)
Allocate memory for BlastHitSavingOptions.
BlastScoringOptions * BlastScoringOptionsFree(BlastScoringOptions *options)
Deallocate memory for BlastScoringOptions.
Int2 BlastExtensionOptionsNew(EBlastProgramType program, BlastExtensionOptions **options, Boolean gapped)
Allocate memory for BlastExtensionOptions and fill with default values.
Declares the CBlastOptionsHandle and CBlastOptionsFactory classes.
BlastHitSavingParameters * BlastHitSavingParametersFree(BlastHitSavingParameters *parameters)
Deallocate memory for BlastHitSavingOptions*.
BlastEffectiveLengthsParameters * BlastEffectiveLengthsParametersFree(BlastEffectiveLengthsParameters *parameters)
Deallocate memory for BlastEffectiveLengthsParameters*.
BlastExtensionParameters * BlastExtensionParametersFree(BlastExtensionParameters *parameters)
Deallocate memory for BlastExtensionParameters.
BlastScoringParameters * BlastScoringParametersFree(BlastScoringParameters *parameters)
Deallocate memory for BlastScoringParameters.
EBlastProgramType
Defines the engine's notion of the different applications of the BLAST algorithm.
Declares the CBlastProteinOptionsHandle class.
Defines interface for retrieving sequence identifiers.
Int4 BlastSeqSrcGetSeqLen(const BlastSeqSrc *seq_src, void *oid)
Retrieve sequence length (number of residues/bases)
BlastSeqSrc * BlastSeqSrcCopy(const BlastSeqSrc *seq_src)
Copy function: needed to guarantee thread safety.
char * BlastSeqSrcGetInitError(const BlastSeqSrc *seq_src)
Function to retrieve NULL terminated string containing the description of an initialization error or ...
BlastSeqSrc * BlastSeqSrcFree(BlastSeqSrc *seq_src)
Frees the BlastSeqSrc structure by invoking the destructor function set by the user-defined construct...
Int2 BlastSeqSrcGetSequence(const BlastSeqSrc *seq_src, BlastSeqSrcGetSeqArg *getseq_arg)
Retrieve an individual sequence.
BlastSeqSrcSetRangesArg * BlastSeqSrcSetRangesArgFree(BlastSeqSrcSetRangesArg *arg)
free setrangearg
Utilities initialize/setup BLAST.
Int2 BLAST_MainSetUp(EBlastProgramType program_number, const QuerySetUpOptions *qsup_options, const BlastScoringOptions *scoring_options, BLAST_SequenceBlk *query_blk, const BlastQueryInfo *query_info, double scale_factor, BlastSeqLoc **lookup_segments, BlastMaskLoc **mask, BlastScoreBlk **sbpp, Blast_Message **blast_message, GET_MATRIX_PATH get_path)
"Main" setup routine for BLAST.
Int2 BLAST_GapAlignSetUp(EBlastProgramType program_number, const BlastSeqSrc *seq_src, const BlastScoringOptions *scoring_options, const BlastEffectiveLengthsOptions *eff_len_options, const BlastExtensionOptions *ext_options, const BlastHitSavingOptions *hit_options, BlastQueryInfo *query_info, BlastScoreBlk *sbp, BlastScoringParameters **score_params, BlastExtensionParameters **ext_params, BlastHitSavingParameters **hit_params, BlastEffectiveLengthsParameters **eff_len_params, BlastGapAlignStruct **gap_align)
Set up the auxiliary structures for gapped alignment / traceback only.
BlastScoreBlk * BlastScoreBlkFree(BlastScoreBlk *sbp)
Deallocates BlastScoreBlk as well as all associated structures.
Functions to do gapped alignment with traceback.
Int2 Blast_HSPUpdateWithTraceback(BlastGapAlignStruct *gap_align, BlastHSP *hsp)
Modifies the HSP data after the final gapped alignment.
BlastSeqSrcSetRangesArg * BLAST_SetupPartialFetching(EBlastProgramType program_number, BlastSeqSrc *seq_src, const BlastHSPList **hsp_list, Int4 num_hsplists)
Attempts to set up partial fetching, if it fails (e.g.
EBlastEncoding Blast_TracebackGetEncoding(EBlastProgramType program_number)
Get the subject sequence encoding type for the traceback, given a program number.
Int2 BLAST_ComputeTraceback(EBlastProgramType program_number, BlastHSPStream *hsp_stream, BLAST_SequenceBlk *query, BlastQueryInfo *query_info, const BlastSeqSrc *seq_src, BlastGapAlignStruct *gap_align, BlastScoringParameters *score_params, const BlastExtensionParameters *ext_params, BlastHitSavingParameters *hit_params, BlastEffectiveLengthsParameters *eff_len_params, const BlastDatabaseOptions *db_options, const PSIBlastOptions *psi_options, const BlastRPSInfo *rps_info, SPHIPatternSearchBlk *pattern_blk, BlastHSPResults **results, TInterruptFnPtr interrupt_search, SBlastProgress *progress_info)
Given the preliminary alignment results from a database search, redo the gapped alignment with traceb...
Definitions of special type used in BLAST.
EProgram
This enumeration is to evolve into a task/program specific list that specifies sets of default parame...
@ eBlastn
Nucl-Nucl (traditional blastn)
@ eTblastn
Protein-Translated nucl.
BLAST_SequenceBlk * BlastSequenceBlkFree(BLAST_SequenceBlk *seq_blk)
Deallocate memory for a sequence block.
BOOST_AUTO_TEST_SUITE_END() static int s_GetSegmentFlags(const CBioseq &bioseq)
Declares the CBlastxOptionsHandle class.
Wrapper class for BLAST_SequenceBlk .
Runs the BLAST algorithm between 2 sequences.
Handle to the nucleotide-nucleotide options to the BLAST algorithm.
Encapsulates ALL the BLAST algorithm's options.
Handle to the protein-protein options to the BLAST algorithm.
Wrapper class for BlastQueryInfo .
Wrapper class for BlastSeqSrc .
NCBI C++ Object Manager dependant implementation of IQueryFactory.
Search Results for All Queries.
Handle to the protein-translated nucleotide options to the BLAST algorithm.
CRef< blast::CBlastSearchQuery > CreateBlastSearchQuery(objects::CSeq_id &id, objects::ENa_strand s=objects::eNa_strand_unknown)
static CTestObjMgr & Instance()
static BlastHSPStream * x_MakeStream(const CBlastOptions &opt)
void x_SetupMain(const CBlastOptions &opt, const CBLAST_SequenceBlk &query_blk, const CBlastQueryInfo &query_info)
void x_SetupGapAlign(const CBlastOptions &opt, const BlastSeqSrc *seq_src, const CBlastQueryInfo &query_info)
void x_ComputeTracebak(const CBlastOptions &opt, BlastHSPStream *hsp_stream, const CBLAST_SequenceBlk &query_blk, const CBlastQueryInfo &query_info, const BlastSeqSrc *seq_src, BlastHSPResults **results)
typedef for the messages for an entire BLAST search, which could be comprised of multiple query seque...
@ eNoCompositionBasedStats
Don't use composition based statistics.
Declares the CDiscNucleotideOptionsHandle class.
BlastHitSavingOptions * GetHitSaveOpts() const
Returns BlastHitSavingOptions for eLocal objects, NULL for eRemote.
void SetCompositionBasedStats(ECompoAdjustModes mode)
BlastSeqSrc * Get() const
const CBlastOptionsHandle & GetOptionsHandle() const
Retrieve the options handle.
void SetQueryCovHspPerc(double p)
Sets QueryCovHspPerc.
void SetDbLength(Int8 len)
Sets DbLength.
void SetMatchReward(int r)
Sets MatchReward.
BlastExtensionOptions * GetExtnOpts() const
Returns BlastExtensionOptions for eLocal objects, NULL for eRemote.
BlastSeqSrc * SeqDbBlastSeqSrcInit(const string &dbname, bool is_prot, Uint4 first_seq=0, Uint4 last_seq=0, Int4 mask_algo_id=-1, ESubjectMaskingType mask_type=eNoSubjMasking)
Initialize the sequence source structure.
CStructWrapper< TData > * WrapStruct(TData *obj, TData *(*del)(TData *))
Auxiliary function to create a CStructWrapper for a pointer to an object.
void SetupQueries(TSeqLocVector &queries, BlastQueryInfo *qinfo, BLAST_SequenceBlk **seqblk, EBlastProgramType prog, objects::ENa_strand strand_opt, TSearchMessages &messages)
Populates BLAST_SequenceBlk with sequence data for use in CORE BLAST.
objects::ENa_strand GetStrandOption() const
void SetEffectiveSearchSpace(Int8 eff)
Sets EffectiveSearchSpace.
CRef< CSearchResultSet > Run()
Run the traceback search.
static CBlastOptionsHandle * Create(EProgram program, EAPILocality locality=CBlastOptions::eLocal)
Creates an options handle object configured with default options for the requested program,...
CBlastOptions & SetOptions()
Returns a reference to the internal options class which this object is a handle for.
void SetTraditionalBlastnDefaults()
Sets TraditionalBlastnDefaults.
BlastSeqSrc * MultiSeqBlastSeqSrcInit(TSeqLocVector &seq_vector, EBlastProgramType program, bool dbscan_mode=false)
Initialize the sequence source structure.
BlastEffectiveLengthsOptions * GetEffLenOpts() const
Returns BlastEffectiveLengthsOptions for eLocal objects, NULL for eRemote.
void SetMaxHspsPerSubject(int m)
Sets MaxHspPerSubjectQueryPair.
EBlastProgramType GetProgramType() const
Returns the CORE BLAST notion of program type.
const CBlastOptions & GetOptions() const
Return the object which this object is a handle for.
BlastScoringOptions * GetScoringOpts() const
Returns BlastScoringOptions for eLocal objects, NULL for eRemote.
char * BlastFindMatrixPath(const char *matrix_name, Boolean is_prot)
Returns the path to a specified matrix.
void SetGapXDropoffFinal(double x)
Sets GapXDropoffFinal.
QuerySetUpOptions * GetQueryOpts() const
Returns QuerySetUpOptions for eLocal objects, NULL for eRemote.
const TSeqLocVector & GetQueries() const
Retrieve a vector of query sequences.
CBlastOptionsHandle & SetOptionsHandle()
Set the options handle.
void SetupQueryInfo(TSeqLocVector &queries, EBlastProgramType prog, objects::ENa_strand strand_opt, BlastQueryInfo **qinfo)
Allocates the query information structure and fills the context offsets, in case of multiple queries,...
BlastDatabaseOptions * GetDbOpts() const
Returns BlastDatabaseOptions for eLocal objects, NULL for eRemote.
void SetSegFiltering(bool val=true)
size_type GetNumResults() const
Return the number of results contained by this object.
const TSeqLocVector & GetSubjects() const
Retrieve a vector of subject sequences.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
static char GetPathSeparator(void)
Get path separator symbol specific for the current platform.
static string ConcatPath(const string &first, const string &second)
Concatenate two parts of the path for the current OS.
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
ENa_strand
strand of nucleic acid
@ eNa_strand_both
in forward orientation
Implementation of a number of BlastHSPWriters to save hits from a BLAST search, and subsequently retu...
BlastHSPCollectorParams * BlastHSPCollectorParamsNew(const BlastHitSavingOptions *hit_options, Int4 compositionBasedStats, Boolean gapped_calculation)
Sets up parameter set for use by collector.
BlastHSPWriterInfo * BlastHSPCollectorInfoNew(BlastHSPCollectorParams *params)
WriterInfo to create a default writer: the collecter.
Utility functions for lookup table generation.
void CheckForBlastSeqSrcErrors(const BlastSeqSrc *seqsrc)
Magic spell ;-) needed for some weird compilers... very empiric.
#define FALSE
bool replacment for C indicating false.
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
Defines: CTimeFormat - storage class for time format.
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
Defines a concrete strategy for the IBlastSeqInfoSrc interface for sequence identifiers retrieval fro...
Implementation of the BlastSeqSrc interface for a vector of sequence locations.
Implementation of the BlastSeqSrc interface using the C++ BLAST databases API.
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
vector< SSeqLoc > TSeqLocVector
Vector of sequence locations.
Uint1 * sequence_start
Start of sequence, usually one byte before sequence as that byte is a NULL sentinel byte.
Parameters for setting up effective lengths and search spaces.
Options used for gapped extension These include: a.
Int4 compositionBasedStats
mode of compositional adjustment to use; if zero then compositional adjustment is not used
Computed values used as parameters for gapped alignments.
Structure supporting the gapped alignment.
Int4 query_stop
query end offseet of current alignment
Int4 subject_start
subject start offset current alignment
Int4 query_start
query start offset of current alignment
Int4 subject_stop
subject end offset of current alignment
Int4 score
Return value: alignment score.
GapEditScript * edit_script
The traceback (gap) information.
The structure to hold all HSPs for a given sequence after the gapped alignment.
Boolean do_not_reallocate
Is reallocation of the hsp_array allowed?
Int4 oid
The ordinal id of the subject sequence this HSP list is for.
Int4 hspcnt
Number of HSPs saved.
BlastHSP ** hsp_array
Array of pointers to individual HSPs.
Int4 hsp_max
The maximal number of HSPs allowed to be saved.
Int4 allocated
The allocated size of the hsp_array.
The structure to contain all BLAST results, for multiple queries.
Default implementation of BlastHSPStream.
A wrap of data structure used to create a writer.
ADT definition of BlastHSPWriter.
Structure holding all information about an HSP.
Int4 num_ident
Number of identical base pairs in this HSP.
BlastSeg query
Query sequence info.
Int4 context
Context number of query.
Int4 num
How many HSP's are linked together for sum statistics evaluation? If unset (0), this HSP is not part ...
BlastSeg subject
Subject sequence info.
GapEditScript * gap_info
ALL gapped alignment is here.
Int4 score
This HSP's raw score.
The structure to contain all BLAST results for one query sequence.
BlastHSPList ** hsplist_array
Array of HSP lists for individual database hits.
Options used when evaluating and saving hits These include: a.
Parameter block that contains a pointer to BlastHitSavingOptions and the values derived from it.
Structure used for scoring calculations.
Scoring options block Used to produce the BlastScoreBlk structure This structure may be needed for lo...
Boolean gapped_calculation
gap-free search if FALSE
Scoring parameters block Contains scoring-related information that is actually used for the blast sea...
Int4 gapped_start
Where the gapped extension started.
Int2 frame
Translation frame.
Int4 offset
Start of hsp.
Used to hold a set of positions, mostly used for filtering.
Structure used as the second argument to functions satisfying the GetSeqBlkFnPtr signature,...
Int4 oid
Oid in BLAST database, index in an array of sequences, etc [in].
Boolean reset_ranges
This option allows the BLAST engine to communicate with the BlastSeqSrc that the offset ranges for a ...
EBlastEncoding encoding
Encoding of sequence, i.e.
Boolean check_oid_exclusion
Check whether an OID is excluded due to overlapping filtering.
BlastSeqSrcSetRangesArg * ranges
BLAST_SequenceBlk * seq
Sequence to return, if NULL, it should allocated by GetSeqBlkFnPtr (using BlastSeqBlkNew or BlastSetU...
Structure used as the argument to function SetRanges.
Int4 * ranges
Ranges in sorted order [in].
Int4 num_ranges
Number of actual ranges contained.
Complete type definition of Blast Sequence Source ADT.
Structure to hold the a message from the core of the BLAST engine.
Edit script: linked list of correspondencies between two sequences.
Declares the CTBlastnOptionsHandle class.
Utility stuff for more convenient using of Boost.Test library.
Defines location of test data folder at NCBI.
static const char * NCBI_GetTestDataPath(void)
Get the directory where test data is stored at NCBI.
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
BlastHSPList * s_GetHSPList(int num_hsps, int oid, int len, int range_len)
BOOST_AUTO_TEST_CASE(testHSPUpdateWithTraceback)
static CS_CONTEXT * context
voidp calloc(uInt items, uInt size)
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