NCBI C++ ToolKit
Classes | Typedefs | Functions
split_query_unit_test.cpp File Reference
#include <ncbi_pch.hpp>
#include <corelib/test_boost.hpp>
#include "test_objmgr.hpp"
#include <blast_objmgr_priv.hpp>
#include <algo/blast/core/split_query.h>
#include "blast_aux_priv.hpp"
#include "split_query_aux_priv.hpp"
#include <algo/blast/api/blast_options_handle.hpp>
#include "split_query.hpp"
#include <algo/blast/api/objmgr_query_data.hpp>
#include <algo/blast/api/local_blast.hpp>
#include <util/random_gen.hpp>
#include <objtools/simple/simple_om.hpp>
+ Include dependency graph for split_query_unit_test.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

class  CSplitQueryTestFixture
 

Typedefs

typedef vector< vector< Uint4 > > TSplitQueryChunkMap
 
typedef pair< TIntId, size_t > TGiLenPair
 Pair for gis and their length (in that order) More...
 
typedef vector< TGiLenPairTGiLengthVector
 Vector containing pairs of gis and their length. More...
 

Functions

static void s_CalculateMaxLength (BlastQueryInfo *query_info)
 Calculate and assign the maximum length field in the BlastQueryInfo structure. More...
 
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. More...
 
 BOOST_AUTO_TEST_CASE (SplitQueriesIn1Chunk)
 
 BOOST_AUTO_TEST_CASE (SplitQueriesRandomly)
 
 BOOST_AUTO_TEST_CASE (Split4QueriesIn3Chunks)
 
 BOOST_AUTO_TEST_CASE (QuerySplitter_BlastnSingleQueryMultiChunk_BothStrands)
 Tests query splitting for blastn of both strands of a single query into multiple chunks. More...
 
 BOOST_AUTO_TEST_CASE (QuerySplitter_BlastnSingleQueryMultiChunk_PlusStrand)
 Tests query splitting for blastn of the plus strands of a single query into multiple chunks. More...
 
 BOOST_AUTO_TEST_CASE (QuerySplitter_BlastnSingleQueryMultiChunk_MinusStrand)
 Tests query splitting for blastn of the minus strands of a single query into multiple chunks. More...
 
 BOOST_AUTO_TEST_CASE (QuerySplitter_BlastnMultiQueryMultiChunk_PlusStrand)
 Tests query splitting for blastn of the plus strands of multiple queries into multiple chunks. More...
 
 BOOST_AUTO_TEST_CASE (QuerySplitter_BlastnMultiQueryMultiChunk_MinusStrand)
 Tests query splitting for blastn of the minus strands of multiple queries into multiple chunks. More...
 
 BOOST_AUTO_TEST_CASE (QuerySplitter_BlastnMultiQueryMultiChunk_BothStrands)
 Tests query splitting for blastn of both strands of multiple queries into multiple chunks. More...
 
 BOOST_AUTO_TEST_CASE (QuerySplitter_BlastnMultiQueryMultiChunk_MixedStrands)
 Tests query splitting for blastn with multiple queries in multiple chunks with each query using different strands. More...
 
 BOOST_AUTO_TEST_CASE (QuerySplitter_BlastpSingleQueryMultiChunk)
 Tests blastp of a single query into multiple chunks. More...
 
 BOOST_AUTO_TEST_CASE (QuerySplitter_BlastpMultiQueryMultiChunk)
 Tests blastp of multiple queries into multiple chunks. More...
 
 BOOST_AUTO_TEST_CASE (TestCContextTranslator_BlastnMultiQuery_BothStrands)
 Tests the CContextTranslator class for blastn of both strands of multiple queries. More...
 
 BOOST_AUTO_TEST_CASE (TestCContextTranslator_BlastnMultiQuery_PlusStrand)
 Tests the CContextTranslator class for blastn of the plus strand of multiple queries. More...
 
 BOOST_AUTO_TEST_CASE (TestCContextTranslator_BlastnMultiQuery_MinusStrand)
 Tests the CContextTranslator class for blastn of the minus strand of multiple queries. More...
 
 BOOST_AUTO_TEST_CASE (TestCContextTranslator_BlastxSingleQuery_BothStrands_0)
 Tests the CContextTranslator class for blastx of both strands of a single query with length divisible by CODON_LENGTH. More...
 
 BOOST_AUTO_TEST_CASE (TestCContextTranslator_BlastxSingleQuery_BothStrands_1)
 Tests the CContextTranslator class for blastx of both strands of a single query with length not divisible by CODON_LENGTH, instead, the (query length % CODON_LENGTH == 1) More...
 
 BOOST_AUTO_TEST_CASE (TestCContextTranslator_BlastxSingleQuery_BothStrands_2)
 Tests the CContextTranslator class for blastx of both strands of a single query with length not divisible by CODON_LENGTH, instead, the (query length % CODON_LENGTH == 2) More...
 
 BOOST_AUTO_TEST_CASE (QuerySplitter_NoSplit)
 Tests the CQuerySplitter class when no splitting should occur. More...
 
 BOOST_AUTO_TEST_CASE (QuerySplitter_ValidateQueryFactoriesBlastn)
 Tests the CQuerySplitter class for retrieval of IQueryFactory objects for given chunks. More...
 
 BOOST_AUTO_TEST_CASE (CalculateNumberChunks)
 
 BOOST_AUTO_TEST_CASE (InvalidChunkSizeBlastx)
 
 BOOST_AUTO_TEST_CASE (InvalidChunkSizeTblastx)
 

