A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/blasthits__unit__test_8cpp_source.html below:

NCBI C++ ToolKit: src/algo/blast/unit_tests/api/blasthits_unit_test.cpp Source File

62 using namespace ncbi

;

70  const int

kNumLists = 3;

71  const int

kMaxHspCount = 6;

72  const int

kHspCounts[kNumLists] = { 6, 6, 4 };

73  const int

kSubjectOffsets[kNumLists][kMaxHspCount] =

74

{ { 100, 9950, 5000, 9850, 3000, 9970 },

75

{ 9950, 9902, 9970, 10400, 19750, 19820 },

76

{ 19805, 25000, 19820, 22000 } };

77  const int

kQueryOffsets[kNumLists][kMaxHspCount] =

78

{ { 100, 200, 300, 400, 500, 600 },

79

{ 200, 452, 600, 100, 200, 300 },

80

{ 255, 100, 300, 200 } };

81  const int

kLengths[kNumLists][kMaxHspCount] =

82

{ { 100, 45, 100, 100, 100, 28 },

83

{ 100, 48, 100, 100, 100, 60 },

84

{ 45, 200, 60, 200} };

85  const int

kScores[kNumLists][kMaxHspCount] =

86

{ { 60, 30, 70, 75, 65, 28 },

87

{ 80, 40, 62, 77, 72, 44 },

88

{ 32, 120, 44, 111 } };

89  const int

contexts[kNumLists][kMaxHspCount] =

90

