NCBI C++ ToolKit
Classes | Typedefs | Functions
blastfilter_unit_test.cpp File Reference
#include <ncbi_pch.hpp>
#include <corelib/test_boost.hpp>
#include <corelib/ncbitime.hpp>
#include <objmgr/object_manager.hpp>
#include <objtools/simple/simple_om.hpp>
#include <objtools/data_loaders/genbank/gbloader.hpp>
#include <serial/iterator.hpp>
#include <util/random_gen.hpp>
#include <objmgr/util/sequence.hpp>
#include <algo/blast/api/blast_aux.hpp>
#include "blast_objmgr_priv.hpp"
#include <algo/blast/api/bl2seq.hpp>
#include <algo/blast/api/blast_options_handle.hpp>
#include <algo/blast/api/blast_nucl_options.hpp>
#include <algo/blast/core/blast_setup.h>
#include <algo/blast/api/repeats_filter.hpp>
#include <algo/blast/api/windowmask_filter.hpp>
#include "winmask_filter.hpp"
#include "dust_filter.hpp"
#include <objects/seqloc/Seq_interval.hpp>
#include <objects/seqloc/Packed_seqint.hpp>
#include "test_objmgr.hpp"
#include "blast_test_util.hpp"
+ Include dependency graph for blastfilter_unit_test.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

class  CBlastFilterTest
 

Typedefs

typedef vector< TSeqRangeTRangeVector
 

Functions

static BlastSeqLocs_RangeVector2BlastSeqLoc (const TRangeVector &rv)
 
static void x_TestGetSeqLocInfoVector (EBlastProgramType program, size_t num_seqs)
 
static bool x_AreAllBasesMasked (const Uint1 *sequence, int start, int stop)
 
static void x_TestGetFilteredQueryRegions (ENa_strand strand)
 
 BOOST_AUTO_TEST_CASE (TSeqLocVector2Packed_seqint_TestIntervals)
 
 BOOST_AUTO_TEST_CASE (TSeqLocVector2Packed_seqint_TestNoIntervals)
 
 BOOST_AUTO_TEST_CASE (TSeqLocVector2Packed_seqint_TestEmptyInput)
 
void setupQueryStructures (TSeqLocVector &query_vector, const CBlastOptions &kOpts, BLAST_SequenceBlk **query_blk, BlastQueryInfo **qinfo)
 
 BOOST_AUTO_TEST_CASE (SegFilter)
 
 BOOST_AUTO_TEST_CASE (RepeatsFilter)
 
 BOOST_AUTO_TEST_CASE (WindowMasker)
 
 BOOST_AUTO_TEST_CASE (RepeatsFilter_OnSeqInterval)
 
 BOOST_AUTO_TEST_CASE (CSeqLocInfo_EqualityOperators)
 
 BOOST_AUTO_TEST_CASE (CombineDustAndLowerCaseMasking_WithBlastQueryVector)
 
 BOOST_AUTO_TEST_CASE (RepeatsAndDustFilter)
 
 BOOST_AUTO_TEST_CASE (WindowMaskerAndDustFilter)
 
 BOOST_AUTO_TEST_CASE (WindowMasker_OnSeqInterval)
 
 BOOST_AUTO_TEST_CASE (RepeatsFilter_NoHitsFound)
 
 BOOST_AUTO_TEST_CASE (WindowMasker_NoHitsFound)
 
 BOOST_AUTO_TEST_CASE (RepeatsFilterWithMissingParameter)
 
 BOOST_AUTO_TEST_CASE (WindowMaskerWithMissingParameter)
 
 BOOST_AUTO_TEST_CASE (TestGetFilteredQueryRegions_BothStrandsOneQuery)
 Test the conversion of a BlastMaskLoc internal structure to the TSeqLocInfoVector type, used in formatting. More...
 
 BOOST_AUTO_TEST_CASE (TestGetFilteredQueryRegions_PlusStrandsOneQuery)
 
 BOOST_AUTO_TEST_CASE (TestGetFilteredQueryRegions_MinusStrandsOneQuery)
 
 BOOST_AUTO_TEST_CASE (RestrictLowerCaseMask)
 
 BOOST_AUTO_TEST_CASE (BlastxLowerCaseMask)
 
 BOOST_AUTO_TEST_CASE (BlastxLowerCaseMaskProteinLocations)
 
 BOOST_AUTO_TEST_CASE (BlastnLowerCaseMask_SingleStrand)
 
 BOOST_AUTO_TEST_CASE (BlastnLowerCaseMask_BothStrands)
 
 BOOST_AUTO_TEST_CASE (LowerCaseMask_PlusStrand)
 
 BOOST_AUTO_TEST_CASE (LowerCaseMask_MinusStrand)
 
 BOOST_AUTO_TEST_CASE (LowerCaseMask_BothStrands)
 
 BOOST_AUTO_TEST_CASE (LowerCaseMask_PlusStrand_Explicit)
 
 BOOST_AUTO_TEST_CASE (LowerCaseMask_MinusStrand_Explicit)
 
 BOOST_AUTO_TEST_CASE (LowerCaseMask_BothStrands_Explicit)
 
 BOOST_AUTO_TEST_CASE (CombineRepeatAndLowerCaseMask)
 
 BOOST_AUTO_TEST_CASE (CombineRepeatAndDustFilter)
 
 BOOST_AUTO_TEST_CASE (FilterLocNuclBoth)
 
 BOOST_AUTO_TEST_CASE (FilterLocNuclPlus)
 
 BOOST_AUTO_TEST_CASE (FilterLocNuclMinus)
 
 BOOST_AUTO_TEST_CASE (FilterLocProtein)
 
 BOOST_AUTO_TEST_CASE (MaskProteinSequence)
 
 BOOST_AUTO_TEST_CASE (MaskNucleotideBothStrands)
 
 BOOST_AUTO_TEST_CASE (FilterMultipleQueriesLocNuclPlus)
 
 BOOST_AUTO_TEST_CASE (MaskRestrictToInterval)
 