Typedef Documentation

◆ TGiLengthVector

typedef vector<TGiLenPair> TGiLengthVector

Vector containing pairs of gis and their length.

Definition at line 80 of file split_query_unit_test.cpp.

◆ TGiLenPair

typedef pair<TIntId, size_t> TGiLenPair

Pair for gis and their length (in that order)

Definition at line 78 of file split_query_unit_test.cpp.

◆ TSplitQueryChunkMap

typedef vector<vector<Uint4> > TSplitQueryChunkMap

Definition at line 56 of file split_query_unit_test.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/23]

BOOST_AUTO_TEST_CASE ( CalculateNumberChunks  )

◆ BOOST_AUTO_TEST_CASE() [2/23]

BOOST_AUTO_TEST_CASE ( InvalidChunkSizeBlastx  )

Definition at line 1927 of file split_query_unit_test.cpp.

References eBlastx, and SplitQuery_GetChunkSize().

◆ BOOST_AUTO_TEST_CASE() [3/23]

BOOST_AUTO_TEST_CASE ( InvalidChunkSizeTblastx  )

Definition at line 1933 of file split_query_unit_test.cpp.

References eTblastx, and SplitQuery_GetChunkSize().

◆ BOOST_AUTO_TEST_CASE() [4/23]

BOOST_AUTO_TEST_CASE ( QuerySplitter_BlastnMultiQueryMultiChunk_BothStrands  )

Tests query splitting for blastn of both strands of multiple queries into multiple chunks.

Definition at line 1343 of file split_query_unit_test.cpp.

References eNa_strand_both, and NMacroArgs::kTestName.

◆ BOOST_AUTO_TEST_CASE() [5/23]

BOOST_AUTO_TEST_CASE ( QuerySplitter_BlastnMultiQueryMultiChunk_MinusStrand  )

Tests query splitting for blastn of the minus strands of multiple queries into multiple chunks.

Definition at line 1333 of file split_query_unit_test.cpp.

References eNa_strand_minus, and NMacroArgs::kTestName.

◆ BOOST_AUTO_TEST_CASE() [6/23]

BOOST_AUTO_TEST_CASE ( QuerySplitter_BlastnMultiQueryMultiChunk_MixedStrands  )

Tests query splitting for blastn with multiple queries in multiple chunks with each query using different strands.