{ { 0, 1, 2, 1, 3, 1 },

96

hsp_list->

hspcnt

= kHspCounts[chunk];

97  for

(index = 0; index < kHspCounts[chunk]; ++index) {

103

kQueryOffsets[chunk][index] + kLengths[chunk][index];

105

kSubjectOffsets[chunk][index] + kLengths[chunk][index];

138

BOOST_REQUIRE_EQUAL(0, status);

139

BOOST_REQUIRE(target_t);

143

BOOST_REQUIRE(null_sequence ==

NULL

);

145  const int

kNumTests = 6;

147  Blast_HSPInit

(1, 2000, 2000, 3000, 1, 2000, 0, 0, -3, 2000,

NULL

, &hsp);

149  const int

kMaxTranslation = 99;

150  const int

kMaxDiv3 = kMaxTranslation / 3;

153  const int

kLength[kNumTests] = {3199, 3399, 3600, 3800, 3999, 4199};

154  const int

kValues[2*kNumTests] = {6, 16, 18, 10, 10, 6, 8, 4, 18, 17, 1, 6};

156  for

(index=0; index<kNumTests; index++)

162

BOOST_REQUIRE_EQUAL(kValues[2*index], (

int

) sequence[hsp->

subject

.

offset

+5]);

166  if

(sequence[

i

] == 201) ++

n

;

168

BOOST_REQUIRE(

n

!=0);

170  for

(;

i

< hsp->

subject

.

end

+ (kMaxDiv3 - 7); ++

i

) {

171  if

(sequence[

i

] == 201) ++

n

;

173

BOOST_REQUIRE(

n

==0);

175  for

(;

i

< hsp->

subject

.

end

+ (kMaxDiv3 + 1) &&

n

== 0; ++

i

) {

176  if

(sequence[

i

] == 201) ++

n

;

178

BOOST_REQUIRE(

n

!=0);

183

BOOST_REQUIRE_EQUAL(kLength[index] + kMaxDiv3, length);

184

BOOST_REQUIRE_EQUAL(kValues[2*index+1], (

int

) sequence[hsp->

subject

.

offset

+5]);

188  if

(sequence[

i

] == 201) ++

n

;

190

BOOST_REQUIRE(

n

!=0);

192  for

(;

i

< hsp->

subject

.

end

+ (kMaxDiv3 - 7); ++

i

) {

193  if

(sequence[

i

] == 201) ++

n

;

195

BOOST_REQUIRE(

n

==0);

197  for

(;

i

< hsp->

subject

.

end

+ (kMaxDiv3 + 1) &&

n

== 0; ++

i

) {

198  if

(sequence[

i

] == 201) ++

n

;

200

BOOST_REQUIRE(

n

!=0);

207  for

(

i

=0;

i

< length; ++

i

) {

208  if

(sequence[

i

] == 201) ++

n

;

210

BOOST_REQUIRE(

n

==0);

216

BOOST_REQUIRE(hsp ==

NULL

);

218

BOOST_REQUIRE(subject_blk ==

NULL

);

220

BOOST_REQUIRE(target_t ==

NULL

);

225  const int

kNumChunks = 3;

226  const int

kOffsetIncrement = 9900;

227  const int

kTotalNumHsps = 12;

228  const int

kFinalScores[kTotalNumHsps] =

229

{ 120, 111, 80, 77, 75, 72, 70, 70, 65, 60, 44, 40 };

230  const int

kFinalOffsets[kTotalNumHsps] =

231

{ 25000, 22000, 9950, 10400, 9850, 19750, 5000, 9970, 3000, 100,

233  const int

kFinalLengths[kTotalNumHsps] =

234

{ 200, 200, 100, 100, 100, 100, 100, 100, 100, 100, 60, 48 };

239  for

(chunk = 0; chunk < kNumChunks; ++chunk) {

245  offset

+= kOffsetIncrement;

248

BOOST_REQUIRE_EQUAL(kTotalNumHsps, combined_hsp_list->

hspcnt

);

252  for

(index = 0; index < kTotalNumHsps; ++index) {

254

BOOST_REQUIRE_EQUAL(kFinalScores[index], hsp->

score

);

255

BOOST_REQUIRE_EQUAL(kFinalOffsets[index], hsp->

subject

.

offset

);

256

BOOST_REQUIRE_EQUAL(kFinalLengths[index],

261

BOOST_REQUIRE(combined_hsp_list ==

NULL

);

269

BOOST_REQUIRE_EQUAL(0, hsp_list->

hspcnt

);

271

BOOST_REQUIRE(hsp_list ==

NULL

);

278  const int

kNumNullHsps=5;

279

hsp_list->

hspcnt

= kNumNullHsps;

282

BOOST_REQUIRE_EQUAL(0, hsp_list->

hspcnt

);

284

BOOST_REQUIRE(hsp_list ==

NULL

);

290  const int

kNumHsps=25;

291  for

(

int

index=0; index<kNumHsps; index++)

294  Blast_HSPInit

(index, index+20, index+30, index+40, index+10, index+35,

295

0, 0, 0, 10*index,

NULL

, &new_hsp);

300

BOOST_REQUIRE_EQUAL(kNumHsps, hsp_list->

hspcnt

);

302

BOOST_REQUIRE(hsp_list ==

NULL

);

308  const int

kNumHsps=5;

312  Blast_HSPInit

(100, 100, 100, 100, 100, 100, 0, 0, 0,

kScore

,

NULL

, &new_hsp);

314  for

(

int

index=0; index<kNumHsps; index++)

317  Blast_HSPInit

(index, index+20, index+30, index+40, index+10, index+35,

321  Blast_HSPInit

(0, 19, 29, 40, 10, 35, 0, 0, 0,

kScore

,

NULL

, &new_hsp);

329

BOOST_REQUIRE_EQUAL(kNumHsps, hsp_list->

hspcnt

);

331

BOOST_REQUIRE(hsp_list ==

NULL

);

337  const int

kNumHsps=25;

338  for

(

int

index=0; index<kNumHsps; index++)

341  Blast_HSPInit

(index, index+20, index+30, index+40, index+10, index+35,

342

0, 0, 0, 10*index,

NULL

, &new_hsp);

355

BOOST_REQUIRE_EQUAL(kNumHsps-4, hsp_list->

hspcnt

);

362  for

(

int

index=kNumHsps-4; index<kNumHsps; index++)

368

BOOST_REQUIRE(hsp_list ==

NULL

);

381

&edit_script, &new_hsp);

382

BOOST_REQUIRE_EQUAL((

Int2

)0, rv);

386

BOOST_REQUIRE_EQUAL(kPtrValue, new_hsp->

gap_info

);

394

BOOST_REQUIRE(new_hsp ==

NULL

);

403

BOOST_REQUIRE_EQUAL((

Int2

)-1, rv);

406

BOOST_REQUIRE(new_hsp ==

NULL

);

425

*query_info_ptr = query_info;

430  bool

gapped,

bool

is_prot)

445

*options_ptr = options;

453  if

(*hsp_ptr !=

NULL

) {

468  Uint1

* * subject_seq_ptr)

470  const int

kLength = 22;

471  const Uint1

kQuerySeq[kLength+2] = { 15, 0, 1, 2, 3, 0, 0, 1, 1, 2, 2, 3,

472

3, 3, 3, 0, 1, 2, 2, 1, 1, 0, 0, 15 };

473  const Uint1

kSubjectSeq[kLength] = { 0, 1, 2, 2, 14, 14, 1, 1, 2, 2, 3,

474

3, 3, 3, 0, 1, 8, 2, 1, 1, 14, 0 };

487  const int

kQueryStart = 6;

488  const int

kQueryEnd = 20;

489  const int

kSubjectStart = 6;

490  const int

kSubjectEnd = 20;

493

BOOST_REQUIRE_EQUAL(kQueryStart, hsp->

query

.

offset

);

494

BOOST_REQUIRE_EQUAL(kQueryEnd, hsp->

query

.

end

);

496

BOOST_REQUIRE_EQUAL(kSubjectEnd, hsp->

subject

.

end

);

501  const int

kWordCutoff = 3;

502  const int

kHitCutoff = 11;

504  const Uint4

kSubjLength = 100000;

505  const Uint4

kDbLength = 100000000;

520

query_blk, kDbLength, &query_info);

524

BOOST_REQUIRE_EQUAL(0,

526

scoring_options, program_number,

527

&sbp, 1.0, &blast_msg,

530

BOOST_REQUIRE(blast_msg ==

NULL

);

539

kDbLength, 0, &hit_params);

552

BOOST_REQUIRE(query_options ==

NULL

);

555

lookup_wrap, sbp, query_info, kSubjLength, &word_params);

558

BOOST_REQUIRE(blast_seq_loc ==

NULL

);

560

BOOST_REQUIRE(lookup_wrap ==

NULL

);

562

BOOST_REQUIRE(lookup_options ==

NULL

);

569

query_blk->

sequence

, subject_seq, word_params,

600

(*hsplist_ptr)->hsp_array[0] = hsp;

601

(*hsplist_ptr)->hspcnt = 1;

609  const int

kLength = 12;

610  const Uint1

kQuerySeq[kLength + 2] =

611

{ 0, 11, 19, 13, 1, 9, 22, 6, 10, 7, 12, 20, 10, 0 };

612  const Uint1

kSubjectSeq[3*kLength] =

613

{ 2, 8, 4, 4, 8, 4, 1, 1, 10, 8, 15, 2, 1, 8, 1, 8, 8, 15, 8, 8, 8,

614

1, 5, 1, 4, 4, 2, 1, 1, 1, 8, 4, 4, 4, 1, 4 };

624

(*subject_blk)->sequence = (*subject_blk)->sequence_start;

631  const int

kQueryStart = 0;

632  const int

kQueryEnd = 12;

633  const int

kSubjectStart = 0;

634  const int

kSubjectEnd = 12;

639

BOOST_REQUIRE_EQUAL(kQueryStart, hsp->

query

.

offset

);

640

BOOST_REQUIRE_EQUAL(kQueryEnd, hsp->

query

.

end

);

642

BOOST_REQUIRE_EQUAL(kSubjectEnd, hsp->

subject

.

end

);

649  const int

kWordCutoff = 37;

650  const int

kHitCutoff = 51;

651  const Uint4

kSubjLength = 50000;

652  const Uint4

kDbLength = 100000000;

667

query_blk, kDbLength, &query_info);

672

score_params->

options

= scoring_options;

675

BOOST_REQUIRE_EQUAL(0,

677

scoring_options, program_number,

678

&sbp, 1.0, &blast_msg,

688

kDbLength, 0, &hit_params);

701

BOOST_REQUIRE(query_options ==

NULL

);

704

lookup_wrap, sbp, query_info, kSubjLength, &word_params);

707

BOOST_REQUIRE(blast_seq_loc ==

NULL

);

709

BOOST_REQUIRE(lookup_wrap ==

NULL

);

711

BOOST_REQUIRE(lookup_options ==

NULL

);

721

hsp_list, query_blk, subject_blk,

722

word_params, hit_params, query_info, sbp,

723

score_params,

NULL

, gen_code_string);

735  sfree

(gen_code_string);

753  const int

kNumSegs = 5;

757  const Int4

kEditScriptNum[kNumSegs] = { 4, 1, 11, 1, 5 };

762  if

(*hsp_ptr !=

NULL

) {

779  for

(index = 0; index < kNumSegs; ++index) {

780

esp->

op_type

[index] = kEditScriptOpType[index];

781

esp->

num

[index] = kEditScriptNum[index];

787  Uint1

* * subject_seq_ptr,

790  const int

kQueryLength = 20;

791  const int

kSubjectLength = 25;

792  const Uint1

kQuerySeq[kQueryLength+2] = { 15, 0, 1, 2, 3, 0, 0, 1, 1,

793

2, 2, 3, 3, 3, 3, 2, 2, 1, 1,

795  const Uint1

kSubjectSeq[kSubjectLength] = { 1, 2, 0, 1, 2, 3, 3, 2,

796

14, 1, 1, 2, 2, 3, 3, 3, 3,

797

2, 0, 2, 1, 14, 0, 0, 3 };

803

*subj_length = kSubjectLength;

811  const int

kQueryStart = 6;

812  const int

kQueryEnd = 20;

813  const int

kSubjectStart = 9;

814  const int

kSubjectEnd = 24;

815  const int

kNumSegs = 3;

816  const Uint1

kEditScriptOpType[kNumSegs] =

818  const Uint1

kEditScriptNum[kNumSegs] = { 9, 1, 5 };

821

BOOST_REQUIRE_EQUAL(kQueryStart, hsp->

query

.

offset

);

822

BOOST_REQUIRE_EQUAL(kQueryEnd, hsp->

query

.

end

);

824

BOOST_REQUIRE_EQUAL(kSubjectEnd, hsp->

subject

.

end

);

829  for

(index = 0, esp = hsp->

gap_info

; index < esp->

size

; ++index) {

830

BOOST_REQUIRE_EQUAL((

int

)kEditScriptOpType[index], (

int

)esp->

op_type

[index]);

831

BOOST_REQUIRE_EQUAL((

int

)kEditScriptNum[index], (

int

)esp->

num

[index]);

833

BOOST_REQUIRE_EQUAL(kNumSegs, index);

849  Uint4

subj_length = 0;

854

query_blk, subj_length, &query_info);

863

BOOST_REQUIRE_EQUAL(0,

865

scoring_options, program_number,

866

&sbp, 1.0, &blast_message,

868

BOOST_REQUIRE_EQUAL(0,

875

BOOST_REQUIRE(query_blk);

876

BOOST_REQUIRE(sbp->

kbp_gap

[0]);

881

hit_params->

options

= hit_options;

888

subject_seq, subj_length, hit_params, scoring_params, sbp);

903

subject_seq, subj_length, hit_params, scoring_params, sbp);

911

BOOST_REQUIRE_EQUAL(0,

913

hsp, query_blk->

sequence

, subject_seq,

917

BOOST_REQUIRE_EQUAL(1,

919

hsp, query_blk->

sequence

, subject_seq,

938  const int

kLength = 22;

939  const int

kGappedStart = 1;

940  const int

kCutoff = 4;

941  Uint1 query

[kLength] = { 2, 0, 1, 3, 2, 0, 2, 1, 2, 0, 1, 3, 3, 1, 0, 1,

943  Uint1 subject

[kLength] = { 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,

944

14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14 };

966

hit_params->

options

= hit_opts;

974

hit_params, score_params,

976

BOOST_REQUIRE(delete_hsp ==

TRUE

);

979

BOOST_REQUIRE(hsp ==

NULL

);

981

BOOST_REQUIRE(sbp ==

NULL

);

983

BOOST_REQUIRE(score_params ==

NULL

);

985

BOOST_REQUIRE(ext_options ==

NULL

);

987

BOOST_REQUIRE(score_opts ==

NULL

);

989

BOOST_REQUIRE(hit_params ==

NULL

);

991

BOOST_REQUIRE(hit_opts ==

NULL

);

996  const char

*

query

=

"ADADADADADBADADADADADADADAADADAD"

;

998  "ABCDBCABCDBCEABCDBCABCDBCABCDBCABCDBCABCDBABCDBCABCDABCDBCABCDBCFFABCDBCABCDBCABCDBCABCDBCGBCDBC"

;

999  const int

kNumSegs = 13;

1005  const int

kEditScriptNum[kNumSegs] = { 4, 1, 6, 1, 4, 1, 4, 1, 4, 1, 4, 1, 6 };

1006  const int

kGoodNumIdent = 30;

1007  const int

kGoodAlignLength = 34;

1009  Int4

num_ident = 0, align_length = 0;

1019  for

(index = 0; index < kNumSegs; ++index) {

1020

esp->

op_type

[index] = kEditScriptOp[index];

1021

esp->

num

[index] = kEditScriptNum[index];

1029

scoring_opts, &align_length);

1033

BOOST_REQUIRE_EQUAL(kGoodNumIdent, num_ident);

1034

BOOST_REQUIRE_EQUAL(kGoodAlignLength, align_length);

1043  const int

kHspCount = 16;

1044  const int

kScores[kHspCount] = {

1045

10, 20, 15, 100, 21, 40, 55, 30, 90, 40,

1046

150, 40, 100, 200, 250,

1049  const double

kEvalues[kHspCount] = {

1050

1, 0.1, 0.5, 0, 0.11, 0.01, 0.001, 0.05, 0, 0.01,

1051

1.0e-181, 1.0e-140, 1.0e-250, 2.0e-180, 5.0e-181,

1055  const int

kScoresSorted[kHspCount] = {

1057

100, 90, 55, 45, 40, 40, 40, 30, 21, 20, 15, 10

1059  const double

kEvaluesSorted[kHspCount] = {

1060

5.0e-181, 1.0e-181, 1.0e-250,

1064

0.001, 0.01, 0.01, 0.05, 0.1, 0.11, 0.5, 1

1070

hsp_list->

hspcnt

= kHspCount;

1072  for

(index = 0; index < kHspCount; ++index) {

1078

kHspCount - index + kScores[index];

1084  for

(index = 0; index < kHspCount; ++index) {

1085

BOOST_REQUIRE_EQUAL(kScoresSorted[index],

1089  for

(index = 0; index < kHspCount; ++index) {

1090

BOOST_REQUIRE_EQUAL(kEvaluesSorted[index],

1109

hsp->

score

= score = (31 * score) % 100;

1115  const int

kHspNumMax = 250;

1123

BOOST_REQUIRE_EQUAL(100, hsp_list->

allocated

);

1125  for

(index = 0; index < kHspNumMax; ++index) {

1128

BOOST_REQUIRE_EQUAL(hsp_list->

hspcnt

, kHspNumMax);

1129

BOOST_REQUIRE_EQUAL(hsp_list->

allocated

, kHspNumMax);

1133

BOOST_REQUIRE_EQUAL(hsp_list->

hspcnt

, kHspNumMax);

1134

BOOST_REQUIRE_EQUAL(hsp_list->

allocated

, kHspNumMax);

1139  for

(index1 = 1; index1 < kHspNumMax; ++index1) {

1144  for

(++index; index <

kTotal

; ++index) {

1148  for

(index = 1, index1 = 0; index < kHspNumMax; ++index) {

1156

BOOST_REQUIRE_EQUAL(89, hsp_list->

hsp_array

[kHspNumMax-1]->

score

);

1158

BOOST_REQUIRE_EQUAL(100, index1);

1164  const int

kHspCountStart = 9;

1165  const int

kHspCountEnd = 3;

1166  const int

kScores[kHspCountStart] =

1167

{ 1044, 995, 965, 219, 160, 125, 110, 107, 103 };

1168  const int

kQueryOffsets[kHspCountStart] =

1169

{ 2, 2, 2, 236, 88, 259, 278, 259, 278 };

1170  const int

kQueryEnds[kHspCountStart] =

1171

{ 322, 336, 300, 322, 182, 322, 341, 341, 341 };

1172  const int

kSubjectOffsets[kHspCountStart] =

1173

{ 7, 7, 7, 194, 2, 194, 197, 194, 197 };

1174  const int

kSubjectEnds[kHspCountStart] =

1175

{ 292, 293, 301, 292, 96, 292, 260, 260, 266 };

1176  const int

kSurvivingIndices[kHspCountEnd] = { 4, 0, 6 };

1181  for

(

int

index = 0; index < kHspCountStart; ++index) {

1184

kSubjectOffsets[index], kSubjectEnds[index],

1187

kScores[index],

NULL

, &hsp);

1194

BOOST_REQUIRE_EQUAL(kHspCountStart,

1200

BOOST_REQUIRE_EQUAL(kHspCountEnd,

1205  for

(

int

index = 0; index < kHspCountEnd; ++index) {

1206  int

index_orig = kSurvivingIndices[index];

1207

BOOST_REQUIRE_EQUAL(kScores[index_orig], hsp_array[index]->score);

1208

BOOST_REQUIRE_EQUAL(kQueryOffsets[index_orig],

1209

hsp_array[index]->

query

.offset);

1210

BOOST_REQUIRE_EQUAL(kSubjectOffsets[index_orig],

1211

hsp_array[index]->

subject

.offset);

1212

BOOST_REQUIRE_EQUAL(kQueryEnds[index_orig],

1213

hsp_array[index]->

query

.end);

1214

BOOST_REQUIRE_EQUAL(kSubjectEnds[index_orig],

1215

hsp_array[index]->

subject

.end);

1216  sfree

(hsp_array[index]);

1220

BOOST_REQUIRE(hsp_list ==

NULL

);

1243

BOOST_REQUIRE(scoring_options ==

NULL

);

1245

BOOST_REQUIRE(ext_options ==

NULL

);

1251

BOOST_REQUIRE(ext_options ==

NULL

);

1253

BOOST_REQUIRE(blasthit_params ==

NULL

);

1255

BOOST_REQUIRE(hit_options ==

NULL

);

1279

BOOST_REQUIRE(scoring_options ==

NULL

);

1281

BOOST_REQUIRE(ext_options ==

NULL

);

1287

BOOST_REQUIRE(ext_options ==

NULL

);

1289

BOOST_REQUIRE(blasthit_params ==

NULL

);

1291

BOOST_REQUIRE(hit_options ==

NULL

);

1317

BOOST_REQUIRE(scoring_options ==

NULL

);

1319

BOOST_REQUIRE(ext_options ==

NULL

);

1325

BOOST_REQUIRE(ext_options ==

NULL

);

1327

BOOST_REQUIRE(blasthit_params ==

NULL

);

1329

BOOST_REQUIRE(hit_options ==

NULL

);

1333  const int

kHspCnt = 10;

1334  const bool

kGapped =

TRUE

;

1348  for

(

int

index = 0; index < kHspCnt; ++index) {

1354

hsp->

score

= 100 - index;

1357

hsp_list->

hspcnt

= kHspCnt;

1361  for

(

int

index = 0; index < kHspCnt; ++index)

1375

BOOST_REQUIRE_EQUAL(0, (

int

) status);

1378

BOOST_REQUIRE_EQUAL(kBig, (

int

) hit_list->

hsplist_max

);

1379

BOOST_REQUIRE_EQUAL(60, (

int

) hit_list->

low_score

);

1382

BOOST_REQUIRE(hit_list ==

NULL

);

1389  for

(

unsigned int i

= 0;

i

< 4;

i

++ ){

1390  unsigned int

factor =

i

+1;

1398

hsp->

score

= 45/factor;

1399

(*hsplist_ptr)->hsp_array[

i

] = hsp;

1400

(*hsplist_ptr)->hspcnt ++;

1412  const Uint4

kDbLength = 100000000;

1418

query_blk, kDbLength, &query_info);

1428

BOOST_REQUIRE_EQUAL(4, (

int

) hsp_list->

hspcnt

);

1431

BOOST_REQUIRE_EQUAL(3, (

int

) hsp_list->

hspcnt

);

1434

BOOST_REQUIRE_EQUAL(2, (

int

) hsp_list->

hspcnt

);

1458  const Uint4

kDbLength = 100000000;

1464

query_blk, kDbLength, &query_info);

1474

BOOST_REQUIRE_EQUAL(4, (

int

) hsp_list->

hspcnt

);

1477

BOOST_REQUIRE_EQUAL(2, (

int

) hsp_list->

hspcnt

);

1480

BOOST_REQUIRE_EQUAL(2, (

int

) hsp_list->

hspcnt

);

1483

BOOST_REQUIRE_EQUAL(1, (

int

) hsp_list->

hspcnt

);

1498  for

(

unsigned int i

= 0;

i

< 4;

i

++ ){

1499  unsigned int

factor =

i

+1;

1508

hsp->

score

= 45/factor;

1509

(*hsplist_ptr)->hsp_array[

i

] = hsp;

1510

(*hsplist_ptr)->hspcnt ++;

1520  const Uint4

kDbLength = 100000000;

1529

BOOST_REQUIRE_EQUAL(1, (

int

) hsp_list->

hspcnt

);

1534

BOOST_REQUIRE_EQUAL(1, (

int

) hsp_list->

hspcnt

);

Definitions used throughout BLAST.

#define sfree(x)

Safe free a pointer: belongs to a higher level header.

Declarations of static arrays used to define some NCBI encodings to be used in a toolkit independent ...

BlastSeqLoc * BlastSeqLocFree(BlastSeqLoc *loc)

Deallocate all BlastSeqLoc objects in a chain.

BlastSeqLoc * BlastSeqLocNew(BlastSeqLoc **head, Int4 from, Int4 to)

Create and initialize a new sequence interval.

Structures and API used for saving BLAST hits.

void Blast_HSPListSortByEvalue(BlastHSPList *hsp_list)

Sort the HSPs in an HSP list by e-value, with scores and other criteria used to resolve ties.

BlastHSP * Blast_HSPNew(void)

Allocate and zeros out memory for an HSP structure.

Int2 Blast_HSPInit(Int4 query_start, Int4 query_end, Int4 subject_start, Int4 subject_end, Int4 query_gapped_start, Int4 subject_gapped_start, Int4 query_context, Int2 query_frame, Int2 subject_frame, Int4 score, GapEditScript **gap_edit, BlastHSP **ret_hsp)

Allocates BlastHSP and inits with information from input.

BlastHitList * Blast_HitListFree(BlastHitList *hitlist)

Deallocate memory for the hit list.

Boolean Blast_HSPTestIdentityAndLength(EBlastProgramType program_number, BlastHSP *hsp, const Uint1 *query, const Uint1 *subject, const BlastScoringOptions *score_options, const BlastHitSavingOptions *hit_options)

Calculates number of identities and alignment lengths of an HSP via Blast_HSPGetNumIdentities and det...

Int4 Blast_HSPListSubjectBestHit(EBlastProgramType program, const BlastHSPSubjectBestHitOptions *subject_besthit_opts, const BlastQueryInfo *query_info, BlastHSPList *hsp_list)

BlastHitList * Blast_HitListNew(Int4 hitlist_size)

Allocate memory for a hit list of a given size.

Int4 Blast_HSPListPurgeHSPsWithCommonEndpoints(EBlastProgramType program, BlastHSPList *hsp_list, Boolean purge)

Check for an overlap of two different alignments and remove redundant HSPs.

BlastHSPList * Blast_HSPListNew(Int4 hsp_max)

Creates HSP list structure with a default size HSP array.

Int2 Blast_HSPGetNumIdentities(const Uint1 *query, const Uint1 *subject, BlastHSP *hsp, const BlastScoringOptions *score_options, Int4 *align_length_ptr)

Calculate number of identities in an HSP and set the BlastHSP::num_ident field (unconditionally)

Int2 Blast_HSPListPurgeNullHSPs(BlastHSPList *hsp_list)

Cleans out the NULLed out HSP's from the HSP array that is part of the BlastHSPList.

#define DBSEQ_CHUNK_OVERLAP

By how much should the chunks of a subject sequence overlap if it is too long and has to be split.

Int2 Blast_HSPListsMerge(BlastHSPList **hsp_list, BlastHSPList **combined_hsp_list_ptr, Int4 hsp_num_max, Int4 *split_points, Int4 contexts_per_query, Int4 chunk_overlap_size, Boolean allow_gap, Boolean short_reads)

Merge an HSP list from a chunk of the subject sequence into a previously computed HSP list.

Int2 Blast_HSPListReevaluateUngapped(EBlastProgramType program, BlastHSPList *hsp_list, BLAST_SequenceBlk *query_blk, BLAST_SequenceBlk *subject_blk, const BlastInitialWordParameters *word_params, const BlastHitSavingParameters *hit_params, const BlastQueryInfo *query_info, BlastScoreBlk *sbp, const BlastScoringParameters *score_params, const BlastSeqSrc *seq_src, const Uint1 *gen_code_string)

Reevaluate all ungapped HSPs in an HSP list.

Boolean Blast_HSPQueryCoverageTest(BlastHSP *hsp, double min_query_coverage_pct, Int4 query_length)

Calculate query coverage percentage of an hsp.

Int2 Blast_TrimHSPListByMaxHsps(BlastHSPList *hsp_list, const BlastHitSavingOptions *hit_options)

SBlastHitsParameters * SBlastHitsParametersFree(SBlastHitsParameters *param)

Deallocated SBlastHitsParameters.

void Blast_HSPListAdjustOddBlastnScores(BlastHSPList *hsp_list, Boolean gapped_calculation, const BlastScoreBlk *sbp)

For nucleotide BLAST, if the match reward score is equal to 2, random alignments are dominated by run...

Int2 Blast_HSPListReapByQueryCoverage(BlastHSPList *hsp_list, const BlastHitSavingOptions *hit_options, const BlastQueryInfo *query_info, EBlastProgramType program_number)

Discard the HSPs below the min query coverage pct from the HSP list.

BlastHSP * Blast_HSPFree(BlastHSP *hsp)

Deallocate memory for an HSP structure.

Boolean Blast_HSPListIsSortedByScore(const BlastHSPList *hsp_list)

Check if HSP list is sorted by score.

const Uint1 * Blast_HSPGetTargetTranslation(SBlastTargetTranslation *target_t, const BlastHSP *hsp, Int4 *translated_length)

Returns a buffer with a protein translated from nucleotide.

Int2 Blast_HSPListSaveHSP(BlastHSPList *hsp_list, BlastHSP *hsp)

Saves HSP information into a BlastHSPList structure.

BlastHSPList * Blast_HSPListFree(BlastHSPList *hsp_list)

Deallocate memory for an HSP list structure as well as all it's components.

double Blast_HSPGetQueryCoverage(const BlastHSP *hsp, Int4 query_length)

Calculate query coverage percentage of an hsp.

Boolean Blast_HSPReevaluateWithAmbiguitiesUngapped(BlastHSP *hsp, const Uint1 *query_start, const Uint1 *subject_start, const BlastInitialWordParameters *word_params, BlastScoreBlk *sbp, Boolean translated)

Reevaluate the HSP's score and percent identity after taking into account the ambiguity information.

Int2 SBlastHitsParametersNew(const BlastHitSavingOptions *hit_options, const BlastExtensionOptions *ext_options, const BlastScoringOptions *scoring_options, SBlastHitsParameters **retval)

Sets up small structures used by blast_hit.c for saving HSPs.

void Blast_HSPListSortByScore(BlastHSPList *hsp_list)

Sort the HSPs in an HSP list by score.

Boolean Blast_HSPReevaluateWithAmbiguitiesGapped(BlastHSP *hsp, const Uint1 *query_start, const Int4 query_length, const Uint1 *subject_start, const Int4 subject_length, const BlastHitSavingParameters *hit_params, const BlastScoringParameters *score_params, const BlastScoreBlk *sbp)

Reevaluate the HSP's score and percent identity after taking into account the ambiguity information.

Int2 Blast_HitListUpdate(BlastHitList *hit_list, BlastHSPList *hsp_list)

Insert a new HSP list into the hit list.

Utilities for dealing with BLAST HSPs in the core of BLAST.

Blast_Message * Blast_MessageFree(Blast_Message *blast_msg)

Deallocates message memory.

Definitions which are dependant on the NCBI C++ Object Manager.

BlastHitSavingOptions * BlastHitSavingOptionsFree(BlastHitSavingOptions *options)

Deallocate memory for BlastHitSavingOptions.

Int2 BlastQuerySetUpOptionsNew(QuerySetUpOptions **options)

Allocate memory for QuerySetUpOptions and fill with default values.

BlastHSPSubjectBestHitOptions * BlastHSPSubjectBestHitOptionsFree(BlastHSPSubjectBestHitOptions *subject_besthit_opts)

Deallocates subject besthit structure.

BlastInitialWordOptions * BlastInitialWordOptionsFree(BlastInitialWordOptions *options)

Deallocate memory for BlastInitialWordOptions.

Int2 BlastScoringOptionsNew(EBlastProgramType program, BlastScoringOptions **options)

Allocate memory for BlastScoringOptions and fill with default values.

Int2 LookupTableOptionsNew(EBlastProgramType program, LookupTableOptions **options)

Allocate memory for lookup table options 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.

BlastHSPSubjectBestHitOptions * BlastHSPSubjectBestHitOptionsNew(Boolean isProtein)

Allocate a new object for subject besthit options.

Int2 BlastInitialWordOptionsNew(EBlastProgramType program, BlastInitialWordOptions **options)

Allocate memory for BlastInitialWordOptions and fill with default values.

BlastScoringOptions * BlastScoringOptionsFree(BlastScoringOptions *options)

Deallocate memory for BlastScoringOptions.

LookupTableOptions * LookupTableOptionsFree(LookupTableOptions *options)

Deallocates memory for LookupTableOptions*.

QuerySetUpOptions * BlastQuerySetUpOptionsFree(QuerySetUpOptions *options)

Deallocate memory for QuerySetUpOptions.

Int2 BlastExtensionOptionsNew(EBlastProgramType program, BlastExtensionOptions **options, Boolean gapped)

Allocate memory for BlastExtensionOptions and fill with default values.

BlastHitSavingParameters * BlastHitSavingParametersFree(BlastHitSavingParameters *parameters)

Deallocate memory for BlastHitSavingOptions*.

BlastInitialWordParameters * BlastInitialWordParametersFree(BlastInitialWordParameters *parameters)

Deallocate memory for BlastInitialWordParameters.

Int2 BlastScoringParametersNew(const BlastScoringOptions *options, BlastScoreBlk *sbp, BlastScoringParameters **parameters)

Calculate scaled cutoff scores and gap penalties.

Int2 BlastInitialWordParametersNew(EBlastProgramType program_number, const BlastInitialWordOptions *word_options, const BlastHitSavingParameters *hit_params, const LookupTableWrap *lookup_wrap, const BlastScoreBlk *sbp, BlastQueryInfo *query_info, Uint4 subject_length, BlastInitialWordParameters **parameters)

Allocate memory for BlastInitialWordParameters and set x_dropoff.

Int2 BlastHitSavingParametersNew(EBlastProgramType program_number, const BlastHitSavingOptions *options, const BlastScoreBlk *sbp, const BlastQueryInfo *query_info, Int4 avg_subject_length, Int4 compositionBasedStats, BlastHitSavingParameters **parameters)

Allocate memory and initialize the BlastHitSavingParameters structure.

BlastScoringParameters * BlastScoringParametersFree(BlastScoringParameters *parameters)

Deallocate memory for BlastScoringParameters.

EBlastProgramType

Defines the engine's notion of the different applications of the BLAST algorithm.

BlastQueryInfo * BlastQueryInfoFree(BlastQueryInfo *query_info)

Deallocate memory for query information structure.

BlastQueryInfo * BlastQueryInfoNew(EBlastProgramType program, int num_queries)

Allocate memory for query information structure.

Utilities initialize/setup BLAST.

Int2 BlastSetup_ScoreBlkInit(BLAST_SequenceBlk *query_blk, const BlastQueryInfo *query_info, const BlastScoringOptions *scoring_options, EBlastProgramType program_number, BlastScoreBlk **sbpp, double scale_factor, Blast_Message **blast_message, GET_MATRIX_PATH get_path)

Initializes the score block structure.

Int2 Blast_ScoreBlkMatrixInit(EBlastProgramType program_number, const BlastScoringOptions *scoring_options, BlastScoreBlk *sbp, GET_MATRIX_PATH get_path)

Initializes the substitution matrix in the BlastScoreBlk according to the scoring options specified.

Internal auxiliary setup classes/functions for C++ BLAST APIs.

BlastScoreBlk * BlastScoreBlkFree(BlastScoreBlk *sbp)

Deallocates BlastScoreBlk as well as all associated structures.

Int2 BLAST_Cutoffs(Int4 *S, double *E, Blast_KarlinBlk *kbp, Int8 searchsp, Boolean dodecay, double gap_decay_rate)

Calculate the cutoff score from the expected number of HSPs or vice versa.

BlastScoreBlk * BlastScoreBlkNew(Uint1 alphabet, Int4 number_of_contexts)

Allocates and initializes BlastScoreBlk.

Various auxiliary BLAST utility functions.

BLAST_SequenceBlk * BlastSequenceBlkFree(BLAST_SequenceBlk *seq_blk)

Deallocate memory for a sequence block.

Int2 BlastSeqBlkSetSequence(BLAST_SequenceBlk *seq_blk, const Uint1 *sequence, Int4 seqlen)

Stores the sequence in the sequence block structure.

Int2 BlastTargetTranslationNew(BLAST_SequenceBlk *subject_blk, const Uint1 *gen_code_string, EBlastProgramType program_number, Boolean is_ooframe, SBlastTargetTranslation **target)

Sets up structure for target translation.

SBlastTargetTranslation * BlastTargetTranslationFree(SBlastTargetTranslation *target_t)

Free SBlastTargetTranslation.

Int2 BlastSeqBlkNew(BLAST_SequenceBlk **retval)

Allocates a new sequence block structure.

static void checkReevaluateResultsGapped(BlastHSP *hsp)

static void s_SetupHSPForGappedReevaluateTest(BlastHSP **hsp_ptr)

int h_score_compare_hsps(const void *v1, const void *v2)

static void s_SetupSequencesForUngappedReevaluateTransl(BLAST_SequenceBlk **query_blk, BLAST_SequenceBlk **subject_blk)

static void s_SetupHSPListBlastn(BlastHSPList **hsplist_ptr)

static void s_AddNextHSP(BlastHSPList *hsp_list, int &score)

static void s_SetupHSPForUngappedReevaluateNucl(BlastHSP **hsp_ptr)

BOOST_AUTO_TEST_CASE(BlastTargetSequence)

static void s_SetupSequencesForGappedReevaluateTest(BLAST_SequenceBlk **query_blk, Uint1 **subject_seq_ptr, Uint4 *subj_length)

static void s_SetupHSPListTransl(BlastHSPList **hsplist_ptr)

static void checkReevaluateResultsUngappedNucl(BlastHSP *hsp)

static void s_SetupQueryInfoForReevaluateTest(EBlastProgramType program_number, BLAST_SequenceBlk *query_blk, Uint4 subj_length, BlastQueryInfo **query_info_ptr)

static void s_SetupSequencesForUngappedReevaluateNucl(BLAST_SequenceBlk **query_blk, Uint1 **subject_seq_ptr)

static void checkReevaluateResultsUngappedTransl(BlastHSPList *hsp_list)

static void s_SetupScoringOptionsForReevaluateHSP(BlastScoringOptions **options_ptr, bool gapped, bool is_prot)

void setupHSPList(BlastHSPList **hsp_list_ptr, int chunk)

static void s_SetupHSPListForUngappedReevaluateTransl(BlastHSPList **hsplist_ptr)

BOOST_AUTO_TEST_SUITE_END() static int s_GetSegmentFlags(const CBioseq &bioseq)

Initializes and uninitializes the genetic code singleton as if it was an automatic variable (to facil...

static CTestObjMgr & Instance()

EGapAlignOpType

Operation types within the edit script.

@ eGapAlignDel2

Frame shift deletion of two nucleotides.

@ eGapAlignIns2

Frame shift insertion of two nucleotides.

@ eGapAlignIns1

Frame shift insertion of one nucleotide.

@ eGapAlignIns

Insertion: a gap in subject.

@ eGapAlignDel1

Frame shift deletion of one nucleotide.

@ eGapAlignSub

Substitution.

@ eGapAlignDel

Deletion: a gap in query.

GapEditScript * GapEditScriptNew(Int4 size)

Initialize the edit script structure.

GapEditScript * GapEditScriptDelete(GapEditScript *esp)

Free edit script structure.

Defines the interface to interact with the genetic code singleton object.

Uint1 * GenCodeSingletonFind(Uint4 gen_code_id)

Returns the genetic code string for the requested genetic code id.

TAutoUint1ArrayPtr FindGeneticCode(int genetic_code)

Retrieves the requested genetic code in Ncbistdaa format.

#define BLASTNA_SEQ_CODE

Identifies the blastna alphabet, for use in blast only.

TAutoUint1Ptr data

Sequence data.

char * BlastFindMatrixPath(const char *matrix_name, Boolean is_prot)

Returns the path to a specified matrix.

SBlastSequence GetSequence(const objects::CSeq_loc &sl, EBlastEncoding encoding, objects::CScope *scope, objects::ENa_strand strand=objects::eNa_strand_plus, ESentinelType sentinel=eSentinels, std::string *warnings=NULL)

Retrieves a sequence using the object manager.

@ eBlastEncodingNcbi4na

NCBI4na.

@ eSentinels

Use sentinel bytes.

element_type * get(void) const

Get pointer.

element_type * release(void)

Release will release ownership of pointer to caller.

TSeqPos GetLength(const CSeq_id &id, CScope *scope)

Get sequence length if scope not null, else return max possible TSeqPos.

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

for(len=0;yy_str[len];++len)

LookupTableWrap * LookupTableWrapFree(LookupTableWrap *lookup)

Deallocate memory for the lookup table.

Int2 LookupTableWrapInit(BLAST_SequenceBlk *query, const LookupTableOptions *lookup_options, const QuerySetUpOptions *query_options, BlastSeqLoc *lookup_segments, BlastScoreBlk *sbp, LookupTableWrap **lookup_wrap_ptr, const BlastRPSInfo *rps_info, Blast_Message **error_msg, BlastSeqSrc *seqsrc)

Create the lookup table for all query words.

const struct ncbi::grid::netcache::search::fields::SIZE size

Magic spell ;-) needed for some weird compilers... very empiric.

#define INT4_MAX

largest nubmer represented by signed int

void * BlastMemDup(const void *orig, size_t size)

Copies memory using memcpy and malloc.

Uint1 Boolean

bool replacment for C

#define TRUE

bool replacment for C indicating true.

#define FALSE

bool replacment for C indicating false.

#define INT4_MIN

Smallest (most negative) number represented by signed int.

BOOST_AUTO_TEST_SUITE(psiblast_iteration)

static const char * kScore

static const char * kTotal

static const char * kMaxScore

static const char * kEvalue

Structure to hold a sequence.

Int4 length

Length of sequence.

Uint1 * sequence

Sequence used for search (could be translation).

Int4 query_length

Length of this query, strand or frame.

Boolean is_valid

Determine if this context is valid or not.

Int8 eff_searchsp

Effective search space for this context.

Options used for gapped extension These include: a.

Int4 compositionBasedStats

mode of compositional adjustment to use; if zero then compositional adjustment is not used

All the gapped cutoff values that can change from context to context.

Int4 cutoff_score

Raw cutoff score corresponding to the e-value provided by the user if no sum stats,...

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 hspcnt

Number of HSPs saved.

BlastHSP ** hsp_array

Array of pointers to individual HSPs.

Int4 allocated

The allocated size of the hsp_array.

Structure holding all information about an HSP.

double evalue

This HSP's e-value.

Int4 num_ident

Number of identical base pairs in this HSP.

BlastSeg query

Query sequence info.

Int4 context

Context number of query.

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.

Int4 hsplist_max

Maximal allowed size of the HSP lists array.

BlastHSPList ** hsplist_array

Array of HSP lists for individual database hits.

Int4 hsplist_count

Filled size of the HSP lists array.

Int4 low_score

The lowest of the best scores among the HSP lists.

Int4 hsplist_current

Number of allocated HSP list arrays.

Options used when evaluating and saving hits These include: a.

Int4 max_hsps_per_subject

Queries are paired reads, for mapping.

double expect_value

The expect value cut-off threshold for an HSP, or a combined hit if sum statistics is used.

Int4 hitlist_size

Maximal number of database sequences to return results for.

Int4 min_hit_length

optional minimum alignment length; alignments not at least this long are discarded

double query_cov_hsp_perc

Min query coverage hsp percentage.

double percent_identity

The percent identity cut-off threshold.

Parameter block that contains a pointer to BlastHitSavingOptions and the values derived from it.

BlastGappedCutoffs * cutoffs

per-context gapped cutoff information

Int4 cutoff_score_min

smallest cutoff score across all contexts

BlastHitSavingOptions * options

The original (unparsed) options.

Options needed for initial word finding and processing.

Parameter block that contains a pointer to BlastInitialWordOptions and the values derived from it.

Int4 cutoff_score_min

smallest cutoff score across all contexts

The query related information.

BlastContextInfo * contexts

Information per context.

Int4 last_context

Index of the last element of the context array.

Structure used for scoring calculations.

Blast_KarlinBlk ** kbp_gap

K-A parameters for gapped alignments.

Boolean round_down

Score must be rounded down to nearest even score if odd.

Scoring options block Used to produce the BlastScoreBlk structure This structure may be needed for lo...

Int2 penalty

Penalty for a mismatch.

Int4 gap_open

Extra penalty for starting a gap.

Int4 gap_extend

Penalty for each gap residue.

Int2 reward

Reward for a match.

Boolean gapped_calculation

gap-free search if FALSE

char * matrix

Name of the matrix containing all scores: needed for finding neighboring words.

Boolean is_ooframe

Should out-of-frame gapping be used in a translated search?

Scoring parameters block Contains scoring-related information that is actually used for the blast sea...

BlastScoringOptions * options

User-provided values for these params.

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 to hold the a message from the core of the BLAST engine.

Edit script: linked list of correspondencies between two sequences.

Int4 * num

Array of number of operations.

EGapAlignOpType * op_type

Array of type of operation.

Options needed to construct a lookup table Also needed: query sequence and query length.

Wrapper structure for different types of BLAST lookup tables.

Options required for setting up the query sequence.

Keeps prelim_hitlist_size and HitSavingOptions together, mostly for use by hspstream.

Int4 prelim_hitlist_size

number of hits saved during preliminary part of search.

Structure to store sequence data and its length for use in the CORE of BLAST (it's a malloc'ed array ...

Information about target translations.

Utility stuff for more convenient using of Boost.Test library.

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