void setupQueryInfoForOffsetTranslation (CBlastQueryInfo &query_info)
 
 BOOST_AUTO_TEST_CASE (ConvertTranslatedFilterOffsets)
 
 BOOST_AUTO_TEST_CASE (FilterOptionsToStringFromNULL)
 
 BOOST_AUTO_TEST_CASE (FilterOptionsToStringFromMaskAtHashOnly)
 
 BOOST_AUTO_TEST_CASE (FilterOptionsToStringLargeData)
 
 BOOST_AUTO_TEST_CASE (FilterOptionsFromNULLString)
 
 BOOST_AUTO_TEST_CASE (FilterOptionsFromStringDustMaskAtHash)
 
 BOOST_AUTO_TEST_CASE (FilterOptionsFromStringDust)
 
 BOOST_AUTO_TEST_CASE (FilterOptionsFromStringSEGWithParams)
 
 BOOST_AUTO_TEST_CASE (FilterOptionsFromBadStringSEGWithParams)
 
 BOOST_AUTO_TEST_CASE (FilterOptionsFromStringBlastnL)
 
 BOOST_AUTO_TEST_CASE (FilterOptionsFromStringBlastpL)
 
 BOOST_AUTO_TEST_CASE (FilterOptionsFromStringBlastnW)
 
 BOOST_AUTO_TEST_CASE (FilterMerge)
 
 BOOST_AUTO_TEST_CASE (FilterStringFalse)
 
 BOOST_AUTO_TEST_CASE (MergeOptionHandle)
 
 BOOST_AUTO_TEST_CASE (OptionsHandleNotClear)
 
 BOOST_AUTO_TEST_CASE (OptionsHandleClear)
 
 BOOST_AUTO_TEST_CASE (GetSeqLocInfoVector_EmptyQueryIdVector)
 
 BOOST_AUTO_TEST_CASE (GetSeqLocInfoVector_EmptyMasks)
 
 BOOST_AUTO_TEST_CASE (BlastSeqLocCombineTest)
 
 BOOST_AUTO_TEST_CASE (GetSeqLocInfoVector_AllPrograms)
 
 BOOST_AUTO_TEST_CASE (TestBlastSeqLocCombine_MergeElems)
 
 BOOST_AUTO_TEST_CASE (TestBlastSeqLocCombine_MergeIdenticals)
 
 BOOST_AUTO_TEST_CASE (TestBlastSeqLocCombine_NoMerging)
 
void BlastSeqLocListReverse (BlastSeqLoc **head)
 Reverse elements in the list. More...
 
 BOOST_AUTO_TEST_CASE (TestBlastSeqLocListReverse)
 
 BOOST_AUTO_TEST_CASE (TestGetTaxIdWithWindowMaskerSupport)
 

Typedef Documentation

◆ TRangeVector

typedef vector<TSeqRange> TRangeVector

Definition at line 70 of file blastfilter_unit_test.cpp.

Function Documentation