Definition at line 1352 of file split_query_unit_test.cpp.

References eNa_strand_both, eNa_strand_minus, eNa_strand_plus, eNa_strand_unknown, and NMacroArgs::kTestName.

◆ BOOST_AUTO_TEST_CASE() [7/23]

BOOST_AUTO_TEST_CASE ( QuerySplitter_BlastnMultiQueryMultiChunk_PlusStrand  )

Tests query splitting for blastn of the plus strands of multiple queries into multiple chunks.

Definition at line 1323 of file split_query_unit_test.cpp.

References eNa_strand_plus, and NMacroArgs::kTestName.

◆ BOOST_AUTO_TEST_CASE() [8/23]

BOOST_AUTO_TEST_CASE ( QuerySplitter_BlastnSingleQueryMultiChunk_BothStrands  )

Tests query splitting for blastn of both strands of a single query into multiple chunks.

Definition at line 1293 of file split_query_unit_test.cpp.

References eNa_strand_both, and NMacroArgs::kTestName.

◆ BOOST_AUTO_TEST_CASE() [9/23]

BOOST_AUTO_TEST_CASE ( QuerySplitter_BlastnSingleQueryMultiChunk_MinusStrand  )

Tests query splitting for blastn of the minus strands of a single query into multiple chunks.

Definition at line 1313 of file split_query_unit_test.cpp.

References eNa_strand_minus, and NMacroArgs::kTestName.

◆ BOOST_AUTO_TEST_CASE() [10/23]

BOOST_AUTO_TEST_CASE ( QuerySplitter_BlastnSingleQueryMultiChunk_PlusStrand  )

Tests query splitting for blastn of the plus strands of a single query into multiple chunks.

Definition at line 1303 of file split_query_unit_test.cpp.

References eNa_strand_plus, and NMacroArgs::kTestName.

◆ BOOST_AUTO_TEST_CASE() [11/23]

BOOST_AUTO_TEST_CASE ( QuerySplitter_BlastpMultiQueryMultiChunk  )

◆ BOOST_AUTO_TEST_CASE() [12/23]

BOOST_AUTO_TEST_CASE ( QuerySplitter_BlastpSingleQueryMultiChunk  )

◆ BOOST_AUTO_TEST_CASE() [13/23]

BOOST_AUTO_TEST_CASE ( QuerySplitter_NoSplit  )

◆ BOOST_AUTO_TEST_CASE() [14/23]

BOOST_AUTO_TEST_CASE ( QuerySplitter_ValidateQueryFactoriesBlastn  )

◆ BOOST_AUTO_TEST_CASE() [15/23]

BOOST_AUTO_TEST_CASE ( Split4QueriesIn3Chunks  )

◆ BOOST_AUTO_TEST_CASE() [16/23]

BOOST_AUTO_TEST_CASE ( SplitQueriesIn1Chunk  )

◆ BOOST_AUTO_TEST_CASE() [17/23]

BOOST_AUTO_TEST_CASE ( SplitQueriesRandomly  )

◆ BOOST_AUTO_TEST_CASE() [18/23]

BOOST_AUTO_TEST_CASE ( TestCContextTranslator_BlastnMultiQuery_BothStrands  )

Tests the CContextTranslator class for blastn of both strands of multiple queries.

Definition at line 1560 of file split_query_unit_test.cpp.

References chunk_size, eBlastn, eNa_strand_both, and NMacroArgs::kTestName.

◆ BOOST_AUTO_TEST_CASE() [19/23]

BOOST_AUTO_TEST_CASE ( TestCContextTranslator_BlastnMultiQuery_MinusStrand  )

Tests the CContextTranslator class for blastn of the minus strand of multiple queries.

Definition at line 1620 of file split_query_unit_test.cpp.

References chunk_size, eBlastn, eNa_strand_minus, and NMacroArgs::kTestName.

◆ BOOST_AUTO_TEST_CASE() [20/23]

