NCBI C++ ToolKit
|
#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>
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< TGiLenPair > | TGiLengthVector |
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 vector<TGiLenPair> TGiLengthVector |
Vector containing pairs of gis and their length.
Definition at line 80 of file split_query_unit_test.cpp.
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.
typedef vector<vector<Uint4> > TSplitQueryChunkMap |
Definition at line 56 of file split_query_unit_test.cpp.
BOOST_AUTO_TEST_CASE | ( | CalculateNumberChunks | ) |
Definition at line 1901 of file split_query_unit_test.cpp.
References chunk_size, eBlastTypeBlastx, SplitQuery_CalculateNumChunks(), and SplitQuery_GetOverlapChunkSize().
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 | ( | InvalidChunkSizeTblastx | ) |
Definition at line 1933 of file split_query_unit_test.cpp.
References eTblastx, and SplitQuery_GetChunkSize().
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 | ( | 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 | ( | 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 | ( | 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 | ( | 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 | ( | 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 | ( | 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 | ( | QuerySplitter_BlastpMultiQueryMultiChunk | ) |
Tests blastp of multiple queries into multiple chunks.
Definition at line 1496 of file split_query_unit_test.cpp.
References BlastQueryInfoFree(), CBlastOptionsFactory::Create(), eBlastp, CQuerySplitter::GetChunkSize(), CQuerySplitter::GetNumberOfChunks(), CSplitQueryBlk::GetNumChunks(), CBlastOptions::GetProgramType(), ILocalQueryData::GetSumOfSequenceLengths(), NMacroArgs::kTestName, IQueryFactory::MakeLocalQueryData(), NON_CONST_ITERATE, s_ConvertToBlastQueries(), CBlastOptionsHandle::SetOptions(), and CQuerySplitter::Split().
BOOST_AUTO_TEST_CASE | ( | QuerySplitter_BlastpSingleQueryMultiChunk | ) |
Tests blastp of a single query into multiple chunks.
Definition at line 1438 of file split_query_unit_test.cpp.
References BlastQueryInfoFree(), CBlastOptionsFactory::Create(), CSeq_id_Base::e_Gi, eBlastp, CQuerySplitter::GetChunkSize(), CQuerySplitter::GetNumberOfChunks(), CSplitQueryBlk::GetNumChunks(), CBlastOptions::GetProgramType(), ILocalQueryData::GetSumOfSequenceLengths(), CTestObjMgr::Instance(), NMacroArgs::kTestName, IQueryFactory::MakeLocalQueryData(), NON_CONST_ITERATE, query, CBlastOptionsHandle::SetOptions(), and CQuerySplitter::Split().
BOOST_AUTO_TEST_CASE | ( | QuerySplitter_NoSplit | ) |
Tests the CQuerySplitter class when no splitting should occur.
Definition at line 1828 of file split_query_unit_test.cpp.
References CBlastOptionsFactory::Create(), CSeq_id_Base::e_Gi, eBlastn, CQuerySplitter::GetChunkSize(), CQuerySplitter::GetNumberOfChunks(), CSplitQueryBlk::GetNumChunks(), CSplitQueryBlk::GetNumQueriesForChunk(), CQuerySplitter::GetQueryFactoryForChunk(), CTestObjMgr::Instance(), CQuerySplitter::IsQuerySplit(), NMacroArgs::kTestName, query, CBlastOptionsHandle::SetOptions(), and CQuerySplitter::Split().
BOOST_AUTO_TEST_CASE | ( | QuerySplitter_ValidateQueryFactoriesBlastn | ) |
Tests the CQuerySplitter class for retrieval of IQueryFactory objects for given chunks.
Definition at line 1868 of file split_query_unit_test.cpp.
References CBlastOptionsFactory::Create(), eBlastn, CQuerySplitter::GetQueryFactoryForChunk(), CRef< C, Locker >::NotEmpty(), s_ConvertToBlastQueries(), and CBlastOptionsHandle::SetOptions().
BOOST_AUTO_TEST_CASE | ( | Split4QueriesIn3Chunks | ) |
Definition at line 1246 of file split_query_unit_test.cpp.
References CSplitQueryBlk::GetCStruct(), i, ITERATE, NULL, sfree, SplitQueryBlk_AddQueryToChunk(), SplitQueryBlk_GetNumQueriesForChunk(), SplitQueryBlk_GetQueryIndicesForChunk(), and UINT4_MAX.
BOOST_AUTO_TEST_CASE | ( | SplitQueriesIn1Chunk | ) |
Definition at line 1147 of file split_query_unit_test.cpp.
References CSplitQueryBlk::GetCStruct(), i, ITERATE, kBadParameter, NULL, sfree, SplitQueryBlk_AddContextToChunk(), SplitQueryBlk_AddQueryToChunk(), SplitQueryBlk_GetNumQueriesForChunk(), SplitQueryBlk_GetQueryContextsForChunk(), SplitQueryBlk_GetQueryIndicesForChunk(), and UINT4_MAX.
BOOST_AUTO_TEST_CASE | ( | SplitQueriesRandomly | ) |
Definition at line 1195 of file split_query_unit_test.cpp.
References CSplitQueryBlk::GetCStruct(), CRandom::GetRand(), i, ITERATE, NULL, sfree, SplitQueryBlk_AddQueryToChunk(), SplitQueryBlk_GetNumQueriesForChunk(), SplitQueryBlk_GetQueryIndicesForChunk(), and UINT4_MAX.
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 | ( | 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 | ( | 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 | ( | 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 | ( | 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 | ( | 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.
|
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().
|
static |
Convert a vector of GIs with its lengths into a TSeqLocVector.
gi_length | vector of TGiLenPair containing GIs and their length [in] |
retval | the return value of this function [out] |
tot_length | total length of sequence data contained in gi_length (optional) [in] |
strands | vector of strands to use (optional), if provided it must match the size of the gi_length vector [in] |
masks | vector 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().