;
68 for(
int i= query_info->
first_context; i <= query_info->last_context;
i++)
94 size_t* tot_length =
NULL,
95vector<ENa_strand>* strands =
NULL,
102retval.reserve(gi_length.size());
105BOOST_REQUIRE(strands->size() == gi_length.size());
108BOOST_REQUIRE(masks->size() == gi_length.size());
111 for(
size_t i= 0;
i< gi_length.size();
i++) {
115loc->
SetInt().SetFrom(0);
116loc->
SetInt().SetTo(gi_length[
i].second-1);
123retval.push_back(
SSeqLoc(loc, &*scope));
125*tot_length += gi_length[
i].second;
129 if(masks ==
NULL) {
133 for(
size_t i= 0;
i< masks->size();
i++) {
138 if(single_query_masks.size() == 1) {
140single_query_masks.front()->GetInterval();
149retval[
i].mask = m;
158 static const intkDefaultIntValue = -1;
162 if(m_Config.
Empty()) {
169 const stringfname(
"data/split_query.ini");
170ifstream config_file(fname.c_str());
173 if(m_Config->
Empty()) {
174 throwruntime_error(
"Failed to read configuration file"+
181BOOST_REQUIRE(m_Config.
NotEmpty());
198BOOST_REQUIRE(seq_blk);
199BOOST_REQUIRE(qinfo);
202 for(
int i= 0; gis[
i] != -1;
i++) {
207queries.push_back(
SSeqLoc(loc, scope));
221 prog, strand_opt, msgs);
229vector< vector<int> >& starting_chunks,
230vector< vector<int> >& absolute_contexts,
231vector< vector<size_t> >* context_offsets,
233vector<ENa_strand>* query_strands =
NULL) {
236BOOST_REQUIRE_EQUAL(gi_length.size(), query_strands->size());
246BOOST_REQUIRE_EQUAL(num_chunks, nc);
251 if( !query_strands ) {
267 for(
size_tchunk_num = 0; chunk_num < num_chunks; chunk_num++) {
269vector<int>& st_chunks = starting_chunks[chunk_num];
270 for(
size_tcontext_in_chunk = 0;
271context_in_chunk < st_chunks.size();
272context_in_chunk++) {
274os <<
"Starting chunks: ";
275os <<
"Chunk "<< chunk_num <<
", context "<< context_in_chunk;
278BOOST_REQUIRE_MESSAGE(st_chunks[context_in_chunk]==sc,os.str());
282vector<int>& abs_ctxts = absolute_contexts[chunk_num];
283 for(
size_tcontext_in_chunk = 0;
284context_in_chunk < abs_ctxts.size();
285context_in_chunk++) {
287os <<
"Absolute contexts: ";
288os <<
"Chunk "<< chunk_num <<
", context "<< context_in_chunk;
292BOOST_REQUIRE_MESSAGE(abs_ctxts[context_in_chunk]==abs_ctx,os.str());
297 if( !context_offsets ) {
304 for(
size_tchunk_num = 0; chunk_num < num_chunks; chunk_num++) {
305vector<size_t> test_ctx_off =
307 constvector<size_t>& ref_ctx_off = (*context_offsets)[chunk_num];
310os <<
"Number of context offsets in chunk "<< chunk_num;
311BOOST_REQUIRE_MESSAGE(ref_ctx_off.size()==test_ctx_off.size(),os.str());
319 for(
size_t i= 0;
i< ref_ctx_off.size();
i++) {
320 size_tcorrection = ref_ctx_off[
i];
322os <<
"Context correction in chunk "<< chunk_num
323<<
", context "<<
i<<
" value now "<< test_ctx_off[
i]
324<<
" not "<< correction;
325BOOST_REQUIRE_MESSAGE(correction==test_ctx_off[
i],os.str());
327 intabsolute_context =
337 intnum_bases2compare =
341os <<
"Sequence data in chunk "<< chunk_num
342<<
", context "<<
i;
344x_CmpSequenceData(&global_seq->
sequence[global_offset],
345&chunk_seq->
sequence[chunk_offset],
347BOOST_REQUIRE_MESSAGE(rv,os.str());
362 for(
size_t i= 0;
i<
len;
i++) {
363 if(global[
i] != chunk[
i]) {
387x_ReadQueryBoundsPerChunk(
kTestName, sqb, split_query_vector);
388x_ValidateQuerySeqLocsPerChunk(splitter, split_query_vector);
400vector< vector<size_t> > queries_per_chunk;
401x_ReadVectorOfVectorsForTest(
kTestName,
"Queries", queries_per_chunk);
402x_ValidateQueriesPerChunkAssignment(*sqb, queries_per_chunk);
404vector< vector<int> > ctxs_per_chunk;
405x_ReadVectorOfVectorsForTest(
kTestName,
"Contexts", ctxs_per_chunk);
406x_ValidateQueryContextsPerChunkAssignment(*sqb, ctxs_per_chunk);
408vector< vector<size_t> > ctx_offsets_per_chunk;
409x_ReadVectorOfVectorsForTest(
kTestName,
"ContextOffsets",
410ctx_offsets_per_chunk);
411x_ValidateContextOffsetsPerChunkAssignment(*sqb, ctx_offsets_per_chunk);
413vector<BlastQueryInfo*> split_query_info;
416x_ValidateLocalQueryData(splitter, &*opts, split_query_info);
425query_strands =
NULL)
428gi_length.push_back(make_pair<int, size_t>(112258880, 362959));
429gi_length.push_back(make_pair<int, size_t>(112253843, 221853));
430gi_length.push_back(make_pair<int, size_t>(112193060, 194837));
431gi_length.push_back(make_pair<int, size_t>(112193059, 204796));
433BOOST_REQUIRE_EQUAL(gi_length.size(), query_strands->size());
443 if( !query_strands ) {
452x_ReadQueryBoundsPerChunk(
kTestName, sqb, split_query_vector);
453x_ValidateQuerySeqLocsPerChunk(splitter, split_query_vector);
465vector< vector<size_t> > queries_per_chunk;
466x_ReadVectorOfVectorsForTest(
kTestName,
"Queries", queries_per_chunk);
467x_ValidateQueriesPerChunkAssignment(*sqb, queries_per_chunk);
469vector< vector<int> > ctxs_per_chunk;
470x_ReadVectorOfVectorsForTest(
kTestName,
"Contexts", ctxs_per_chunk);
471x_ValidateQueryContextsPerChunkAssignment(*sqb, ctxs_per_chunk);
473vector< vector<size_t> > ctx_offsets_per_chunk;
474x_ReadVectorOfVectorsForTest(
kTestName,
"ContextOffsets",
475ctx_offsets_per_chunk);
476x_ValidateContextOffsetsPerChunkAssignment(*sqb, ctx_offsets_per_chunk);
478vector<BlastQueryInfo*> split_query_info;
481x_ValidateLocalQueryData(splitter, &*opts, split_query_info);
490 const size_tkLength = 122347;
495CreateSSeqLoc(*
id, range, strand));
519vector< vector<size_t> > queries_per_chunk;
520x_ReadVectorOfVectorsForTest(
kTestName,
"Queries", queries_per_chunk);
521x_ValidateQueriesPerChunkAssignment(*sqb, queries_per_chunk);
523vector< vector<int> > ctxs_per_chunk;
524x_ReadVectorOfVectorsForTest(
kTestName,
"Contexts", ctxs_per_chunk);
525x_ValidateQueryContextsPerChunkAssignment(*sqb, ctxs_per_chunk);
527vector< vector<size_t> > ctx_offsets_per_chunk;
528x_ReadVectorOfVectorsForTest(
kTestName,
"ContextOffsets",
529ctx_offsets_per_chunk);
530x_ValidateContextOffsetsPerChunkAssignment(*sqb, ctx_offsets_per_chunk);
532vector<BlastQueryInfo*> split_query_info;
535x_ValidateLocalQueryData(splitter, &*opts, split_query_info);
544query_strands =
NULL)
547gi_length.push_back(make_pair<int, size_t>(112817621, 5567));
548gi_length.push_back(make_pair<int, size_t>(112585373, 5987));
549gi_length.push_back(make_pair<int, size_t>(112585216, 5531));
550gi_length.push_back(make_pair<int, size_t>(112585119, 5046));
552BOOST_REQUIRE_EQUAL(gi_length.size(), query_strands->size());
562 if( !query_strands ) {
585vector< vector<size_t> > queries_per_chunk;
586x_ReadVectorOfVectorsForTest(
kTestName,
"Queries", queries_per_chunk);
587x_ValidateQueriesPerChunkAssignment(*sqb, queries_per_chunk);
589vector< vector<int> > ctxs_per_chunk;
590x_ReadVectorOfVectorsForTest(
kTestName,
"Contexts", ctxs_per_chunk);
591x_ValidateQueryContextsPerChunkAssignment(*sqb, ctxs_per_chunk);
593vector< vector<size_t> > ctx_offsets_per_chunk;
594x_ReadVectorOfVectorsForTest(
kTestName,
"ContextOffsets",
595ctx_offsets_per_chunk);
596x_ValidateContextOffsetsPerChunkAssignment(*sqb, ctx_offsets_per_chunk);
598vector<BlastQueryInfo*> split_query_info;
601x_ValidateLocalQueryData(splitter, &*opts, split_query_info);
620 size_tconcatenated_query_length,
631BOOST_REQUIRE(chunk_range.
NotEmpty());
633 if(chunk_range.
GetToOpen() > concatenated_query_length) {
634chunk_range.
SetToOpen(concatenated_query_length);
654split_query_vector.clear();
660 if(kNumChunks == kDefaultIntValue) {
661 throwruntime_error(
"Invalid number of chunks in "+
kTestName);
666 for(
int i= 0;
i< kNumChunks;
i++) {
669 constvector<size_t> kQueryIndices = sqb->GetQueryIndices(
i);
671BOOST_REQUIRE( !kQueryIndices.empty() );
674 ITERATE(vector<size_t>, itr, kQueryIndices) {
676 out<<
"Query"<< *itr;
679os.str() +
out.str());
684vector<size_t> query_data;
685x_ParseConfigLine(
value, query_data);
686BOOST_REQUIRE_MESSAGE((
size_t)3==query_data.size(),os.str() +
out.str());
689sl->
SetInt().SetFrom(query_data[0]);
690sl->
SetInt().SetTo(query_data[1]);
695split_query_vector[
i]->AddQuery(bsq);
711 if(split_query_vector.empty()) {
716os <<
"Different split query vector sizes";
718BOOST_REQUIRE_MESSAGE(split_query_vector.size()==(
size_t)splitter->
m_NumChunks,os.str());
726os <<
"Different split query vector sizes for chunk "<<
i;
727BOOST_REQUIRE_MESSAGE(ref_qvector->
Size()==test_qvector->
Size(),os.str());
729 for(
size_tj = 0; j < ref_qvector->
Size(); j++) {
736os <<
"Starting offset for query "<< j <<
" in chunk "<<
i<<
" is now "<< test_query_range.
GetFrom() <<
" and not "<< ref_query_range.
GetFrom();
737BOOST_REQUIRE_MESSAGE(ref_query_range.
GetFrom()==test_query_range.
GetFrom(),os.str());
739os <<
"Ending offset for query "<< j <<
" in chunk "<<
i<<
" is now "<< test_query_range.
GetToOpen() <<
" and not "<< ref_query_range.
GetTo();
740BOOST_REQUIRE_MESSAGE(ref_query_range.
GetTo()==test_query_range.
GetToOpen(),os.str());
742os <<
"Strand for query "<< j <<
" in chunk "<<
i<<
" is now " 762vector<BlastQueryInfo*>& retval)
764ostringstream os, errors;
768 if(kNumChunks == kDefaultIntValue) {
769 throwruntime_error(
"Invalid number of chunks in "+
kTestName);
773retval.reserve(kNumChunks);
776 for(
int i= 0;
i< kNumChunks;
i++) {
778os <<
"BlastQueryInfo"<<
i<<
".";
779 const string kPrefix(os.str());
780errors.str(
"Chunk ");
781errors <<
i<<
": ";
785 if(kNumQueries == kDefaultIntValue) {
786 string msg(
"Invalid BlastQueryInfo::num_queries in ");
793errors <<
"Failed to allocate BlastQueryInfo structure" 794<<
" (Number of queries="<< kNumQueries <<
")";
795BOOST_REQUIRE_MESSAGE(retval[
i],errors.str());
801errors.str(
"Chunk ");
803BOOST_REQUIRE_MESSAGE(retval[
i]->first_context >= 0,errors.str());
809BOOST_REQUIRE_MESSAGE(retval[
i]->last_context >= 0,errors.str());
810BOOST_REQUIRE_MESSAGE(retval[
i]->first_context <= retval[
i]->last_context,errors.str());
812 for(
intc = retval[
i]->first_context;
813c <= retval[
i]->last_context;
817errors <<
"Chunk "<<
i<<
", BlastQueryInfo::context "<< c;
822retval[
i]->contexts[c].query_offset =
824 "query_offset", kDefaultIntValue);
825BOOST_REQUIRE_MESSAGE(retval[
i]->contexts[c].query_offset >= 0,
826errors.str() +
" query_offset >= 0");
828retval[
i]->contexts[c].query_length =
830 "query_length", kDefaultIntValue);
831BOOST_REQUIRE_MESSAGE(retval[
i]->contexts[c].query_length >= 0,
832errors.str() +
" query_length >= 0");
834retval[
i]->contexts[c].eff_searchsp =
836 "eff_searchsp", kDefaultIntValue);
837BOOST_REQUIRE_MESSAGE(retval[
i]->contexts[c].eff_searchsp >= 0,
838errors.str() +
" eff_searchsp >= 0");
840retval[
i]->contexts[c].length_adjustment =
842 "length_adjustment", kDefaultIntValue);
843BOOST_REQUIRE_MESSAGE(retval[
i]->contexts[c].length_adjustment >= 0,
844errors.str() +
" length_adjustment >= 0");
846retval[
i]->contexts[c].query_index =
848 "query_index", kDefaultIntValue);
849BOOST_REQUIRE_MESSAGE(retval[
i]->contexts[c].query_index >= 0,
850errors.str() +
" query_index");
852retval[
i]->contexts[c].frame =
854 "frame", kDefaultIntValue);
855BOOST_REQUIRE_MESSAGE(retval[
i]->contexts[c].frame == 1
856|| retval[
i]->contexts[c].frame == 2
857|| retval[
i]->contexts[c].frame == 3
858|| retval[
i]->contexts[c].frame == -1
859|| retval[
i]->contexts[c].frame == -2
860|| retval[
i]->contexts[c].frame == -3
861|| retval[
i]->contexts[c].frame == 0,
862errors.str() +
" frame");
864retval[
i]->contexts[c].is_valid =
866 "is_valid",
false);
867BOOST_REQUIRE_MESSAGE(retval[
i]->contexts[c].
is_valid,
868errors.str() +
" is_valid");
884 const char* data_to_read,
885vector< vector<T> >& retval)
891 if(kNumChunks == kDefaultIntValue) {
892 throwruntime_error(
"Invalid number of chunks in "+
kTestName);
896retval.resize(kNumChunks);
898 for(
int i= 0;
i< kNumChunks;
i++) {
900os <<
"Chunk"<<
i<< data_to_read;
903x_ParseConfigLine(
value, retval[
i]);
915vector<string> tokens;
917retval.reserve(tokens.size());
918 ITERATE(vector<string>, token, tokens) {
940 for(
size_t i= 0;
i< kNumChunks;
i++) {
941x_ComputeQueryChunkBounds(expected_chunk_range,
kChunkSize,
942kQuerySize, kQueryChunkOverlapSize);
944BOOST_REQUIRE_EQUAL(expected_chunk_range.
GetFrom(),
946BOOST_REQUIRE_EQUAL(expected_chunk_range.
GetToOpen(),
952BOOST_REQUIRE_EQUAL(expected_chunk_range.
GetFrom(), chunk_start);
953BOOST_REQUIRE_EQUAL(expected_chunk_range.
GetToOpen(), chunk_end);
954 TSeqPoschunk_length = chunk_end - chunk_start;
955BOOST_REQUIRE_EQUAL(chunk_length,
966 constvector< vector<size_t> >&
970BOOST_REQUIRE_EQUAL(kNumChunks, queries_per_chunk.size());
972 for(
size_t i= 0;
i< kNumChunks;
i++) {
974os <<
"Chunk number "<<
i<<
" has an invalid number of queries";
977BOOST_REQUIRE_MESSAGE(queries_per_chunk[
i].
size()==data2test.size(),os.str());
979 for(
size_tj = 0; j < data2test.size(); j++) {
981os <<
"Query index mismatch in chunk number "<<
i 982<<
" entry number "<< j;
983BOOST_REQUIRE_MESSAGE(queries_per_chunk[
i][j]==data2test[j],os.str());
992 constvector< vector<int> >&
997BOOST_REQUIRE_EQUAL(kNumChunks, contexts_per_chunk.size());
998 for(
size_t i= 0;
i< kNumChunks;
i++) {
1000os <<
"Chunk number "<<
i<<
" has an invalid number of contexts";
1003BOOST_REQUIRE_MESSAGE(contexts_per_chunk[
i].
size()==data2test.size(),os.str());
1005 for(
size_tj = 0; j < data2test.size(); j++) {
1007os <<
"Context index mismatch in chunk number "<<
i 1008<<
" entry number "<< j;
1009BOOST_REQUIRE_MESSAGE(contexts_per_chunk[
i][j]==data2test[j],os.str());
1018 constvector< vector<size_t> >&
1019contexts_offsets_per_chunk)
1022BOOST_REQUIRE_EQUAL(kNumChunks, contexts_offsets_per_chunk.size());
1023 for(
size_t i= 0;
i< kNumChunks;
i++) {
1025os <<
"Chunk number "<<
i 1026<<
" has an invalid number of context offsets";
1029BOOST_REQUIRE_MESSAGE(contexts_offsets_per_chunk[
i].
size()==data2test.size(),os.str());
1031 for(
size_tj = 0; j < data2test.size(); j++) {
1033os <<
"Context offset mismatch in chunk number "<<
i 1034<<
" entry number "<< j <<
" value now "<< data2test[j]
1035<<
" not "<< contexts_offsets_per_chunk[
i][j];
1037BOOST_REQUIRE_MESSAGE(contexts_offsets_per_chunk[
i][j]==data2test[j],os.str());
1055os <<
"Chunk "<< chunk_num <<
": BlastQueryInfo::first_context";
1056BOOST_REQUIRE_MESSAGE(reference->
first_context==
test->first_context,os.str());
1059os <<
"Chunk "<< chunk_num <<
": BlastQueryInfo::last_context";
1060BOOST_REQUIRE_MESSAGE(reference->
last_context==
test->last_context,os.str());
1063os <<
"Chunk "<< chunk_num <<
": BlastQueryInfo::num_queries";
1064BOOST_REQUIRE_MESSAGE(reference->
num_queries==
test->num_queries,os.str());
1067os <<
"Chunk "<< chunk_num <<
": BlastQueryInfo::max_length";
1068BOOST_REQUIRE_MESSAGE(reference->
max_length==
test->max_length,os.str());
1071os <<
"Chunk "<< chunk_num <<
": BlastQueryInfo::pattern_info";
1072BOOST_REQUIRE_MESSAGE(reference->
pattern_info==
test->pattern_info,os.str());
1075ctx <= reference->last_context;
1079os <<
"Chunk "<< chunk_num <<
", context "<<
ctx;
1081os.str() +
" query_offset");
1083os.str() +
" query_length");
1085os.str() +
" eff_searchsp");
1087os.str() +
" query_index");
1089os.str() +
" frame");
1091os.str() +
" is_valid");
1104vector<BlastQueryInfo*>
1105split_query_info_structs)
1108BOOST_REQUIRE(options);
1112BOOST_REQUIRE_EQUAL(kNumChunks, split_query_info_structs.size());
1114 for(
size_t i= 0;
i< kNumChunks;
i++) {
1116os <<
"Chunk "<<
i<<
": ";
1118BOOST_REQUIRE_MESSAGE(qf.
NotEmpty(),os.str() +
"NULL query factory");
1120BOOST_REQUIRE_MESSAGE(qd.
NotEmpty(),os.str() +
"NULL local query data");
1122os <<
"Different number of queries";
1155vector<Int4> query_indices_expected;
1156query_indices_expected.push_back(45);
1157query_indices_expected.push_back(0);
1158query_indices_expected.push_back(7);
1160 ITERATE(vector<Int4>, qi, query_indices_expected) {
1162BOOST_REQUIRE_EQUAL((
Int2)0, rv);
1164BOOST_REQUIRE_EQUAL((
Int2)0, rv);
1170BOOST_REQUIRE_EQUAL((
Int2)0, rv);
1171 for(
int i= 0; query_indices[
i] !=
UINT4_MAX;
i++) {
1172BOOST_REQUIRE_EQUAL(query_indices_expected[
i],
1173(
Int4)query_indices[
i]);
1175 sfree(query_indices);
1178 Uint4num_query_contexts = 0;
1181&num_query_contexts);
1182BOOST_REQUIRE_EQUAL((
Int2)0, rv);
1183 for(
Uint4 i= 0;
i< num_query_contexts;
i++) {
1184BOOST_REQUIRE_EQUAL(query_indices_expected[
i], query_contexts[
i]);
1186 sfree(query_contexts);
1188 size_tnum_queries(0);
1191BOOST_REQUIRE_EQUAL((
Int2)0, rv);
1192BOOST_REQUIRE_EQUAL(query_indices_expected.size(), num_queries);
1199map.resize(kNumChunks);
1200 Uint4query_index = 0;
1203 for(
Uint4chunk_num = 0; chunk_num < kNumChunks; chunk_num++) {
1204 const Uint4kQueriesPerChunk(random.
GetRand(1, 365));
1205 for(
Uint4 i= 0;
i< kQueriesPerChunk;
i++) {
1206map[chunk_num].push_back(query_index++);
1212 for(
size_tchunk_num = 0; chunk_num < map.size(); chunk_num++) {
1213 ITERATE(vector<Uint4>, qi, map[chunk_num]) {
1216BOOST_REQUIRE_EQUAL((
Int2)0, rv);
1220 for(
Uint4chunk_num = 0; chunk_num < kNumChunks; chunk_num++) {
1221vector<Uint4> query_indices_expected = map[chunk_num];
1227BOOST_REQUIRE_EQUAL((
Int2)0, rv);
1228BOOST_REQUIRE(query_indices !=
NULL);
1231 for(
i= 0;
i< query_indices_expected.size();
i++) {
1232BOOST_REQUIRE_EQUAL(query_indices_expected[
i],
1233query_indices[
i]);
1236 sfree(query_indices);
1238 size_tnum_queries(0);
1241BOOST_REQUIRE_EQUAL((
Int2)0, rv);
1242BOOST_REQUIRE_EQUAL(query_indices_expected.size(), num_queries);
1247 const Uint4kNumChunks = 3;
1249map.resize(kNumChunks);
1250map[0].push_back(0);
1251map[0].push_back(1);
1252map[1].push_back(2);
1253map[2].push_back(3);
1257 for(
Uint4chunk_num = 0; chunk_num < map.size(); chunk_num++) {
1258 ITERATE(vector<Uint4>, qi, map[chunk_num]) {
1261BOOST_REQUIRE_EQUAL((
Int2)0, rv);
1265 for(
Uint4chunk_num = 0; chunk_num < kNumChunks; chunk_num++) {
1266vector<Uint4> query_indices_expected = map[chunk_num];
1272BOOST_REQUIRE_EQUAL((
Int2)0, rv);
1273BOOST_REQUIRE(query_indices !=
NULL);
1276 for(
i= 0;
i< query_indices_expected.size();
i++) {
1277BOOST_REQUIRE_EQUAL(query_indices_expected[
i],
1278query_indices[
i]);
1281 sfree(query_indices);
1283 size_tnum_queries(0);
1286BOOST_REQUIRE_EQUAL((
Int2)0, rv);
1287BOOST_REQUIRE_EQUAL(query_indices_expected.size(), num_queries);
1296 kTestName(
"QuerySplitter_BlastnSingleQueryMultiChunk_BothStrands");
1306 kTestName(
"QuerySplitter_BlastnSingleQueryMultiChunk_PlusStrand");
1316 kTestName(
"QuerySplitter_BlastnSingleQueryMultiChunk_MinusStrand");
1326 kTestName(
"QuerySplitter_BlastnMultiQueryMultiChunk_PlusStrand");
1336 kTestName(
"QuerySplitter_BlastnMultiQueryMultiChunk_MinusStrand");
1346 kTestName(
"QuerySplitter_BlastnMultiQueryMultiChunk_BothStrands");
1355 kTestName(
"QuerySplitter_BlastnMultiQueryMultiChunk_MixedStrands");
1356vector<ENa_strand> query_strands;
1357query_strands.reserve(4);
1363QuerySplitter_BlastnMultiQueryMultiChunk(
kTestName,
1373 kTestName(
"QuerySplitter_BlastxSingleQueryMultiChunk_BothStrands");
1381 kTestName(
"QuerySplitter_BlastxSingleQueryMultiChunk_PlusStrand");
1389 kTestName(
"QuerySplitter_BlastxSingleQueryMultiChunk_MinusStrand");
1398 kTestName(
"QuerySplitter_BlastxMultiQueryMultiChunk_PlusStrand");
1407 kTestName(
"QuerySplitter_BlastxMultiQueryMultiChunk_MinusStrand");
1416 kTestName(
"QuerySplitter_BlastxMultiQueryMultiChunk_BothStrands");
1423 kTestName(
"QuerySplitter_BlastxMultiQueryMultiChunk_MixedStrands");
1424vector<ENa_strand> query_strands;
1425query_strands.reserve(4);
1439 const string kTestName(
"QuerySplitter_BlastpSingleQueryMultiChunk");
1441 const size_tkLength = 33423;
1454BOOST_REQUIRE_EQUAL(m_Config->GetInt(
kTestName,
"ChunkSize",
1459x_ReadQueryBoundsPerChunk(
kTestName, sqb, split_query_vector);
1460x_ValidateQuerySeqLocsPerChunk(splitter, split_query_vector);
1467 const size_tkNumChunks = (size_t)m_Config->GetInt(
kTestName,
1471BOOST_REQUIRE_EQUAL(kNumChunks, sqb->
GetNumChunks());
1473vector< vector<size_t> > queries_per_chunk;
1474x_ReadVectorOfVectorsForTest(
kTestName,
"Queries", queries_per_chunk);
1475x_ValidateQueriesPerChunkAssignment(*sqb, queries_per_chunk);
1477vector< vector<int> > ctxs_per_chunk;
1478x_ReadVectorOfVectorsForTest(
kTestName,
"Contexts", ctxs_per_chunk);
1479x_ValidateQueryContextsPerChunkAssignment(*sqb, ctxs_per_chunk);
1481vector< vector<size_t> > ctx_offsets_per_chunk;
1482x_ReadVectorOfVectorsForTest(
kTestName,
"ContextOffsets",
1483ctx_offsets_per_chunk);
1484x_ValidateContextOffsetsPerChunkAssignment(*sqb, ctx_offsets_per_chunk);
1486vector<BlastQueryInfo*> split_query_info;
1489x_ValidateLocalQueryData(splitter, &*opts, split_query_info);
1497 const string kTestName(
"QuerySplitter_BlastpMultiQueryMultiChunk");
1500gi_length.push_back(make_pair<int, size_t>(33624848, 6883));
1501gi_length.push_back(make_pair<int, size_t>(4758794, 6669));
1502gi_length.push_back(make_pair<int, size_t>(66821305, 6061));
1503gi_length.push_back(make_pair<int, size_t>(109075552, 5007));
1517BOOST_REQUIRE_EQUAL(m_Config->GetInt(
kTestName,
"ChunkSize",
1522x_ReadQueryBoundsPerChunk(
kTestName, sqb, split_query_vector);
1523x_ValidateQuerySeqLocsPerChunk(splitter, split_query_vector);
1530 const size_tkNumChunks = (size_t)m_Config->GetInt(
kTestName,
1534BOOST_REQUIRE_EQUAL(kNumChunks, sqb->
GetNumChunks());
1536vector< vector<size_t> > queries_per_chunk;
1537x_ReadVectorOfVectorsForTest(
kTestName,
"Queries", queries_per_chunk);
1538x_ValidateQueriesPerChunkAssignment(*sqb, queries_per_chunk);
1540vector< vector<int> > ctxs_per_chunk;
1541x_ReadVectorOfVectorsForTest(
kTestName,
"Contexts", ctxs_per_chunk);
1542x_ValidateQueryContextsPerChunkAssignment(*sqb, ctxs_per_chunk);
1544vector< vector<size_t> > ctx_offsets_per_chunk;
1545x_ReadVectorOfVectorsForTest(
kTestName,
"ContextOffsets",
1546ctx_offsets_per_chunk);
1547x_ValidateContextOffsetsPerChunkAssignment(*sqb, ctx_offsets_per_chunk);
1549vector<BlastQueryInfo*> split_query_info;
1552x_ValidateLocalQueryData(splitter, &*opts, split_query_info);
1562 kTestName(
"TestCContextTranslator_BlastnMultiQuery_BothStrands");
1564gi_length.push_back(make_pair<int, size_t>(107784911, 1000));
1565gi_length.push_back(make_pair<int, size_t>(115354032, 250));
1566gi_length.push_back(make_pair<int, size_t>(115381005, 2551));
1569 const size_tnum_chunks = 9;
1571vector< vector<int> > starting_chunks(num_chunks);
1572vector< vector<int> > absolute_contexts(num_chunks);
1573vector< vector<size_t> > context_offset_corrections(num_chunks);
1575x_ReadVectorOfVectorsForTest(
kTestName,
"StartingChunks",
1577x_ReadVectorOfVectorsForTest(
kTestName,
"AbsoluteContexts",
1579x_ReadVectorOfVectorsForTest(
kTestName,
"ContextOffsets",
1580context_offset_corrections);
1583starting_chunks, absolute_contexts,
1584&context_offset_corrections,
1592 kTestName(
"TestCContextTranslator_BlastnMultiQuery_PlusStrand");
1594gi_length.push_back(make_pair<int, size_t>(107784911, 1000));
1595gi_length.push_back(make_pair<int, size_t>(115354032, 250));
1596gi_length.push_back(make_pair<int, size_t>(115381005, 2551));
1599 const size_tnum_chunks = 9;
1601vector< vector<int> > starting_chunks(num_chunks);
1602vector< vector<int> > absolute_contexts(num_chunks);
1603vector< vector<size_t> > context_offset_corrections(num_chunks);
1605x_ReadVectorOfVectorsForTest(
kTestName,
"StartingChunks",
1607x_ReadVectorOfVectorsForTest(
kTestName,
"AbsoluteContexts",
1609x_ReadVectorOfVectorsForTest(
kTestName,
"ContextOffsets",
1610context_offset_corrections);
1613starting_chunks, absolute_contexts,
1614&context_offset_corrections,
1622 kTestName(
"TestCContextTranslator_BlastnMultiQuery_MinusStrand");
1624gi_length.push_back(make_pair<int, size_t>(107784911, 1000));
1625gi_length.push_back(make_pair<int, size_t>(115354032, 250));
1626gi_length.push_back(make_pair<int, size_t>(115381005, 2551));
1629 const size_tnum_chunks = 9;
1631vector< vector<int> > starting_chunks(num_chunks);
1632vector< vector<int> > absolute_contexts(num_chunks);
1633vector< vector<size_t> > context_offset_corrections(num_chunks);
1635x_ReadVectorOfVectorsForTest(
kTestName,
"StartingChunks",
1637x_ReadVectorOfVectorsForTest(
kTestName,
"AbsoluteContexts",
1639x_ReadVectorOfVectorsForTest(
kTestName,
"ContextOffsets",
1640context_offset_corrections);
1643starting_chunks, absolute_contexts,
1644&context_offset_corrections,
1652 kTestName(
"TestCContextTranslator_BlastxSingleQuery_BothStrands_0");
1654gi_length.push_back(make_pair<int, size_t>(116001669, 33));
1657 const size_tnum_chunks = 3;
1660vector< vector<int> > starting_chunks(num_chunks);
1661vector< vector<int> > absolute_contexts(num_chunks);
1662vector< vector<size_t> > context_offset_corrections(num_chunks);
1664x_ReadVectorOfVectorsForTest(
kTestName,
"StartingChunks",
1666x_ReadVectorOfVectorsForTest(
kTestName,
"AbsoluteContexts",
1668x_ReadVectorOfVectorsForTest(
kTestName,
"ContextOffsets",
1669context_offset_corrections);
1672starting_chunks, absolute_contexts,
1673&context_offset_corrections,
1682 kTestName(
"TestCContextTranslator_BlastxSingleQuery_BothStrands_1");
1684gi_length.push_back(make_pair<int, size_t>(116001673, 34));
1687 const size_tnum_chunks = 3;
1690vector< vector<int> > starting_chunks(num_chunks);
1691vector< vector<int> > absolute_contexts(num_chunks);
1692vector< vector<size_t> > context_offset_corrections(num_chunks);
1694x_ReadVectorOfVectorsForTest(
kTestName,
"StartingChunks",
1696x_ReadVectorOfVectorsForTest(
kTestName,
"AbsoluteContexts",
1698x_ReadVectorOfVectorsForTest(
kTestName,
"ContextOffsets",
1699context_offset_corrections);
1702starting_chunks, absolute_contexts,
1703&context_offset_corrections,
1712 kTestName(
"TestCContextTranslator_BlastxSingleQuery_BothStrands_2");
1714gi_length.push_back(make_pair<int, size_t>(116001668, 35));
1717 const size_tkNumChunks = m_Config->GetInt(
kTestName,
"NumChunks",
1721vector< vector<int> > starting_chunks(kNumChunks);
1722vector< vector<int> > absolute_contexts(kNumChunks);
1723vector< vector<size_t> > context_offset_corrections(kNumChunks);
1725x_ReadVectorOfVectorsForTest(
kTestName,
"StartingChunks",
1727x_ReadVectorOfVectorsForTest(
kTestName,
"AbsoluteContexts",
1729x_ReadVectorOfVectorsForTest(
kTestName,
"ContextOffsets",
1730context_offset_corrections);
1733starting_chunks, absolute_contexts,
1734&context_offset_corrections,
1743 kTestName(
"TestCContextTranslator_BlastxMultiQuery_BothStrands");
1745gi_length.push_back(make_pair<int, size_t>(107784911, 1000));
1746gi_length.push_back(make_pair<int, size_t>(115354032, 250));
1747gi_length.push_back(make_pair<int, size_t>(115381005, 2551));
1750 const size_tnum_chunks = 10;
1752vector< vector<int> > starting_chunks(num_chunks);
1753vector< vector<int> > absolute_contexts(num_chunks);
1754vector< vector<size_t> > context_offset_corrections(num_chunks);
1756x_ReadVectorOfVectorsForTest(
kTestName,
"StartingChunks",
1758x_ReadVectorOfVectorsForTest(
kTestName,
"AbsoluteContexts",
1760x_ReadVectorOfVectorsForTest(
kTestName,
"ContextOffsets",
1761context_offset_corrections);
1764starting_chunks, absolute_contexts,
1765&context_offset_corrections,
1771 kTestName(
"TestCContextTranslator_BlastxMultiQuery_PlusStrand");
1773gi_length.push_back(make_pair<int, size_t>(107784911, 1000));
1774gi_length.push_back(make_pair<int, size_t>(115354032, 250));
1775gi_length.push_back(make_pair<int, size_t>(115381005, 2551));
1778 const size_tnum_chunks = 10;
1780vector< vector<int> > starting_chunks(num_chunks);
1781vector< vector<int> > absolute_contexts(num_chunks);
1782vector< vector<size_t> > context_offset_corrections(num_chunks);
1784x_ReadVectorOfVectorsForTest(
kTestName,
"StartingChunks",
1786x_ReadVectorOfVectorsForTest(
kTestName,
"AbsoluteContexts",
1788x_ReadVectorOfVectorsForTest(
kTestName,
"ContextOffsets",
1789context_offset_corrections);
1792starting_chunks, absolute_contexts,
1793&context_offset_corrections,
1799 kTestName(
"TestCContextTranslator_BlastxMultiQuery_MinusStrand");
1801gi_length.push_back(make_pair<int, size_t>(107784911, 1000));
1802gi_length.push_back(make_pair<int, size_t>(115354032, 250));
1803gi_length.push_back(make_pair<int, size_t>(115381005, 2551));
1806 const size_tnum_chunks = 10;
1808vector< vector<int> > starting_chunks(num_chunks);
1809vector< vector<int> > absolute_contexts(num_chunks);
1810vector< vector<size_t> > context_offset_corrections(num_chunks);
1812x_ReadVectorOfVectorsForTest(
kTestName,
"StartingChunks",
1814x_ReadVectorOfVectorsForTest(
kTestName,
"AbsoluteContexts",
1816x_ReadVectorOfVectorsForTest(
kTestName,
"ContextOffsets",
1817context_offset_corrections);
1820starting_chunks, absolute_contexts,
1821&context_offset_corrections,
1830 const string kTestName(
"QuerySplitter_NoSplit");
1839 const size_tkNumChunks = m_Config->GetInt(
kTestName,
"NumChunks",
1843BOOST_REQUIRE_EQUAL(
false, splitter->
IsQuerySplit());
1844BOOST_REQUIRE_EQUAL(m_Config->GetInt(
kTestName,
"ChunkSize",
1850BOOST_REQUIRE_EQUAL(
false, splitter->
IsQuerySplit());
1851BOOST_REQUIRE_EQUAL(kNumChunks, sqb->
GetNumChunks());
1856BOOST_REQUIRE(
false);
1857}
catch(
construntime_error&) {
1858BOOST_REQUIRE(
true);
1863BOOST_REQUIRE_EQUAL(qf, chunk_query_factory);
1871gi_length.push_back(make_pair<int, size_t>(95116755, 35000));
1872gi_length.push_back(make_pair<int, size_t>(112123020, 35580));
1882 const size_tkNumChunks(2);
1886BOOST_REQUIRE(
false);
1887}
catch(
constout_of_range& ) {
1888BOOST_REQUIRE(
true);
1894BOOST_REQUIRE(chunk_0 != qf);
1895BOOST_REQUIRE(chunk_1 != qf);
1897BOOST_REQUIRE(chunk_0.
NotEmpty());
1898BOOST_REQUIRE(chunk_1.
NotEmpty());
1907BOOST_REQUIRE_EQUAL(1055, retval);
1912BOOST_REQUIRE_EQUAL(1, retval);
1918BOOST_REQUIRE_EQUAL(3, retval);
1924BOOST_REQUIRE_EQUAL(2, retval);
Auxiliary functions for BLAST.
#define sfree(x)
Safe free a pointer: belongs to a higher level header.
Definitions which are dependant on the NCBI C++ Object Manager.
Declares the CBlastOptionsHandle and CBlastOptionsFactory classes.
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.
EProgram
This enumeration is to evolve into a task/program specific list that specifies sets of default parame...
@ eTblastx
Translated nucl-Translated nucl.
@ eBlastn
Nucl-Nucl (traditional blastn)
@ eBlastp
Protein-Protein.
@ eBlastx
Translated nucl-Protein.
BOOST_AUTO_TEST_SUITE_END() static int s_GetSegmentFlags(const CBioseq &bioseq)
ncbi::TMaskedQueryRegions mask
CAutoEnvironmentVariable â.
Defines BLAST error codes (user errors included)
Encapsulates ALL the BLAST algorithm's options.
size_type Size() const
Returns the number of queries found in this query vector.
CConstRef< objects::CSeq_loc > GetQuerySeqLoc(size_type i) const
Get the query Seq-loc for a query by index.
Auxiliary class to provide convenient and efficient access to conversions between contexts local to q...
NCBI C++ Object Manager dependant implementation of IQueryFactory.
Class responsible for splitting query sequences and providing data to the BLAST search class to searc...
static CRef< CScope > NewScope(bool with_defaults=true)
Return a new scope, possibly (by default) with default loaders, which will include the Genbank loader...
Wrapper class around SSplitQueryBlk structure.
CRef< CNcbiRegistry > m_Config
This represents the split_query.ini configuration file.
void QuerySplitter_BlastxSingleQueryMultiChunk(const string &kTestName, ENa_strand strand)
void x_ValidateQueryContextsPerChunkAssignment(const CSplitQueryBlk &sqb, const vector< vector< int > > &contexts_per_chunk)
Validates the query contexts assigned to all the chunks.
void x_ValidateLocalQueryData(CRef< CQuerySplitter > splitter, const CBlastOptions *options, vector< BlastQueryInfo * > split_query_info_structs)
Validate the local query data for all chunks, comparing data produced by the CQuerySplitter object an...
void x_ReadVectorOfVectorsForTest(const string &kTestName, const char *data_to_read, vector< vector< T > > &retval)
This method reads entries in the config file of the format ChunkNX, here N is the chunk number and X ...
~CSplitQueryTestFixture()
void x_ValidateChunkBounds(size_t kChunkSize, size_t kQuerySize, const CSplitQueryBlk &sqb, EBlastProgramType p)
Auxiliary method to validate the chunk bounds calculated by the CSplitQueryBlk object and the x_Compu...
void x_ReadQueryBoundsPerChunk(const string &kTestName, CConstRef< CSplitQueryBlk > sqb, CQuerySplitter::TSplitQueryVector &split_query_vector)
This function reads values in the split_query.ini file with the format ChunkNQueryM (where N is the c...
void x_ValidateQueryInfoForChunk(const BlastQueryInfo *reference, const BlastQueryInfo *test, size_t chunk_num)
Validate the query info structure generated (test) against the expected one (reference) (N....
void x_TestCContextTranslator(TGiLengthVector &gi_length, size_t chunk_size, size_t num_chunks, blast::EProgram program, vector< vector< int > > &starting_chunks, vector< vector< int > > &absolute_contexts, vector< vector< size_t > > *context_offsets, ENa_strand strand, vector< ENa_strand > *query_strands=NULL)
void x_ValidateQueriesPerChunkAssignment(const CSplitQueryBlk &sqb, const vector< vector< size_t > > &queries_per_chunk)
Validates the query sequences (by index) assigned to all the chunks This compares the data calculated...
void QuerySplitter_BlastnSingleQueryMultiChunk(const string &kTestName, ENa_strand strand)
void x_ParseConfigLine(const string &input, vector< T > &retval)
Tokenizes a string containing comma-separated values into a vector of values.
void x_PrepareBlastQueryStructures(TIntId gis[], EProgram program, BLAST_SequenceBlk **seq_blk, BlastQueryInfo **qinfo, ENa_strand *strand=NULL)
Populate a BLAST_SequenceBlk and BlastQueryInfo structures out of an array of GIs.
void QuerySplitter_BlastxMultiQueryMultiChunk(const string &kTestName, ENa_strand strand, vector< ENa_strand > *query_strands=NULL)
bool x_CmpSequenceData(const Uint1 *global, const Uint1 *chunk, size_t len)
Auxiliary function that compares bytes of sequence data to validate the context offset corrections.
void x_ComputeQueryChunkBounds(TChunkRange &chunk_range, size_t chunk_size, size_t concatenated_query_length, size_t overlap)
Incrementally compute the query chunk bounds.
void x_ReadSplitQueryInfoForTest(const string &kTestName, EBlastProgramType program, vector< BlastQueryInfo * > &retval)
Reads data to populate multiple BlastQueryInfo structures.
void x_ValidateQuerySeqLocsPerChunk(CRef< CQuerySplitter > splitter, const CQuerySplitter::TSplitQueryVector &split_query_vector)
Compare the query data (start, stop, strand) for each chunk computed by the splitter vs.
void x_ValidateContextOffsetsPerChunkAssignment(const CSplitQueryBlk &sqb, const vector< vector< size_t > > &contexts_offsets_per_chunk)
Validates the context offsets assigned to all the chunks.
void QuerySplitter_BlastnMultiQueryMultiChunk(const string &kTestName, ENa_strand strand, vector< ENa_strand > *query_strands=NULL)
static CTestObjMgr & Instance()
Collection of masked regions for a single query sequence.
typedef for the messages for an entire BLAST search, which could be comprised of multiple query seque...
static const int chunk_size
static bool is_valid(const char *num, int type, CONV_RESULT *cr)
std::ofstream out("events_result.xml")
main entry point for tests
#define test(a, b, c, d, e)
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
size_t SplitQuery_GetOverlapChunkSize(EBlastProgramType program)
Size of the region that overlaps in between each query chunk.
void SetStrandOption(objects::ENa_strand s)
size_t GetChunkSize() const
Returns the number of bases/residues that make up a query chunk.
TChunkRange GetChunkBounds(size_t chunk_num) const
Get the boundaries of a chunk in the concatenated query.
SSplitQueryBlk * GetCStruct() const
Returns the C structure managed by objects of this class.
vector< CRef< CBlastQueryVector > > TSplitQueryVector
Definition of a vector of CBlastQueryVectors, each element corresponds to a query chunk.
bool IsQuerySplit() const
Determines whether the query sequence(s) are split or not.
size_t GetNumQueriesForChunk(size_t chunk_num) const
Get the number of queries in a given chunk.
size_t GetNumChunks() const
Retrieve the number of chunks.
int GetAbsoluteContext(size_t chunk_num, Int4 context_in_chunk) const
Get the context number in the absolute (i.e.
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
virtual BLAST_SequenceBlk * GetSequenceBlk()=0
Accessor for the BLAST_SequenceBlk structure.
CRef< ILocalQueryData > MakeLocalQueryData(const CBlastOptions *opts)
Creates and caches an ILocalQueryData.
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.
Uint4 m_NumChunks
Number of chunks, if this is 1, no splitting occurs.
EBlastProgramType EProgramToEBlastProgramType(EProgram p)
Convert EProgram to EBlastProgramType.
size_t SplitQuery_GetChunkSize(EProgram program)
Returns the optimal chunk size for a given task.
EBlastProgramType GetProgramType() const
Returns the CORE BLAST notion of program type.
virtual BlastQueryInfo * GetQueryInfo()=0
Accessor for the BlastQueryInfo structure.
const CBlastOptions & GetOptions() const
Return the object which this object is a handle for.
CRef< IQueryFactory > GetQueryFactoryForChunk(Uint4 chunk_num)
Returns a IQueryFactory suitable to be executed by a BLAST search class.
virtual size_t GetNumQueries()=0
Get the number of queries.
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,...
vector< size_t > GetQueryIndices(size_t chunk_num) const
Get the indices of the queries contained in a given chunk.
CRef< CSplitQueryBlk > Split()
Split the query sequence(s)
int GetStartingChunk(size_t curr_chunk, Int4 context_in_chunk) const
Get the chunk number where context_in_chunk starts (i.e.
vector< int > GetQueryContexts(size_t chunk_num) const
Get the contexts of the queries contained in a given chunk.
Uint4 SplitQuery_CalculateNumChunks(EBlastProgramType program, size_t *chunk_size, size_t concatenated_query_length, size_t num_queries)
Calculate the number of chunks that a query will be split into based upon query length,...
size_t GetSumOfSequenceLengths()
Compute the sum of all the sequence's lengths.
Uint4 GetNumberOfChunks() const
Returns the number of chunks the query/queries will be split into.
CRef< CSplitQueryBlk > m_SplitBlk
Split query block structure.
vector< size_t > GetContextOffsets(size_t chunk_num) const
Get the context offsets (corrections) of the queries contained in a given chunk.
TSplitQueryVector m_SplitQueriesInChunk
Vector of split queries.
#define GI_FROM(T, value)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
void SetPacked_int(TPacked_int &v)
ENa_strand GetStrand(void) const
Get the location's strand.
void SetId(CSeq_id &id)
set the 'id' field in all parts of this location
TRange GetTotalRange(void) const
void SetStrand(ENa_strand strand)
Set the strand for all of the location's ranges.
void AddDefaults(TPriority pri=kPriority_Default)
Add default data loaders from object manager.
void Reset(void)
Reset reference object.
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty â pointing to an object and has a non-null value.
bool Empty(void) const THROWS_NONE
Check if CRef is empty â not pointing to any object, which means having a null value.
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
Uint4 TValue
Type of the generated integer value and/or the seed value.
TValue GetRand(void)
Get the next random number in the interval [0..GetMax()] (inclusive)
position_type GetLength(void) const
TThisType & SetFrom(position_type from)
bool NotEmpty(void) const
TThisType & SetToOpen(position_type toOpen)
position_type GetToOpen(void) const
position_type GetFrom(void) const
static TThisType GetEmpty(void)
TThisType & SetLength(position_type length)
int TFlags
Binary OR of "EFlags".
virtual bool GetBool(const string §ion, const string &name, bool default_value, TFlags flags=0, EErrAction err_action=eThrow) const
Get boolean value of specified parameter name.
virtual const string & Get(const string §ion, const string &name, TFlags flags=0) const
Get the parameter value.
virtual int GetInt(const string §ion, const string &name, int default_value, TFlags flags=0, EErrAction err_action=eThrow) const
Get integer value of specified parameter name.
bool Empty(TFlags flags=fAllLayers) const
Verify if Registry is empty.
@ fTruncate
Leading, trailing blanks can be truncated.
@ fNoOverride
Cannot change existing value.
@ fTransient
Transient â not saved by default.
@ fNotJustCore
Include auxiliary subregistries.
static string SizetToString(size_t value, TNumToStringFlags flags=0, int base=10)
Convert size_t to string.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string.
@ fConvErr_NoThrow
Do not throw an exception on error.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
ENa_strand
strand of nucleic acid
bool IsPacked_int(void) const
Check if variant Packed_int is selected.
bool IsInt(void) const
Check if variant Int is selected.
@ eNa_strand_both
in forward orientation
@ e_Gi
GenInfo Integrated Database.
unsigned int
A callback function used to compare two keys in a database.
Main class to perform a BLAST search on the local machine.
const struct ncbi::grid::netcache::search::fields::SIZE size
Magic spell ;-) needed for some weird compilers... very empiric.
const GenericPointer< typename T::ValueType > T2 value
#define UINT4_MAX
largest number represented by unsigned int.
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
vector< TMaskedQueryRegions > TSeqLocInfoVector
Collection of masked regions for all queries in a BLAST search.
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
Int2 SplitQueryBlk_GetQueryIndicesForChunk(const SSplitQueryBlk *squery_blk, Uint4 chunk_num, Uint4 **query_indices)
Retrieve an array of query indices for the requested chunk.
Int2 SplitQueryBlk_GetQueryContextsForChunk(const SSplitQueryBlk *squery_blk, Uint4 chunk_num, Int4 **query_contexts, Uint4 *num_query_contexts)
Retrieve an array of query contexts for the requested chunk.
Int2 SplitQueryBlk_AddQueryToChunk(SSplitQueryBlk *squery_blk, Uint4 query_index, Uint4 chunk_num)
Add a query index to a given chunk.
Int2 SplitQueryBlk_GetNumQueriesForChunk(const SSplitQueryBlk *squery_blk, Uint4 chunk_num, size_t *num_queries)
Retrieve the number of queries that correspond to chunk number chunk_num.
Int2 SplitQueryBlk_AddContextToChunk(SSplitQueryBlk *squery_blk, Int4 ctx_index, Uint4 chunk_num)
Add a query context index to a given chunk.
const Int4 kInvalidContext
Value to represent an invalid context.
const Int2 kBadParameter
Invalid parameter used in a function call.
Declares CQuerySplitter, a class to split the query sequence(s)
Auxiliary functions and classes to assist in query splitting.
static void s_ConvertToBlastQueries(const TGiLengthVector &gi_length, TSeqLocVector &retval, size_t *tot_length=NULL, vector< ENa_strand > *strands=NULL, const TSeqLocInfoVector *masks=NULL)
Convert a vector of GIs with its lengths into a TSeqLocVector.
static void s_CalculateMaxLength(BlastQueryInfo *query_info)
Calculate and assign the maximum length field in the BlastQueryInfo structure.
vector< TGiLenPair > TGiLengthVector
Vector containing pairs of gis and their length.
pair< TIntId, size_t > TGiLenPair
Pair for gis and their length (in that order)
BOOST_AUTO_TEST_CASE(SplitQueriesIn1Chunk)
vector< vector< Uint4 > > TSplitQueryChunkMap
vector< SSeqLoc > TSeqLocVector
Vector of sequence locations.
Structure to hold a 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.
Int4 query_offset
Offset of this query, strand or frame in the concatenated super-query.
Int8 eff_searchsp
Effective search space for this context.
Int4 query_index
Index of query (same for all frames)
Int1 frame
Frame number (-1, -2, -3, 0, 1, 2, or 3)
The query related information.
Int4 first_context
Index of the first element of the context array.
BlastContextInfo * contexts
Information per context.
int num_queries
Number of query sequences.
struct SPHIQueryInfo * pattern_info
Counts of PHI BLAST pattern occurrences, used in PHI BLAST only.
Int4 last_context
Index of the last element of the context array.
Uint4 max_length
Length of the longest among the concatenated queries.
Structure to represent a single sequence to be fed to BLAST.
Utility stuff for more convenient using of Boost.Test library.
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