NCBI C++ ToolKit
Classes | Typedefs | Enumerations | Functions
blast_query_info.h File Reference

Definitions and functions associated with the BlastQueryInfo structure. More...

#include <algo/blast/core/ncbi_std.h>
#include <algo/blast/core/blast_def.h>
#include <algo/blast/core/blast_program.h>
+ Include dependency graph for blast_query_info.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  BlastContextInfo
 The context related information. More...
 
struct  BlastQueryInfo
 The query related information. More...
 

Typedefs

typedef enum EMagicBlastSegmentInfo EMagicBlastSegmentInfo
 Information about paired segments (for mapping short reads) More...
 
typedef struct BlastContextInfo BlastContextInfo
 The context related information. More...
 
typedef struct BlastQueryInfo BlastQueryInfo
 The query related information. More...
 

Enumerations

enum  EMagicBlastSegmentInfo {
  eNoSegments = 0 , fFirstSegmentFlag = 1 , fLastSegmentFlag = 1 << 1 , fPartialFlag = 1 << 2 ,
  eFirstSegment = fFirstSegmentFlag , eLastSegment = fLastSegmentFlag
}
 Information about paired segments (for mapping short reads) More...
 

Functions

BlastQueryInfoBlastQueryInfoNew (EBlastProgramType program, int num_queries)
 Allocate memory for query information structure. More...
 
BlastQueryInfoBlastQueryInfoFree (BlastQueryInfo *query_info)
 Deallocate memory for query information structure. More...
 
BlastQueryInfoBlastQueryInfoDup (const BlastQueryInfo *query_info)
 Duplicates the query information structure. More...
 
Int4 Blast_GetQueryIndexFromContext (Int4 context, EBlastProgramType program)
 Given a context from BLAST engine core, return the query index. More...
 
Int4 Blast_GetQueryIndexFromQueryOffset (Int4 query_offset, EBlastProgramType program, const BlastQueryInfo *query_info)
 Return the query index (zero based), given the query offset in the initial HSP as the program. More...
 
Int8 BlastQueryInfoGetEffSearchSpace (const BlastQueryInfo *qinfo, EBlastProgramType program, Int4 query_index)
 Retrieve a query sequence's search space. More...
 
void BlastQueryInfoSetEffSearchSpace (BlastQueryInfo *qinfo, EBlastProgramType program, Int4 query_index, Int8 eff_searchsp)
 Set a query sequence's search space. More...
 
Int4 BlastQueryInfoGetQueryLength (const BlastQueryInfo *qinfo, EBlastProgramType program, Int4 query_index)
 Obtains the sequence length for a given query in the query, without taking into consideration any applicable translations. More...
 
Int2 Blast_GetOneQueryStructs (BlastQueryInfo **one_query_info_ptr, BLAST_SequenceBlk **one_query_ptr, const BlastQueryInfo *query_info, BLAST_SequenceBlk *query, Int4 query_index)
 Create auxiliary query structures with all data corresponding to a single query sequence within a concatenated set. More...
 
Int4 BSearchContextInfo (Int4 n, const BlastQueryInfo *A)
 Search BlastContextInfo structures for the specified offset. More...
 
Uint4 QueryInfo_GetSeqBufLen (const BlastQueryInfo *qinfo)
 Get the number of bytes required for the concatenated sequence buffer, given a query info structure. More...
 
Int4ContextOffsetsToOffsetArray (const BlastQueryInfo *info)
 Copy the context query offsets to an allocated array of Int4. More...
 
void OffsetArrayToContextOffsets (BlastQueryInfo *info, Int4 *new_offsets, EBlastProgramType prog)
 Copy the context query offsets from an array of Int4, allocating the context array if needed. More...
 

Detailed Description

Definitions and functions associated with the BlastQueryInfo structure.

Definition in file blast_query_info.h.

Typedef Documentation

◆ BlastContextInfo

The context related information.

◆ BlastQueryInfo

The query related information.

◆ EMagicBlastSegmentInfo

Information about paired segments (for mapping short reads)

Enumeration Type Documentation

◆ EMagicBlastSegmentInfo

Information about paired segments (for mapping short reads)

Enumerator
eNoSegments 

Sequence is not part of a pair.

fFirstSegmentFlag 

The first sequence of a pair.

