CQuerySplitter Class Reference
[BLAST (Basic Local Alignment Search Tool)]

Search Toolkit Book for CQuerySplitter

#include <split_query.hpp>

Inheritance diagram for CQuerySplitter:

Inheritance graph
[legend]
Collaboration diagram for CQuerySplitter:

Collaboration graph
[legend]
List of all members.

Detailed Description

Class responsible for splitting query sequences and providing data to the BLAST search class to search a split query chunk.

Definition at line 65 of file split_query.hpp.

Public Types

typedef vector< CRef< objects::CScope > > TScopeVector
 Defines a vector of CScope objects.
typedef vector< CRef< CBlastQueryVector > > TSplitQueryVector
 Definition of a vector of CBlastQueryVectors, each element corresponds to a query chunk.

Public Member Functions

 CQuerySplitter (CRef< IQueryFactory > query_factory, const CBlastOptions *options)
 Parametrized constructor.
size_t GetChunkSize () const
 Returns the number of bases/residues that make up a query chunk.
Uint4 GetNumberOfChunks () const
 Returns the number of chunks the query/queries will be split into.
bool IsQuerySplit () const
 Determines whether the query sequence(s) are split or not.
CRef< CSplitQueryBlkSplit ()
 Split the query sequence(s).
CRef< IQueryFactoryGetQueryFactoryForChunk (Uint4 chunk_num)
 Returns a IQueryFactory suitable to be executed by a BLAST search class.

Private Member Functions

void x_ExtractCScopesAndMasks ()
 Auxiliary method to extract the CScope objects from the query factory.
void x_ComputeChunkRanges ()
 Compute all chunk ranges.
void x_ComputeQueryIndicesForChunks ()
 Compute query indices that correspond to each chunk.
void x_ComputeQueryContextsForChunks ()
 Compute query contexts that correspond to each chunk.
void x_ComputeContextOffsetsForChunks ()
 Compute the context offsets which are used to adjust the results.
void x_ComputeContextOffsets_TranslatedQueries ()
 Compute the context offsets which are used to adjust the results for translated queries.
void x_ComputeContextOffsets_NonTranslatedQueries ()
 Compute the context offsets which are used to adjust the results for non-translated queries.
 CQuerySplitter (const CQuerySplitter &rhs)
 Prohibit copy constructor.
CQuerySplitteroperator= (const CQuerySplitter &rhs)
 Prohibit assignment operator.

Private Attributes

CRef< IQueryFactorym_QueryFactory
 The original, unsplit query factory.
const CBlastOptionsm_Options
 BLAST options.
Uint4 m_NumChunks
 Number of chunks, if this is 1, no splitting occurs.
CRef< CSplitQueryBlkm_SplitBlk
 Split query block structure.
vector< CRef< IQueryFactory > > m_QueryChunkFactories
 Vector of query factories, each element corresponds to a chunk.
CRef< ILocalQueryDatam_LocalQueryData
 Source of local query data.
size_t m_TotalQueryLength
 Length of the concatenated query.
size_t m_ChunkSize
 Size of the query chunks.
TScopeVector m_Scopes
 Vector of CScope objects.
TSeqLocInfoVector m_UserSpecifiedMasks
 Vector of masking locations.
TSplitQueryVector m_SplitQueriesInChunk
 Vector of split queries.

Friends

class ::CSplitQueryTestFixture
 Declare unit test class as a friend.
ostream & operator<< (ostream &out, const CQuerySplitter &rhs)
 Print this object so that its contents can be directly used to update split_query.ini (for unit testing).


Member Typedef Documentation

typedef vector< CRef<objects::CScope> > CQuerySplitter::TScopeVector
 

Defines a vector of CScope objects.

Definition at line 69 of file split_query.hpp.

typedef vector< CRef<CBlastQueryVector> > CQuerySplitter::TSplitQueryVector
 

Definition of a vector of CBlastQueryVectors, each element corresponds to a query chunk.

Definition at line 73 of file split_query.hpp.


Constructor & Destructor Documentation

CQuerySplitter::CQuerySplitter CRef< IQueryFactory query_factory,
const CBlastOptions options
 

Parametrized constructor.

Parameters:
query_factory Object containing query sequence(s) [in]
options BLAST options for the search [in]

Definition at line 53 of file split_query_cxx.cpp.

References SplitQuery_CalculateNumChunks(), and SplitQuery_GetChunkSize().

