NCBI C++ ToolKit
|
Go to the source code of this file.
Go to the SVN repository for this file.
Classes | |
struct | SSplitQueryBlk |
Structure to keep track of which query sequences are allocated to each query chunk. More... | |
Typedefs | |
typedef struct SDynamicUint4Array | SQueriesPerChunk |
Forward declaration of dynamic array. More... | |
typedef struct SDynamicInt4Array | SContextsPerChunk |
Forward declaration of dynamic array. More... | |
typedef struct SDynamicUint4Array | SContextOffsetsPerChunk |
Forward declaration of dynamic array. More... | |
typedef struct SSeqRange | SQueryChunkBoundary |
Convenience typedef. More... | |
typedef struct SSplitQueryBlk | SSplitQueryBlk |
Structure to keep track of which query sequences are allocated to each query chunk. More... | |
Functions | |
SSplitQueryBlk * | SplitQueryBlkNew (Uint4 num_chunks, Boolean gapped_merge) |
Allocate a new split query chunk structure. More... | |
SSplitQueryBlk * | SplitQueryBlkFree (SSplitQueryBlk *squery_blk) |
Deallocate a split query chunk structure. More... | |
Boolean | SplitQueryBlk_AllowGap (SSplitQueryBlk *squery_blk) |
Determines whether HSPs on different diagnonals may be merged. More... | |
Int2 | SplitQueryBlk_SetChunkBounds (SSplitQueryBlk *squery_blk, Uint4 chunk_num, Uint4 starting_offset, Uint4 ending_offset) |
Set the query chunk's bounds with respect to the full sized concatenated query. More... | |
Int2 | SplitQueryBlk_GetChunkBounds (const SSplitQueryBlk *squery_blk, Uint4 chunk_num, size_t *starting_offset, size_t *ending_offset) |
Get the query chunk's bounds with respect to the full sized concatenated query. More... | |
Int2 | SplitQueryBlk_AddQueryToChunk (SSplitQueryBlk *squery_blk, Uint4 query_index, Uint4 chunk_num) |
Add a query index to a given chunk. More... | |
Int2 | SplitQueryBlk_AddContextToChunk (SSplitQueryBlk *squery_blk, Int4 ctx_index, Uint4 chunk_num) |
Add a query context index to a given chunk. More... | |
Int2 | SplitQueryBlk_AddContextOffsetToChunk (SSplitQueryBlk *squery_blk, Uint4 offset, Uint4 chunk_num) |
Add a context offset to a given chunk. More... | |
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. More... | |
Int2 | SplitQueryBlk_GetQueryIndicesForChunk (const SSplitQueryBlk *squery_blk, Uint4 chunk_num, Uint4 **query_indices) |
Retrieve an array of query indices for the requested chunk. More... | |
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. More... | |
Int2 | SplitQueryBlk_GetContextOffsetsForChunk (const SSplitQueryBlk *squery_blk, Uint4 chunk_num, Uint4 **context_offsets) |
Retrieve an array of context offsets for the requested chunk. More... | |
Int2 | SplitQueryBlk_SetChunkOverlapSize (SSplitQueryBlk *squery_blk, size_t size) |
Sets the query chunk overlap size. More... | |
size_t | SplitQueryBlk_GetChunkOverlapSize (const SSplitQueryBlk *squery_blk) |
Returns the query chunk overlap size. More... | |
Variables | |
const Int4 | kInvalidContext |
Value to represent an invalid context. More... | |
const Int2 | kBadParameter |
Invalid parameter used in a function call. More... | |
const Int2 | kOutOfMemory |
Failure due to out-of-memory condition. More... | |
typedef struct SDynamicUint4Array SContextOffsetsPerChunk |
Forward declaration of dynamic array.
Definition at line 1 of file split_query.h.
typedef struct SDynamicInt4Array SContextsPerChunk |
Forward declaration of dynamic array.
Definition at line 1 of file split_query.h.
typedef struct SDynamicUint4Array SQueriesPerChunk |
Forward declaration of dynamic array.
Definition at line 1 of file split_query.h.
typedef struct SSeqRange SQueryChunkBoundary |
Convenience typedef.
Definition at line 1 of file split_query.h.
typedef struct SSplitQueryBlk SSplitQueryBlk |
Structure to keep track of which query sequences are allocated to each query chunk.
Int2 SplitQueryBlk_AddContextOffsetToChunk | ( | SSplitQueryBlk * | squery_blk, |
Uint4 | offset, | ||
Uint4 | chunk_num | ||
) |
Add a context offset to a given chunk.
squery_blk | split query block structure [in] |
offset | the context offset to assign [in] |
chunk_num | number of chunk to assign query index [in] |
Definition at line 222 of file split_query.c.
References SSplitQueryBlk::chunk_offset_map, DynamicUint4Array_Append(), kBadParameter, SSplitQueryBlk::num_chunks, and offset.
Referenced by CSplitQueryBlk::AddContextOffsetToChunk().
Int2 SplitQueryBlk_AddContextToChunk | ( | SSplitQueryBlk * | squery_blk, |
Int4 | ctx_index, | ||
Uint4 | chunk_num | ||
) |
Add a query context index to a given chunk.
squery_blk | split query block structure [in] |
ctx_index | query context index to assign [in] |
chunk_num | number of chunk to assign query index [in] |
Definition at line 211 of file split_query.c.
References SSplitQueryBlk::chunk_ctx_map, DynamicInt4Array_Append(), kBadParameter, and SSplitQueryBlk::num_chunks.
Referenced by CSplitQueryBlk::AddContextToChunk(), and BOOST_AUTO_TEST_CASE().
Int2 SplitQueryBlk_AddQueryToChunk | ( | SSplitQueryBlk * | squery_blk, |
Uint4 | query_index, | ||
Uint4 | chunk_num | ||
) |
Add a query index to a given chunk.
squery_blk | split query block structure [in] |
query_index | query index to assign [in] |
chunk_num | number of chunk to assign query index [in] |
Definition at line 201 of file split_query.c.
References SSplitQueryBlk::chunk_query_map, DynamicUint4Array_Append(), kBadParameter, and SSplitQueryBlk::num_chunks.
Referenced by CSplitQueryBlk::AddQueryToChunk(), and BOOST_AUTO_TEST_CASE().
Boolean SplitQueryBlk_AllowGap | ( | SSplitQueryBlk * | squery_blk | ) |
Determines whether HSPs on different diagnonals may be merged.
squery_blk | split query block structure [in] |
Definition at line 154 of file split_query.c.
References FALSE, SSplitQueryBlk::gapped_merge, and TRUE.
Referenced by BlastHSPStreamMerge().
Int2 SplitQueryBlk_GetChunkBounds | ( | const SSplitQueryBlk * | squery_blk, |
Uint4 | chunk_num, | ||
size_t * | starting_offset, | ||
size_t * | ending_offset | ||
) |
Get the query chunk's bounds with respect to the full sized concatenated query.
squery_blk | split query block structure [in] |
chunk_num | number of chunk to assign bounds [in] |
starting_offset | starting offset of this chunk [in|out] |
ending_offset | ending offset of this chunk [in|out] |
Definition at line 174 of file split_query.c.
References SSplitQueryBlk::chunk_bounds, kBadParameter, SSeqRange::left, SSplitQueryBlk::num_chunks, and SSeqRange::right.
Referenced by CSplitQueryBlk::GetChunkBounds().
size_t SplitQueryBlk_GetChunkOverlapSize | ( | const SSplitQueryBlk * | squery_blk | ) |
Returns the query chunk overlap size.
squery_blk | split query block structure [in] |
Definition at line 332 of file split_query.c.
References SSplitQueryBlk::chunk_overlap_sz, and kBadParameter.
Referenced by BlastHSPStreamMerge(), and CSplitQueryBlk::GetChunkOverlapSize().
Int2 SplitQueryBlk_GetContextOffsetsForChunk | ( | const SSplitQueryBlk * | squery_blk, |
Uint4 | chunk_num, | ||
Uint4 ** | context_offsets | ||
) |
Retrieve an array of context offsets for the requested chunk.
Each offset is the correction needed for the query range of HSPs found in the specified chunk
squery_blk | split query block structure [in] |
chunk_num | number of chunk to retrieve query indices [in] |
context_offsets | offsets for the contexts in the requested chunk, this will be allocated in this function and the last element in the array will be assigned the value UINT4_MAX. Caller is responsible for deallocating this. |
Definition at line 293 of file split_query.c.
References SSplitQueryBlk::chunk_offset_map, SDynamicUint4Array::data, kBadParameter, kOutOfMemory, malloc(), NULL, SSplitQueryBlk::num_chunks, SDynamicUint4Array::num_used, and UINT4_MAX.
Referenced by BlastHSPStreamMerge(), and CSplitQueryBlk::GetContextOffsets().
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.
squery_blk | split query block structure [in] |
chunk_num | number of chunk to retrieve query indices [in] |
num_queries | the return value of this function [in|out] |
Definition at line 189 of file split_query.c.
References SSplitQueryBlk::chunk_query_map, kBadParameter, SSplitQueryBlk::num_chunks, and SDynamicUint4Array::num_used.
Referenced by BOOST_AUTO_TEST_CASE(), and CSplitQueryBlk::GetNumQueriesForChunk().
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.
squery_blk | split query block structure [in] |
chunk_num | number of chunk to retrieve query indices [in] |
query_contexts | contexts for the chunk requested, this will be allocated in this function, caller is responsible for deallocating this. |
num_query_contexts | size of the returned array in query_contexts |
Definition at line 262 of file split_query.c.
References SSplitQueryBlk::chunk_ctx_map, SDynamicInt4Array::data, kBadParameter, kOutOfMemory, malloc(), NULL, SSplitQueryBlk::num_chunks, and SDynamicInt4Array::num_used.
Referenced by BlastHSPStreamMerge(), BOOST_AUTO_TEST_CASE(), and CSplitQueryBlk::GetQueryContexts().
Int2 SplitQueryBlk_GetQueryIndicesForChunk | ( | const SSplitQueryBlk * | squery_blk, |
Uint4 | chunk_num, | ||
Uint4 ** | query_indices | ||
) |
Retrieve an array of query indices for the requested chunk.
squery_blk | split query block structure [in] |
chunk_num | number of chunk to retrieve query indices [in] |
query_indices | indices for the chunk requested, this will be allocated in this function and the last element in the array will be assigned the value UINT4_MAX. Caller is responsible for deallocating this. |
Definition at line 235 of file split_query.c.
References SSplitQueryBlk::chunk_query_map, SDynamicUint4Array::data, kBadParameter, kOutOfMemory, malloc(), NULL, SSplitQueryBlk::num_chunks, SDynamicUint4Array::num_used, and UINT4_MAX.
Referenced by BlastHSPStreamMerge(), BOOST_AUTO_TEST_CASE(), and CSplitQueryBlk::GetQueryIndices().
Int2 SplitQueryBlk_SetChunkBounds | ( | SSplitQueryBlk * | squery_blk, |
Uint4 | chunk_num, | ||
Uint4 | starting_offset, | ||
Uint4 | ending_offset | ||
) |
Set the query chunk's bounds with respect to the full sized concatenated query.
squery_blk | split query block structure [in] |
chunk_num | number of chunk to assign bounds [in] |
starting_offset | starting offset of this chunk [in] |
ending_offset | ending offset of this chunk [in] |
Definition at line 160 of file split_query.c.
References SSplitQueryBlk::chunk_bounds, kBadParameter, SSeqRange::left, SSplitQueryBlk::num_chunks, and SSeqRange::right.
Referenced by CSplitQueryBlk::SetChunkBounds().
Int2 SplitQueryBlk_SetChunkOverlapSize | ( | SSplitQueryBlk * | squery_blk, |
size_t | size | ||
) |
Sets the query chunk overlap size.
squery_blk | split query block structure [in] |
size | size of the chunk overlap size [in] |
Definition at line 322 of file split_query.c.
References SSplitQueryBlk::chunk_overlap_sz, kBadParameter, and ncbi::grid::netcache::search::fields::size.
Referenced by CSplitQueryBlk::SetChunkOverlapSize().
SSplitQueryBlk* SplitQueryBlkFree | ( | SSplitQueryBlk * | squery_blk | ) |
Deallocate a split query chunk structure.
squery_blk | structure to deallocate [in] |
Definition at line 116 of file split_query.c.
References SSplitQueryBlk::chunk_bounds, SSplitQueryBlk::chunk_ctx_map, SSplitQueryBlk::chunk_offset_map, SSplitQueryBlk::chunk_query_map, DynamicInt4ArrayFree(), DynamicUint4ArrayFree(), i, NULL, SSplitQueryBlk::num_chunks, and sfree.
Referenced by SplitQueryBlkNew(), and CSplitQueryBlk::~CSplitQueryBlk().
SSplitQueryBlk* SplitQueryBlkNew | ( | Uint4 | num_chunks, |
Boolean | gapped_merge | ||
) |
Allocate a new split query chunk structure.
num_chunks | number of chunks in which the query will be split [in] |
Definition at line 42 of file split_query.c.
References calloc(), SSplitQueryBlk::chunk_bounds, SSplitQueryBlk::chunk_ctx_map, SSplitQueryBlk::chunk_offset_map, SSplitQueryBlk::chunk_query_map, DynamicInt4ArrayNew(), DynamicUint4ArrayNew(), SSplitQueryBlk::gapped_merge, i, NULL, SSplitQueryBlk::num_chunks, and SplitQueryBlkFree().
Referenced by CSplitQueryBlk::CSplitQueryBlk().
Invalid parameter used in a function call.
Definition at line 37 of file split_query.c.
Referenced by BOOST_AUTO_TEST_CASE(), SplitQueryBlk_AddContextOffsetToChunk(), SplitQueryBlk_AddContextToChunk(), SplitQueryBlk_AddQueryToChunk(), SplitQueryBlk_GetChunkBounds(), SplitQueryBlk_GetChunkOverlapSize(), SplitQueryBlk_GetContextOffsetsForChunk(), SplitQueryBlk_GetNumQueriesForChunk(), SplitQueryBlk_GetQueryContextsForChunk(), SplitQueryBlk_GetQueryIndicesForChunk(), SplitQueryBlk_SetChunkBounds(), and SplitQueryBlk_SetChunkOverlapSize().
Value to represent an invalid context.
Definition at line 39 of file split_query.c.
Referenced by CContextTranslator::GetContextInChunk(), CContextTranslator::GetStartingChunk(), s_GetAbsoluteContextLength(), CQuerySplitter::x_ComputeContextOffsets_NonTranslatedQueries(), CQuerySplitter::x_ComputeContextOffsets_TranslatedQueries(), CQuerySplitter::x_ComputeQueryContextsForChunks(), and CSplitQueryTestFixture::x_TestCContextTranslator().
Failure due to out-of-memory condition.
Definition at line 38 of file split_query.c.
Referenced by s_LOG_Handler(), SplitQueryBlk_GetContextOffsetsForChunk(), SplitQueryBlk_GetQueryContextsForChunk(), and SplitQueryBlk_GetQueryIndicesForChunk().