NCBI C++ ToolKit
Functions
split_query_cxx.cpp File Reference

Defines CQuerySplitter, a class to split the query sequence(s) More...

#include <ncbi_pch.hpp>
#include "split_query.hpp"
#include <algo/blast/api/sseqloc.hpp>
#include <algo/blast/api/blast_options.hpp>
#include <algo/blast/api/local_blast.hpp>
#include <objtools/simple/simple_om.hpp>
#include <objmgr/util/sequence.hpp>
#include <algo/blast/api/objmgr_query_data.hpp>
#include "split_query_aux_priv.hpp"
#include "blast_setup.hpp"
+ Include dependency graph for split_query_cxx.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Functions

ostream & operator<< (ostream &out, const CQuerySplitter &rhs)
 
static void s_SetSplitQuerySeqInterval (const TChunkRange &chunk, const TChunkRange &query_range, int query_offset, CRef< CSeq_loc > split_query_loc)
 Auxiliary function to assign the split query's Seq-interval so that it's constrained within the chunk boundaries. More...
 
static unsigned int s_AddShift (unsigned int context, int shift)
 Adds the necessary shift to the context to record the query contexts for the query chunks. More...
 
static int s_GetShiftForTranslatedNegStrand (size_t query_length)
 Retrieve the shift for the negative strand. More...
 
static bool s_IsPlusStrand (const BlastQueryInfo *qinfo, Int4 context_number)
 Determine whether a given context corresponds to the plus or minus strand. More...
 
static size_t s_GetAbsoluteContextLength (const vector< const BlastQueryInfo * > &chunk_qinfo, int chunk_num, const CContextTranslator &ctx_translator, int absolute_context)
 Get the length of a context in absolute terms (i.e. More...
 

Detailed Description

Defines CQuerySplitter, a class to split the query sequence(s)

Definition in file split_query_cxx.cpp.

Function Documentation

◆ operator<<()

ostream& operator<< ( ostream &  out,
const CQuerySplitter rhs 
)

◆ s_AddShift()

static unsigned int s_AddShift ( unsigned int  context,
int  shift 
)
inlinestatic

Adds the necessary shift to the context to record the query contexts for the query chunks.

Parameters
contextquery context [in]
shiftshift to add [in]

Definition at line 301 of file split_query_cxx.cpp.

References _ASSERT, abort(), and context.

Referenced by CQuerySplitter::x_ComputeQueryContextsForChunks().

◆ s_GetAbsoluteContextLength()

static size_t s_GetAbsoluteContextLength ( const vector< const BlastQueryInfo * > &  chunk_qinfo,
int  chunk_num,
const CContextTranslator ctx_translator,
int  absolute_context 
)
static

Get the length of a context in absolute terms (i.e.

: in the context of the full, non-split sequence)

Parameters
chunk_qinfovector of BlastQueryInfo structures corresponding to the various query chunks [in]
chunk_numChunk number, index into the vector above [in]
ctx_translatorauxiliary context translator object [in]
absolute_contextcontext in the full, non-split query
Returns
length of the requested context

Definition at line 452 of file split_query_cxx.cpp.

References CContextTranslator::GetContextInChunk(), and kInvalidContext.

Referenced by CQuerySplitter::x_ComputeContextOffsets_NonTranslatedQueries(), and CQuerySplitter::x_ComputeContextOffsets_TranslatedQueries().

◆ s_GetShiftForTranslatedNegStrand()

static int s_GetShiftForTranslatedNegStrand ( size_t  query_length)
inlinestatic

Retrieve the shift for the negative strand.

Parameters
query_lengthlength of the query [in]
Returns
shift (either 1, -1, or 0)

Definition at line 327 of file split_query_cxx.cpp.

References CODON_LENGTH.

Referenced by CQuerySplitter::x_ComputeQueryContextsForChunks().

◆ s_IsPlusStrand()

static bool s_IsPlusStrand ( const BlastQueryInfo qinfo,
Int4  context_number 
)
inlinestatic

Determine whether a given context corresponds to the plus or minus strand.

Parameters
qinfoBlastQueryInfo structure to determine the strand [in]
context_numberContext number in the BlastQueryInfo structure (index into the BlastContextInfo array) [in]

Definition at line 434 of file split_query_cxx.cpp.

References BlastQueryInfo::contexts, and BlastContextInfo::frame.

Referenced by CQuerySplitter::x_ComputeContextOffsets_NonTranslatedQueries(), and CQuerySplitter::x_ComputeContextOffsets_TranslatedQueries().

◆ s_SetSplitQuerySeqInterval()

static void s_SetSplitQuerySeqInterval ( const TChunkRange chunk,
const TChunkRange query_range,
int  query_offset,
CRef< CSeq_loc split_query_loc 
)
static

Auxiliary function to assign the split query's Seq-interval so that it's constrained within the chunk boundaries.

Parameters
chunkRange for the chunk [in]
query_rangeRange of sequence data corresponding to the full query [in]
split_query_locSeq-loc for this query constrained by the chunk's boundaries [out]

Definition at line 189 of file split_query_cxx.cpp.

References _ASSERT, COpenRange< Position >::GetFrom(), COpenRange< Position >::GetToOpen(), COpenRange< Position >::IntersectingWith(), max(), CRef< C, Locker >::NotEmpty(), CSeq_interval_Base::SetFrom(), CSeq_loc::SetInt(), and CSeq_interval_Base::SetTo().

Referenced by CQuerySplitter::x_ComputeQueryIndicesForChunks().

Modified on Fri Jul 19 17:14:20 2024 by modify_doxy.py rev. 669887