CQuerySplitter::CQuerySplitter const CQuerySplitter rhs  )  [private]
 

Prohibit copy constructor.


Member Function Documentation

size_t CQuerySplitter::GetChunkSize void   )  const [inline]
 

Returns the number of bases/residues that make up a query chunk.

Definition at line 82 of file split_query.hpp.

Uint4 CQuerySplitter::GetNumberOfChunks  )  const [inline]
 

Returns the number of chunks the query/queries will be split into.

Definition at line 85 of file split_query.hpp.

Referenced by operator<<().

CRef< IQueryFactory > CQuerySplitter::GetQueryFactoryForChunk Uint4  chunk_num  ) 
 

Returns a IQueryFactory suitable to be executed by a BLAST search class.

Parameters:
chunk_num chunk number to retrieve (< GetNumberOfChunks())

Definition at line 878 of file split_query_cxx.cpp.

References CRef< C, Locker >::Empty(), NStr::IntToString(), m_SplitBlk, and Split().

bool CQuerySplitter::IsQuerySplit  )  const [inline]
 

Determines whether the query sequence(s) are split or not.

Definition at line 88 of file split_query.hpp.

CQuerySplitter& CQuerySplitter::operator= const CQuerySplitter rhs  )  [private]
 

Prohibit assignment operator.

CRef< CSplitQueryBlk > CQuerySplitter::Split  ) 
 

Split the query sequence(s).

Definition at line 845 of file split_query_cxx.cpp.

References m_SplitBlk, and CRef< C, Locker >::NotEmpty().

Referenced by GetQueryFactoryForChunk().

void CQuerySplitter::x_ComputeChunkRanges  )  [private]
 

Compute all chunk ranges.

Definition at line 135 of file split_query_cxx.cpp.

References _ASSERT, CBlastOptions::GetProgramType(), m_ChunkSize, m_NumChunks, m_Options, m_SplitBlk, m_TotalQueryLength, CRef< C, Locker >::NotEmpty(), and SplitQuery_GetOverlapChunkSize().

void CQuerySplitter::x_ComputeContextOffsets_NonTranslatedQueries  )  [private]
 

Compute the context offsets which are used to adjust the results for non-translated queries.

Definition at line 567 of file split_query_cxx.cpp.

References _ASSERT, Blast_QueryIsTranslated(), CBlastOptions::GetProgramType(), INT4_MAX, m_LocalQueryData, m_Options, m_QueryChunkFactories, m_SplitBlk, and SplitQuery_GetOverlapChunkSize().

Referenced by x_ComputeContextOffsetsForChunks().

void CQuerySplitter::x_ComputeContextOffsets_TranslatedQueries  )  [private]
 

Compute the context offsets which are used to adjust the results for translated queries.

Definition at line 673 of file split_query_cxx.cpp.

References _ASSERT, Blast_QueryIsTranslated(), CODON_LENGTH, CBlastOptions::GetProgramType(), INT4_MAX, m_LocalQueryData, m_Options, m_QueryChunkFactories, m_SplitBlk, and SplitQuery_GetOverlapChunkSize().

Referenced by x_ComputeContextOffsetsForChunks().

void CQuerySplitter::x_ComputeContextOffsetsForChunks  )  [private]
 

Compute the context offsets which are used to adjust the results.

Definition at line 555 of file split_query_cxx.cpp.

References Blast_QueryIsTranslated(), CBlastOptions::GetProgramType(), m_Options, x_ComputeContextOffsets_NonTranslatedQueries(), and x_ComputeContextOffsets_TranslatedQueries().

void CQuerySplitter::x_ComputeQueryContextsForChunks  )  [private]
 

Compute query contexts that correspond to each chunk.

Definition at line 326 of file split_query_cxx.cpp.

References _ASSERT, Blast_QueryIsTranslated(), BlastSetup_GetStrand(), CODON_LENGTH, eNa_strand_minus, GetNumberOfContexts(), CBlastOptions::GetProgramType(), CBlastOptions::GetStrandOption(), kInvalidContext, m_LocalQueryData, m_Options, m_SplitBlk, NUM_FRAMES, auto_ptr< X >::reset(), and s_GetShiftForTranslatedNegStrand().

void CQuerySplitter::x_ComputeQueryIndicesForChunks  )  [private]
 

Compute query indices that correspond to each chunk.

Definition at line 211 of file split_query_cxx.cpp.