BOOST_AUTO_TEST_CASE ( TestCContextTranslator_BlastnMultiQuery_PlusStrand  )

Tests the CContextTranslator class for blastn of the plus strand of multiple queries.

Definition at line 1590 of file split_query_unit_test.cpp.

References chunk_size, eBlastn, eNa_strand_plus, and NMacroArgs::kTestName.

◆ BOOST_AUTO_TEST_CASE() [21/23]

BOOST_AUTO_TEST_CASE ( TestCContextTranslator_BlastxSingleQuery_BothStrands_0  )

Tests the CContextTranslator class for blastx of both strands of a single query with length divisible by CODON_LENGTH.

Definition at line 1650 of file split_query_unit_test.cpp.

References chunk_size, eBlastx, eNa_strand_both, and NMacroArgs::kTestName.

◆ BOOST_AUTO_TEST_CASE() [22/23]

BOOST_AUTO_TEST_CASE ( TestCContextTranslator_BlastxSingleQuery_BothStrands_1  )

Tests the CContextTranslator class for blastx of both strands of a single query with length not divisible by CODON_LENGTH, instead, the (query length % CODON_LENGTH == 1)

Definition at line 1680 of file split_query_unit_test.cpp.

References chunk_size, eBlastx, eNa_strand_both, and NMacroArgs::kTestName.

◆ BOOST_AUTO_TEST_CASE() [23/23]

BOOST_AUTO_TEST_CASE ( TestCContextTranslator_BlastxSingleQuery_BothStrands_2  )

Tests the CContextTranslator class for blastx of both strands of a single query with length not divisible by CODON_LENGTH, instead, the (query length % CODON_LENGTH == 2)

Definition at line 1710 of file split_query_unit_test.cpp.

References chunk_size, eBlastx, eNa_strand_both, and NMacroArgs::kTestName.

◆ s_CalculateMaxLength()

static void s_CalculateMaxLength ( BlastQueryInfo query_info)
static

Calculate and assign the maximum length field in the BlastQueryInfo structure.

Definition at line 65 of file split_query_unit_test.cpp.

References BlastQueryInfo::contexts, BlastQueryInfo::first_context, i, BlastQueryInfo::max_length, and BlastContextInfo::query_length.

Referenced by CSplitQueryTestFixture::x_ReadSplitQueryInfoForTest().

◆ s_ConvertToBlastQueries()

static void s_ConvertToBlastQueries ( const TGiLengthVector gi_length,
TSeqLocVector retval,
size_t *  tot_length = NULL,
vector< ENa_strand > *  strands = NULL,
const TSeqLocInfoVector masks = NULL 
)
static

Convert a vector of GIs with its lengths into a TSeqLocVector.

Parameters
gi_lengthvector of TGiLenPair containing GIs and their length [in]
retvalthe return value of this function [out]
tot_lengthtotal length of sequence data contained in gi_length (optional) [in]
strandsvector of strands to use (optional), if provided it must match the size of the gi_length vector [in]
masksvector of masks (optional), if provided it must match the size of the gi_length vector [in]

Definition at line 92 of file split_query_unit_test.cpp.

References CSeq_id_Base::e_Gi, first(), GI_FROM, i, CSeq_loc_Base::IsInt(), CSeq_loc_Base::IsPacked_int(), ITERATE, mask, CSimpleOM::NewScope(), NULL, CSeq_loc::SetId(), CSeq_loc::SetInt(), CSeq_loc::SetPacked_int(), CSeq_loc::SetStrand(), and CSeq_loc::SetWhole().

Referenced by BOOST_AUTO_TEST_CASE(), CSplitQueryTestFixture::QuerySplitter_BlastnMultiQueryMultiChunk(), CSplitQueryTestFixture::QuerySplitter_BlastxMultiQueryMultiChunk(), and CSplitQueryTestFixture::x_TestCContextTranslator().

Modified on Wed Sep 04 15:05:33 2024 by modify_doxy.py rev. 669887