◆ BlastSeqLocListReverse()

void BlastSeqLocListReverse ( BlastSeqLoc **  head)

Reverse elements in the list.

Parameters
headpointer to pointer to the head of the list. [in|out] (this is not declared static so that it can be tested in the unit tests

Definition at line 705 of file blast_filter.c.

References ASSERT, head, i, BlastSeqLoc::next, NULL, s_BlastSeqLocListToArrayOfPointers(), and sfree.

Referenced by BLAST_ComplementMaskLocations(), and BOOST_AUTO_TEST_CASE().

◆ BOOST_AUTO_TEST_CASE() [1/66]

BOOST_AUTO_TEST_CASE ( BlastnLowerCaseMask_BothStrands  )

◆ BOOST_AUTO_TEST_CASE() [2/66]

BOOST_AUTO_TEST_CASE ( BlastnLowerCaseMask_SingleStrand  )

◆ BOOST_AUTO_TEST_CASE() [3/66]

BOOST_AUTO_TEST_CASE ( BlastSeqLocCombineTest  )

◆ BOOST_AUTO_TEST_CASE() [4/66]

BOOST_AUTO_TEST_CASE ( BlastxLowerCaseMask  )

◆ BOOST_AUTO_TEST_CASE() [5/66]

BOOST_AUTO_TEST_CASE ( BlastxLowerCaseMaskProteinLocations  )

◆ BOOST_AUTO_TEST_CASE() [6/66]

BOOST_AUTO_TEST_CASE ( CombineDustAndLowerCaseMasking_WithBlastQueryVector  )

◆ BOOST_AUTO_TEST_CASE() [7/66]

BOOST_AUTO_TEST_CASE ( CombineRepeatAndDustFilter  )

◆ BOOST_AUTO_TEST_CASE() [8/66]

BOOST_AUTO_TEST_CASE ( CombineRepeatAndLowerCaseMask  )

◆ BOOST_AUTO_TEST_CASE() [9/66]

BOOST_AUTO_TEST_CASE ( ConvertTranslatedFilterOffsets  )

◆ BOOST_AUTO_TEST_CASE() [10/66]

BOOST_AUTO_TEST_CASE ( CSeqLocInfo_EqualityOperators  )

Definition at line 657 of file blastfilter_unit_test.cpp.

References a, b, CSeqLocInfo::eFramePlus1, and r().

◆ BOOST_AUTO_TEST_CASE() [11/66]

BOOST_AUTO_TEST_CASE ( FilterLocNuclBoth  )

◆ BOOST_AUTO_TEST_CASE() [12/66]

BOOST_AUTO_TEST_CASE ( FilterLocNuclMinus  )

◆ BOOST_AUTO_TEST_CASE() [13/66]

BOOST_AUTO_TEST_CASE ( FilterLocNuclPlus  )

◆ BOOST_AUTO_TEST_CASE() [14/66]

BOOST_AUTO_TEST_CASE ( FilterLocProtein  )

◆ BOOST_AUTO_TEST_CASE() [15/66]

BOOST_AUTO_TEST_CASE ( FilterMerge  )

◆ BOOST_AUTO_TEST_CASE() [16/66]

BOOST_AUTO_TEST_CASE ( FilterMultipleQueriesLocNuclPlus  )

◆ BOOST_AUTO_TEST_CASE() [17/66]

BOOST_AUTO_TEST_CASE ( FilterOptionsFromBadStringSEGWithParams  )

◆ BOOST_AUTO_TEST_CASE() [18/66]

BOOST_AUTO_TEST_CASE ( FilterOptionsFromNULLString  )

◆ BOOST_AUTO_TEST_CASE() [19/66]

BOOST_AUTO_TEST_CASE ( FilterOptionsFromStringBlastnL  )

◆ BOOST_AUTO_TEST_CASE() [20/66]

BOOST_AUTO_TEST_CASE ( FilterOptionsFromStringBlastnW  )

◆ BOOST_AUTO_TEST_CASE() [21/66]

BOOST_AUTO_TEST_CASE ( FilterOptionsFromStringBlastpL  )

◆ BOOST_AUTO_TEST_CASE() [22/66]

BOOST_AUTO_TEST_CASE ( FilterOptionsFromStringDust  )

◆ BOOST_AUTO_TEST_CASE() [23/66]

BOOST_AUTO_TEST_CASE ( FilterOptionsFromStringDustMaskAtHash  )

◆ BOOST_AUTO_TEST_CASE() [24/66]

BOOST_AUTO_TEST_CASE ( FilterOptionsFromStringSEGWithParams  )

◆ BOOST_AUTO_TEST_CASE() [25/66]

BOOST_AUTO_TEST_CASE ( FilterOptionsToStringFromMaskAtHashOnly  )

◆ BOOST_AUTO_TEST_CASE() [26/66]

BOOST_AUTO_TEST_CASE ( FilterOptionsToStringFromNULL  )

◆ BOOST_AUTO_TEST_CASE() [27/66]

BOOST_AUTO_TEST_CASE ( FilterOptionsToStringLargeData  )

◆ BOOST_AUTO_TEST_CASE() [28/66]

BOOST_AUTO_TEST_CASE ( FilterStringFalse  )

◆ BOOST_AUTO_TEST_CASE() [29/66]

BOOST_AUTO_TEST_CASE ( GetSeqLocInfoVector_AllPrograms  )

◆ BOOST_AUTO_TEST_CASE() [30/66]

BOOST_AUTO_TEST_CASE ( GetSeqLocInfoVector_EmptyMasks  )

◆ BOOST_AUTO_TEST_CASE() [31/66]

BOOST_AUTO_TEST_CASE ( GetSeqLocInfoVector_EmptyQueryIdVector  )

◆ BOOST_AUTO_TEST_CASE() [32/66]

BOOST_AUTO_TEST_CASE ( LowerCaseMask_BothStrands  )

◆ BOOST_AUTO_TEST_CASE() [33/66]

BOOST_AUTO_TEST_CASE ( LowerCaseMask_BothStrands_Explicit  )

◆ BOOST_AUTO_TEST_CASE() [34/66]

BOOST_AUTO_TEST_CASE ( LowerCaseMask_MinusStrand  )

◆ BOOST_AUTO_TEST_CASE() [35/66]

BOOST_AUTO_TEST_CASE ( LowerCaseMask_MinusStrand_Explicit  )

◆ BOOST_AUTO_TEST_CASE() [36/66]

BOOST_AUTO_TEST_CASE ( LowerCaseMask_PlusStrand  )

◆ BOOST_AUTO_TEST_CASE() [37/66]

BOOST_AUTO_TEST_CASE ( LowerCaseMask_PlusStrand_Explicit  )

◆ BOOST_AUTO_TEST_CASE() [38/66]

BOOST_AUTO_TEST_CASE ( MaskNucleotideBothStrands  )

◆ BOOST_AUTO_TEST_CASE() [39/66]

BOOST_AUTO_TEST_CASE ( MaskProteinSequence  )

◆ BOOST_AUTO_TEST_CASE() [40/66]

BOOST_AUTO_TEST_CASE ( MaskRestrictToInterval  )

◆ BOOST_AUTO_TEST_CASE() [41/66]

BOOST_AUTO_TEST_CASE ( MergeOptionHandle  )

◆ BOOST_AUTO_TEST_CASE() [42/66]

BOOST_AUTO_TEST_CASE ( OptionsHandleClear  )

◆ BOOST_AUTO_TEST_CASE() [43/66]

BOOST_AUTO_TEST_CASE ( OptionsHandleNotClear  )

◆ BOOST_AUTO_TEST_CASE() [44/66]

BOOST_AUTO_TEST_CASE ( RepeatsAndDustFilter  )

◆ BOOST_AUTO_TEST_CASE() [45/66]

BOOST_AUTO_TEST_CASE ( RepeatsFilter  )

◆ BOOST_AUTO_TEST_CASE() [46/66]

BOOST_AUTO_TEST_CASE ( RepeatsFilter_NoHitsFound  )

◆ BOOST_AUTO_TEST_CASE() [47/66]

BOOST_AUTO_TEST_CASE ( RepeatsFilter_OnSeqInterval  )

◆ BOOST_AUTO_TEST_CASE() [48/66]

BOOST_AUTO_TEST_CASE ( RepeatsFilterWithMissingParameter  )

◆ BOOST_AUTO_TEST_CASE() [49/66]

BOOST_AUTO_TEST_CASE ( RestrictLowerCaseMask  )

◆ BOOST_AUTO_TEST_CASE() [50/66]

BOOST_AUTO_TEST_CASE ( SegFilter  )

◆ BOOST_AUTO_TEST_CASE() [51/66]

BOOST_AUTO_TEST_CASE ( TestBlastSeqLocCombine_MergeElems  )

◆ BOOST_AUTO_TEST_CASE() [52/66]

BOOST_AUTO_TEST_CASE ( TestBlastSeqLocCombine_MergeIdenticals  )

◆ BOOST_AUTO_TEST_CASE() [53/66]

BOOST_AUTO_TEST_CASE ( TestBlastSeqLocCombine_NoMerging  )

◆ BOOST_AUTO_TEST_CASE() [54/66]

BOOST_AUTO_TEST_CASE ( TestBlastSeqLocListReverse  )

◆ BOOST_AUTO_TEST_CASE() [55/66]

BOOST_AUTO_TEST_CASE ( TestGetFilteredQueryRegions_BothStrandsOneQuery  )

Test the conversion of a BlastMaskLoc internal structure to the TSeqLocInfoVector type, used in formatting.

Definition at line 864 of file blastfilter_unit_test.cpp.

References eNa_strand_both, and x_TestGetFilteredQueryRegions().

◆ BOOST_AUTO_TEST_CASE() [56/66]

BOOST_AUTO_TEST_CASE ( TestGetFilteredQueryRegions_MinusStrandsOneQuery  )

Definition at line 870 of file blastfilter_unit_test.cpp.

References eNa_strand_minus, and x_TestGetFilteredQueryRegions().

◆ BOOST_AUTO_TEST_CASE() [57/66]

BOOST_AUTO_TEST_CASE ( TestGetFilteredQueryRegions_PlusStrandsOneQuery  )

Definition at line 867 of file blastfilter_unit_test.cpp.

References eNa_strand_plus, and x_TestGetFilteredQueryRegions().

◆ BOOST_AUTO_TEST_CASE() [58/66]

BOOST_AUTO_TEST_CASE ( TestGetTaxIdWithWindowMaskerSupport  )

◆ BOOST_AUTO_TEST_CASE() [59/66]

BOOST_AUTO_TEST_CASE ( TSeqLocVector2Packed_seqint_TestEmptyInput  )

◆ BOOST_AUTO_TEST_CASE() [60/66]

BOOST_AUTO_TEST_CASE ( TSeqLocVector2Packed_seqint_TestIntervals  )

◆ BOOST_AUTO_TEST_CASE() [61/66]

BOOST_AUTO_TEST_CASE ( TSeqLocVector2Packed_seqint_TestNoIntervals  )

◆ BOOST_AUTO_TEST_CASE() [62/66]

BOOST_AUTO_TEST_CASE ( WindowMasker  )

◆ BOOST_AUTO_TEST_CASE() [63/66]

BOOST_AUTO_TEST_CASE ( WindowMasker_NoHitsFound  )

◆ BOOST_AUTO_TEST_CASE() [64/66]

BOOST_AUTO_TEST_CASE ( WindowMasker_OnSeqInterval  )

◆ BOOST_AUTO_TEST_CASE() [65/66]

BOOST_AUTO_TEST_CASE ( WindowMaskerAndDustFilter  )

◆ BOOST_AUTO_TEST_CASE() [66/66]

BOOST_AUTO_TEST_CASE ( WindowMaskerWithMissingParameter  )

◆ s_RangeVector2BlastSeqLoc()

static BlastSeqLoc* s_RangeVector2BlastSeqLoc ( const TRangeVector rv)
static

Definition at line 73 of file blastfilter_unit_test.cpp.

References BlastSeqLocNew(), ITERATE, and NULL.

Referenced by BOOST_AUTO_TEST_CASE().

◆ setupQueryInfoForOffsetTranslation()

void setupQueryInfoForOffsetTranslation ( CBlastQueryInfo query_info)

◆ setupQueryStructures()

void setupQueryStructures ( TSeqLocVector query_vector,
const CBlastOptions kOpts,
BLAST_SequenceBlk **  query_blk,
BlastQueryInfo **  qinfo 
)

◆ x_AreAllBasesMasked()

static bool x_AreAllBasesMasked ( const Uint1 sequence,
int  start,
int  stop 
)
static

Definition at line 154 of file blastfilter_unit_test.cpp.

References i, and kNuclMask.

Referenced by CBlastFilterTest::x_TestLowerCaseMaskWith().

◆ x_TestGetFilteredQueryRegions()

static void x_TestGetFilteredQueryRegions ( ENa_strand  strand)
static

◆ x_TestGetSeqLocInfoVector()

static void x_TestGetSeqLocInfoVector ( EBlastProgramType  program,
size_t  num_seqs 
)
static
Modified on Sun Mar 03 03:10:46 2024 by modify_doxy.py rev. 669887