References _TRACE, CBlastOptions::GetProgramType(), CBlastOptions::GetStrandOption(), m_LocalQueryData, and m_Options.

void CQuerySplitter::x_ExtractCScopesAndMasks  )  [private]
 

Auxiliary method to extract the CScope objects from the query factory.

Definition at line 113 of file split_query_cxx.cpp.

References _ASSERT, CObjMgr_QueryFactory::ExtractScopes(), CObjMgr_QueryFactory::ExtractUserSpecifiedMasks(), m_LocalQueryData, m_NumChunks, m_QueryFactory, m_Scopes, m_UserSpecifiedMasks, and CRef< C, Locker >::NotEmpty().


Friends And Related Function Documentation

friend class ::CSplitQueryTestFixture [friend]
 

Declare unit test class as a friend.

Definition at line 153 of file split_query.hpp.

ostream& operator<< ostream &  out,
const CQuerySplitter rhs
[friend]
 

Print this object so that its contents can be directly used to update split_query.ini (for unit testing).

Parameters:
out stream to print this object [in|out]
rhs object to print [in]

Definition at line 66 of file split_query_cxx.cpp.


Member Data Documentation

size_t CQuerySplitter::m_ChunkSize [private]
 

Size of the query chunks.

Definition at line 119 of file split_query.hpp.

Referenced by x_ComputeChunkRanges().

CRef<ILocalQueryData> CQuerySplitter::m_LocalQueryData [private]
 

Source of local query data.

Definition at line 115 of file split_query.hpp.

Referenced by operator<<(), x_ComputeContextOffsets_NonTranslatedQueries(), x_ComputeContextOffsets_TranslatedQueries(), x_ComputeQueryContextsForChunks(), x_ComputeQueryIndicesForChunks(), and x_ExtractCScopesAndMasks().

Uint4 CQuerySplitter::m_NumChunks [private]
 

Number of chunks, if this is 1, no splitting occurs.

Definition at line 109 of file split_query.hpp.

Referenced by x_ComputeChunkRanges(), and x_ExtractCScopesAndMasks().

const CBlastOptions* CQuerySplitter::m_Options [private]
 

BLAST options.

Definition at line 107 of file split_query.hpp.

Referenced by x_ComputeChunkRanges(), x_ComputeContextOffsets_NonTranslatedQueries(), x_ComputeContextOffsets_TranslatedQueries(), x_ComputeContextOffsetsForChunks(), x_ComputeQueryContextsForChunks(), and x_ComputeQueryIndicesForChunks().

vector< CRef<IQueryFactory> > CQuerySplitter::m_QueryChunkFactories [private]
 

Vector of query factories, each element corresponds to a chunk.

Definition at line 113 of file split_query.hpp.

Referenced by x_ComputeContextOffsets_NonTranslatedQueries(), and x_ComputeContextOffsets_TranslatedQueries().

CRef<IQueryFactory> CQuerySplitter::m_QueryFactory [private]
 

The original, unsplit query factory.

Definition at line 105 of file split_query.hpp.

Referenced by x_ExtractCScopesAndMasks().

TScopeVector CQuerySplitter::m_Scopes [private]
 

Vector of CScope objects.

Definition at line 121 of file split_query.hpp.

Referenced by x_ExtractCScopesAndMasks().

CRef<CSplitQueryBlk> CQuerySplitter::m_SplitBlk [private]
 

Split query block structure.

Definition at line 111 of file split_query.hpp.

Referenced by GetQueryFactoryForChunk(), Split(), x_ComputeChunkRanges(), x_ComputeContextOffsets_NonTranslatedQueries(), x_ComputeContextOffsets_TranslatedQueries(), and x_ComputeQueryContextsForChunks().

TSplitQueryVector CQuerySplitter::m_SplitQueriesInChunk [private]
 

Vector of split queries.

Definition at line 125 of file split_query.hpp.

Referenced by operator<<().

size_t CQuerySplitter::m_TotalQueryLength [private]
 

Length of the concatenated query.

Definition at line 117 of file split_query.hpp.

Referenced by x_ComputeChunkRanges().

TSeqLocInfoVector CQuerySplitter::m_UserSpecifiedMasks [private]
 

Vector of masking locations.

Definition at line 123 of file split_query.hpp.

Referenced by x_ExtractCScopesAndMasks().


The documentation for this class was generated from the following files:
Generated on Mon Dec 7 13:42:09 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:23:49 2009 by modify_doxy.py rev. 173732