fLastSegmentFlag 

The last sequence of a pair.

fPartialFlag 

The other segment is not present (did not pass quality filtering.

eFirstSegment 

The first sequence of a pair with both sequences read and accepted.

eLastSegment 

Definition at line 47 of file blast_query_info.h.

Function Documentation

◆ Blast_GetOneQueryStructs()

Int2 Blast_GetOneQueryStructs ( BlastQueryInfo **  one_query_info_ptr,
BLAST_SequenceBlk **  one_query_ptr,
const BlastQueryInfo query_info,
BLAST_SequenceBlk query,
Int4  query_index 
)

Create auxiliary query structures with all data corresponding to a single query sequence within a concatenated set.

Allocates the structures if the pointers are NULL on input; otherwise only changes the contents.

Parameters
one_query_info_ptrPointer to the query information structure for a single query. Allocated and filled here, so the caller of this function will be responsible for freeing it. [out]
one_query_ptrPointer to the query sequence block structure; allocated here, but the contents are not allocated; it is still safe to free by the caller after use. [out]
query_infoQuery information structure containing information about a concatenated set. [in]
queryQuery sequence block corresponding to a concatenated set of queries. [in]
query_indexWhich query index to create the auxiliary structures for? [in]
Returns
-1 if memory allocation failed; 0 on success

Definition at line 327 of file blast_query_info.c.

References calloc(), BlastQueryInfo::contexts, FALSE, BlastQueryInfo::last_context, BLAST_SequenceBlk::length, NULL, BlastQueryInfo::num_queries, BLAST_SequenceBlk::oid, query, BlastContextInfo::query_length, BlastContextInfo::query_offset, BLAST_SequenceBlk::sequence, and BLAST_SequenceBlk::sequence_allocated.

Referenced by s_RPSComputeTraceback(), and s_RPSPreliminarySearchEngine().

◆ Blast_GetQueryIndexFromContext()

Int4 Blast_GetQueryIndexFromContext ( Int4  context,
EBlastProgramType  program 
)

Given a context from BLAST engine core, return the query index.

Parameters
contextContext saved in a BlastHSP structure [in]
programType of BLAST program [in]
Returns
Query index in a set of queries or -1 on error

Definition at line 40 of file blast_query_info.c.

References Blast_QueryIsProtein(), Blast_QueryIsTranslated(), context, eBlastTypePsiTblastn, NUM_FRAMES, and NUM_STRANDS.

Referenced by BLAST_GetGappedScore(), Blast_GetQueryIndexFromQueryOffset(), BlastQueryInfoNew(), OffsetArrayToContextOffsets(), s_BlastHSPBestHitRun(), s_BlastHSPCollectorRun(), s_BlastHSPCullingFinal(), and CQueryDataPerChunk::x_ContextInChunkToQueryIndex().

◆ Blast_GetQueryIndexFromQueryOffset()

Int4 Blast_GetQueryIndexFromQueryOffset ( Int4  query_offset,
EBlastProgramType  program,
const BlastQueryInfo query_info 
)

Return the query index (zero based), given the query offset in the initial HSP as the program.

Parameters
query_offsetOffset of the query in the initial HSP [in]
programEBlastProgramType [in]
query_infoinformation about all the queries [in]
Returns
Query Index in a set of queries

Definition at line 52 of file blast_query_info.c.

References Blast_GetQueryIndexFromContext(), BSearchContextInfo(), and context.

Referenced by BLAST_GetGappedScore(), and BOOST_AUTO_TEST_CASE().

◆ BlastQueryInfoDup()

BlastQueryInfo* BlastQueryInfoDup ( const BlastQueryInfo query_info)

◆ BlastQueryInfoFree()

BlastQueryInfo* BlastQueryInfoFree ( BlastQueryInfo query_info)

◆ BlastQueryInfoGetEffSearchSpace()

Int8 BlastQueryInfoGetEffSearchSpace ( const BlastQueryInfo qinfo,
EBlastProgramType  program,
Int4  query_index 
)

Retrieve a query sequence's search space.

Parameters
qinfoBlastQueryInfo structure [in]
programCORE program type [in]
query_indexnumber of the query (query_index < BlastQueryInfo::num_queries) [in]
Returns
the search space of the query sequence requested or 0 if this is not set

Definition at line 187 of file blast_query_info.c.

References ASSERT, BLAST_GetNumberOfContexts(), BlastQueryInfo::contexts, BlastContextInfo::eff_searchsp, and i.

Referenced by CEffectiveSearchSpaceCalculator::GetEffSearchSpace().

◆ BlastQueryInfoGetQueryLength()

Int4 BlastQueryInfoGetQueryLength ( const BlastQueryInfo qinfo,
EBlastProgramType  program,
Int4  query_index 
)

Obtains the sequence length for a given query in the query, without taking into consideration any applicable translations.

Parameters
qinfoBlastQueryInfo structure [in]
programCORE program type [in]
query_indexnumber of the query (query_index < BlastQueryInfo::num_queries) [in]
Returns
the length of the query sequence requested

Definition at line 163 of file blast_query_info.c.

References ASSERT, BLAST_GetNumberOfContexts(), Blast_QueryIsTranslated(), BlastQueryInfo::contexts, eBlastTypeBlastn, eBlastTypeMapping, BlastContextInfo::query_length, and s_GetTranslatedQueryDNALength().

Referenced by BlastMaskLocDNAToProtein(), BlastMaskLocProteinToDNA(), PHIGetPatternOccurrences(), s_BlastHSPBestHitRun(), s_ImportFromHitlist(), SetupQueries_OMF(), and setupQueryInfoForOffsetTranslation().

◆ BlastQueryInfoNew()

BlastQueryInfo* BlastQueryInfoNew ( EBlastProgramType  program,
int  num_queries 
)

◆ BlastQueryInfoSetEffSearchSpace()

void BlastQueryInfoSetEffSearchSpace ( BlastQueryInfo qinfo,
EBlastProgramType  program,
Int4  query_index,
Int8  eff_searchsp 
)

Set a query sequence's search space.

Parameters
qinfoBlastQueryInfo structure [in]
programCORE program type [in]
query_indexnumber of the query (query_index < BlastQueryInfo::num_queries) [in]
eff_searchspthe effective search space to use [in]

Definition at line 205 of file blast_query_info.c.

References ASSERT, BLAST_GetNumberOfContexts(), BlastQueryInfo::contexts, BlastContextInfo::eff_searchsp, and i.

◆ BSearchContextInfo()

Int4 BSearchContextInfo ( Int4  n,
const BlastQueryInfo A 
)

◆ ContextOffsetsToOffsetArray()

Int4* ContextOffsetsToOffsetArray ( const BlastQueryInfo info)

Copy the context query offsets to an allocated array of Int4.

Parameters
infoDescribes the concatenated query.
Returns
Allocated array.

Definition at line 253 of file blast_query_info.c.

References ASSERT, info, malloc(), and result.

Referenced by Blast_TracebackFromHSPList(), and s_BlastSearchEngineCore().

◆ OffsetArrayToContextOffsets()

void OffsetArrayToContextOffsets ( BlastQueryInfo info,
Int4 new_offsets,
EBlastProgramType  prog 
)

Copy the context query offsets from an array of Int4, allocating the context array if needed.

Parameters
infoDestination for the values.
new_offsetsArray of values to copy from.
progThe blast program type.

Definition at line 294 of file blast_query_info.c.

References ASSERT, BLAST_ContextToFrame(), Blast_GetQueryIndexFromContext(), calloc(), i, info, and prog.

Referenced by Blast_TracebackFromHSPList(), s_RPSComputeTraceback(), s_RPSGapAlignDataPrepare(), and s_RPSOffsetArrayToContextOffsets().

◆ QueryInfo_GetSeqBufLen()

Uint4 QueryInfo_GetSeqBufLen ( const BlastQueryInfo qinfo)

Get the number of bytes required for the concatenated sequence buffer, given a query info structure.

The context data should already be assigned.

Parameters
qinfoQuery info structure. [in/out]
Returns
Number of bytes for all queries and inter-query marks.

Definition at line 246 of file blast_query_info.c.

References BlastQueryInfo::contexts, BlastQueryInfo::last_context, BlastContextInfo::query_length, and BlastContextInfo::query_offset.

Referenced by BLAST_CreateMixedFrameDNATranslation(), and SetupQueries_OMF().

Modified on Sun Jun 23 05:22:34 2024 by modify_doxy.py rev. 669887