59 template <
class BC,
class T>
61 void (
BC::*mutator)(
T),
62 T (
BC::*accessor)(
void)
const,
65 # define CALL_MEMBER_FUNCTION(obj, membFnPtr) ((obj).*(membFnPtr))
69 BOOST_REQUIRE_EQUAL(expected_value, actual_value);
95 VerifyMutatorAccessor<CBlastOptionsHandle, bool>
105 VerifyMutatorAccessor<CBlastOptionsHandle, double>
115 VerifyMutatorAccessor<CBlastOptionsHandle, double>
125 VerifyMutatorAccessor<CBlastOptionsHandle, int>
135 VerifyMutatorAccessor<CBlastOptionsHandle, int>
143 double value = -10.5;
145 VerifyMutatorAccessor<CBlastOptionsHandle, double>
155 VerifyMutatorAccessor<CBlastOptionsHandle, int>
165 VerifyMutatorAccessor<CBlastOptionsHandle, double>
175 VerifyMutatorAccessor<CBlastOptionsHandle, bool>
185 VerifyMutatorAccessor<CBlastOptionsHandle, int>
199 BOOST_REQUIRE(opts !=
NULL);
208 BOOST_REQUIRE(opts !=
NULL);
218 BOOST_REQUIRE(opts !=
NULL);
227 BOOST_REQUIRE(opts !=
NULL);
237 BOOST_REQUIRE(opts !=
NULL);
247 BOOST_REQUIRE(opts ==
NULL);
255 BOOST_REQUIRE(opts !=
NULL);
265 BOOST_REQUIRE(opts !=
NULL);
301 BOOST_REQUIRE(opts !=
NULL);
311 BOOST_REQUIRE(opts !=
NULL);
321 BOOST_REQUIRE(opts !=
NULL);
331 BOOST_REQUIRE(opts !=
NULL);
341 BOOST_REQUIRE(opts !=
NULL);
364 VerifyMutatorAccessor<CBlastProteinOptionsHandle, double>
374 VerifyMutatorAccessor<CBlastProteinOptionsHandle, int>
384 VerifyMutatorAccessor<CBlastProteinOptionsHandle, int>
394 VerifyMutatorAccessor<CBlastProteinOptionsHandle, double>
404 VerifyMutatorAccessor<CBlastProteinOptionsHandle, double>
414 VerifyMutatorAccessor<CBlastProteinOptionsHandle, Int8>
422 unsigned int value = 0x1<<16;
424 VerifyMutatorAccessor<CBlastProteinOptionsHandle, unsigned int>
434 VerifyMutatorAccessor<CBlastProteinOptionsHandle, Int8>
444 VerifyMutatorAccessor<CBlastProteinOptionsHandle, bool>
454 VerifyMutatorAccessor<CBlastProteinOptionsHandle, int>
463 m_OptsHandle->SetSegFiltering(
false);
465 int value = m_OptsHandle->GetSegFilteringWindow();
466 BOOST_REQUIRE(
value < 0);
472 VerifyMutatorAccessor<CBlastProteinOptionsHandle, double>
481 m_OptsHandle->SetSegFiltering(
false);
483 double value = m_OptsHandle->GetSegFilteringLocut();
484 BOOST_REQUIRE(
value < 0);
490 VerifyMutatorAccessor<CBlastProteinOptionsHandle, double>
499 m_OptsHandle->SetSegFiltering(
false);
501 double value = m_OptsHandle->GetSegFilteringHicut();
502 BOOST_REQUIRE(
value < 0);
506 const char*
value =
"dummy matrix";
508 VerifyMutatorAccessor<CBlastProteinOptionsHandle, const char*>
518 VerifyMutatorAccessor<CBlastProteinOptionsHandle, int>
528 VerifyMutatorAccessor<CBlastProteinOptionsHandle, int>
551 VerifyMutatorAccessor<CPSIBlastOptionsHandle, double>
561 VerifyMutatorAccessor<CPSIBlastOptionsHandle, double>
571 VerifyMutatorAccessor<CPSIBlastOptionsHandle, bool>
581 VerifyMutatorAccessor<CPSIBlastOptionsHandle, int>
613 VerifyMutatorAccessor<CBlastAdvancedProteinOptionsHandle, bool>
635 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, ELookupTableType>
645 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, int>
654 m_OptsHandle->SetStrandOption(
value);
656 BOOST_REQUIRE_EQUAL((
int)
value, (
int)actual_value);
662 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, int>
672 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, double>
682 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, double>
691 const int kGapOpen = 7;
692 const int kGapExtend = 3;
694 m_OptsHandle->SetGapOpeningCost(kGapOpen);
695 m_OptsHandle->SetGapExtensionCost(kGapExtend);
697 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, EBlastPrelimGapExt>
703 BOOST_REQUIRE_EQUAL(kGapOpen, m_OptsHandle->GetGapOpeningCost());
704 BOOST_REQUIRE_EQUAL(kGapExtend, m_OptsHandle->GetGapExtensionCost());
707 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, EBlastPrelimGapExt>
713 BOOST_REQUIRE_EQUAL(kGapOpen, m_OptsHandle->GetGapOpeningCost());
714 BOOST_REQUIRE_EQUAL(kGapExtend, m_OptsHandle->GetGapExtensionCost());
720 const int kGapOpen = 7;
721 const int kGapExtend = 3;
723 m_OptsHandle->SetGapOpeningCost(kGapOpen);
724 m_OptsHandle->SetGapExtensionCost(kGapExtend);
726 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, EBlastTbackExt>
732 BOOST_REQUIRE_EQUAL(kGapOpen, m_OptsHandle->GetGapOpeningCost());
733 BOOST_REQUIRE_EQUAL(kGapExtend, m_OptsHandle->GetGapExtensionCost());
740 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, int>
750 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, int>
758 const char*
value =
"MYNAMATRIX";
760 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, const char*>
770 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, int>
780 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, int>
790 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, Int8>
800 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, bool>
810 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, int>
819 m_OptsHandle->SetDustFiltering(
false);
821 int value = m_OptsHandle->GetDustFilteringLevel();
822 BOOST_REQUIRE(
value < 0);
828 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, int>
837 m_OptsHandle->SetDustFiltering(
false);
839 int value = m_OptsHandle->GetDustFilteringWindow();
840 BOOST_REQUIRE(
value < 0);
846 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, int>
855 m_OptsHandle->SetDustFiltering(
false);
857 int value = m_OptsHandle->GetDustFilteringLinker();
858 BOOST_REQUIRE(
value < 0);
864 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, bool>
872 const char* db =
"my_repeat_db";
874 VerifyMutatorAccessor<CBlastNucleotideOptionsHandle, const char*>
894 unsigned char value = 18;
896 VerifyMutatorAccessor<CDiscNucleotideOptionsHandle, unsigned char>
904 unsigned char value = 1;
906 VerifyMutatorAccessor<CDiscNucleotideOptionsHandle, unsigned char>
916 VerifyMutatorAccessor<CDiscNucleotideOptionsHandle, int>
923 m_OptsHandle->SetWordSize(
value);
925 BOOST_REQUIRE(!
strcmp(
"Word size must be 11 or 12 only", exptn.
GetMsg().c_str()));
931 int value = m_OptsHandle->GetQueryCovHspPerc();
933 BOOST_REQUIRE(
value == 0);
934 m_OptsHandle->SetQueryCovHspPerc(52);
935 value = m_OptsHandle->GetQueryCovHspPerc();
936 BOOST_REQUIRE(
value == 52);
Declares the CBlastAdvancedProteinOptionsHandle class.
Definitions used throughout BLAST.
Declares the CBlastNucleotideOptionsHandle class.
EBlastPrelimGapExt
The algorithm to be used for preliminary gapped extensions.
@ eDynProgScoreOnly
standard affine gapping
@ eGreedyScoreOnly
Greedy extension (megaBlast)
#define BLAST_WORD_THRESHOLD_BLASTP_WD_SZ_6
#define BLAST_WORD_THRESHOLD_BLASTP_FAST
#define BLAST_WORD_THRESHOLD_BLASTP_WD_SZ_7
#define BLAST_WORD_THRESHOLD_BLASTP
neighboring word score thresholds; a threshold of zero means that only query and subject words that m...
EBlastTbackExt
The algorithm to be used for final gapped extensions with traceback.
@ eDynProgTbck
standard affine gapping
ELookupTableType
Types of the lookup table.
@ eNaLookupTable
blastn lookup table
@ eAaLookupTable
standard protein (blastp) lookup table
@ eCompressedAaLookupTable
compressed alphabet (blastp) lookup table
Declares the CBlastOptionsHandle and CBlastOptionsFactory classes.
Declares the CBlastProteinOptionsHandle class.
EProgram
This enumeration is to evolve into a task/program specific list that specifies sets of default parame...
@ eBlastProgramMax
Undefined program.
Declares the CBlastpKmerOptionsHandle class.
Declares the CBlastxOptionsHandle class.
Handle to the Advanced BLASTP options.
Defines BLAST error codes (user errors included)
Handle to the nucleotide-nucleotide options to the BLAST algorithm.
Handle to the options to the BLAST algorithm.
Encapsulates ALL the BLAST algorithm's options.
Handle to the protein-protein options to the BLAST algorithm.
Handle to the KMER BLASTP options.
Handle to the translated nucleotide-protein options to the BLAST algorithm.
Handle to the nucleotide-nucleotide options to the discontiguous BLAST algorithm.
Handle to the protein-protein options to the BLAST algorithm.
Handle to the protein-translated nucleotide options to the BLAST algorithm.
Handle to the translated nucleotide-translated nucleotide options to the BLAST algorithm.
ECompoAdjustModes
An collection of constants that specify all permissible modes of composition adjustment.
@ eNoCompositionBasedStats
Don't use composition based statistics.
Declares the CDiscNucleotideOptionsHandle class.
int GetDustFilteringLinker() const
Get linker parameter for dust.
void SetGapExtensionCost(int e)
Sets GapExtensionCost.
double GetXDropoff() const
Returns XDropoff.
void SetLookupTableType(ELookupTableType type)
Sets LookupTableType.
void SetEvalueThreshold(double eval)
Sets EvalueThreshold.
int GetGapExtensionCost() const
Returns GapExtensionCost.
Int8 GetEffectiveSearchSpace() const
Returns EffectiveSearchSpace.
EBlastPrelimGapExt GetGapExtnAlgorithm() const
Returns GapExtnAlgorithm.
void SetWordThreshold(double wt)
Sets WordThreshold.
void SetDustFilteringWindow(int window)
Set window parameter for dust.
double GetGapTrigger() const
Returns GapTrigger.
bool GetSegFiltering() const
Is SEG filtering enabled?
EBlastTbackExt GetGapTracebackAlgorithm() const
Returns GapTracebackAlgorithm.
bool GetDustFiltering() const
Is dust filtering enabled?
void SetDbLength(Int8 len)
Sets DbLength.
bool GetSmithWatermanMode() const
Returns this mode, specifying that smith waterman rather than the normal blast heuristic should be us...
void SetWordSize(int ws)
Sets WordSize.
int GetWordSize() const
Returns WordSize.
void SetMatchReward(int r)
Sets MatchReward.
unsigned char GetTemplateType() const
Returns TemplateType.
void SetDbSeqNum(unsigned int num)
Sets DbSeqNum.
void SetGapTrigger(double g)
Sets GapTrigger.
int GetCandidateSeqs() const
Gets the max number of candidate matches to process with BLAST.
void SetSmithWatermanMode(bool m=false)
Sets this mode, specifying that smith waterman rather than the normal blast heuristic should be used ...
double GetInclusionThreshold() const
Returns InclusionThreshold.
double GetGapXDropoffFinal() const
Returns GapXDropoffFinal.
Int8 GetDbLength() const
Returns DbLength.
int GetMatchReward() const
Returns MatchReward.
void SetGapExtnAlgorithm(EBlastPrelimGapExt algo)
Sets GapExtnAlgorithm.
void SetDustFilteringLinker(int linker)
Set linker parameter for dust.
int GetSegFilteringWindow() const
Get window parameter for seg.
int GetMinHits() const
Returns the number of hits to initiate calculation of Jaccard distance.
void SetEffectiveSearchSpace(Int8 eff)
Sets EffectiveSearchSpace.
void SetGapOpeningCost(int g)
Sets GapOpeningCost.
const char * GetMatrixName() const
Returns MatrixName.
void SetCompositionBasedStats(ECompoAdjustModes mode)
Sets this mode, which mostly specifies whether composition of db sequence is taken into account when ...
double GetXDropoff() const
Returns XDropoff.
unsigned int GetDbSeqNum() const
Returns DbSeqNum.
static CBlastOptionsHandle * Create(EProgram program, EAPILocality locality=CBlastOptions::eLocal)
Creates an options handle object configured with default options for the requested program,...
int GetDustFilteringLevel() const
Get level parameter for dust.
void SetGapTracebackAlgorithm(EBlastTbackExt algo)
Sets GapTracebackAlgorithm.
double GetWordThreshold() const
Returns WordThreshold.
bool GetGappedMode() const
Returns GappedMode.
double GetSegFilteringHicut() const
Get hicut parameter for seg.
void SetMismatchPenalty(int p)
Sets MismatchPenalty.
double GetPercentIdentity() const
Returns PercentIdentity.
void SetMatrixName(const char *matrix)
Sets MatrixName.
void SetRepeatFilteringDB(const char *db)
Enable repeat filtering.
void SetHitlistSize(int s)
Sets HitlistSize.
const char * GetMatrixName() const
Returns MatrixName.
int GetGapExtensionCost() const
Returns GapExtensionCost.
int GetWordSize() const
Returns WordSize.
ECompoAdjustModes GetCompositionBasedStats() const
Returns this mode, which mostly specifies whether composition of db sequence is taken into account wh...
const CBlastOptions & GetOptions() const
Return the object which this object is a handle for.
void SetXDropoff(double x)
Sets XDropoff.
void SetWindowSize(int ws)
Sets WindowSize.
int GetMaxNumHspPerSequence() const
Returns MaxNumHspPerSequence.
bool GetMaskAtHash() const
Returns whether masking should only be done for lookup table creation.
void SetMatrixName(const char *matrix)
Sets MatrixName.
void SetRepeatFiltering(bool val)
Enable repeat filtering.
bool GetRepeatFiltering() const
Is repeat filtering enabled?
double GetWordThreshold() const
Returns WordThreshold.
void SetWordSize(int ws)
Sets WordSize.
void SetTemplateType(unsigned char type)
Sets TemplateType.
void SetGapXDropoffFinal(double x)
Sets GapXDropoffFinal.
int GetCutoffScore() const
Returns CutoffScore.
int GetDustFilteringWindow() const
Get window parameter for dust.
void SetXDropoff(double x)
Sets XDropoff.
void SetCullingLimit(int s)
Sets Culling limit.
void SetGapExtensionCost(int e)
Sets GapExtensionCost.
int GetGapOpeningCost() const
Returns GapOpeningCost.
void SetGapXDropoff(double x)
Sets GapXDropoff.
void SetMaskAtHash(bool m=true)
Sets MaskAtHash.
double GetGapXDropoff() const
Returns GapXDropoff.
const char * GetRepeatFilteringDB() const
Get the repeat filtering database.
ELookupTableType GetLookupTableType() const
Returns LookupTableType.
unsigned char GetTemplateLength() const
Returns TemplateLength.
void SetWordSize(int ws)
Sets WordSize.
ELookupTableType GetLookupTableType() const
int GetGapOpeningCost() const
Returns GapOpeningCost.
void SetSegFilteringWindow(int window)
Set window parameter for seg.
void SetDustFiltering(bool val)
Enable dust filtering.
int GetWindowSize() const
Returns WindowSize.
int GetMismatchPenalty() const
Returns MismatchPenalty.
int GetHitlistSize() const
Returns HitlistSize.
void SetMaxNumHspPerSequence(int m)
Sets MaxNumHspPerSequence.
void SetGappedMode(bool m=true)
Sets GappedMode.
void SetSegFiltering(bool val)
Enable SEG filtering.
void SetTemplateLength(unsigned char length)
Sets TemplateLength.
void SetPercentIdentity(double p)
Sets PercentIdentity.
double GetSegFilteringLocut() const
Get locut parameter for seg.
void SetCutoffScore(int s)
Sets CutoffScore.
void SetDustFilteringLevel(int level)
Set level parameter for dust.
const char * GetMatrixName() const
void SetGapOpeningCost(int g)
Sets GapOpeningCost.
void SetSegFilteringLocut(double locut)
Set locut parameter for seg.
void SetInclusionThreshold(double incthr)
Sets InclusionThreshold.
static CBlastOptionsHandle * CreateTask(string task, EAPILocality locality=CBlastOptions::eLocal)
Creates an options handle object configured with default options for the requested task,...
void SetSegFilteringHicut(double hicut)
Set hicut parameter for seg.
double GetEvalueThreshold() const
Returns EvalueThreshold.
int GetCullingLimit() const
Returns Culling limit.
const string & GetMsg(void) const
Get message string.
int64_t Int8
8-byte (64-bit) signed integer
ENa_strand
strand of nucleic acid
unsigned int
A callback function used to compare two keys in a database.
Magic spell ;-) needed for some weird compilers... very empiric.
int strcmp(const char *str1, const char *str2)
void VerifyMutatorAccessor(BC &obj, void(BC::*mutator)(T), T(BC::*accessor)(void) const, T &expected_value)
BOOST_FIXTURE_TEST_CASE(Set_Get_MaskAtHash_Universal, UniversalOptiosHandleFixture)
#define CALL_MEMBER_FUNCTION(obj, membFnPtr)
BOOST_AUTO_TEST_CASE(BlastnTest)
Declares the CPSIBlastOptionsHandle class.
~AdvancedProteinOptionsHandleFixture()
AdvancedProteinOptionsHandleFixture()
CBlastAdvancedProteinOptionsHandle * m_OptsHandle
BlastNuclOptionsHandleFixture()
~BlastNuclOptionsHandleFixture()
CBlastNucleotideOptionsHandle * m_OptsHandle
DiscNucleotideOptionsHandleFixture()
CDiscNucleotideOptionsHandle * m_OptsHandle
~DiscNucleotideOptionsHandleFixture()
PSIBlastOptiosHandleFixture()
CPSIBlastOptionsHandle * m_OptsHandle
~PSIBlastOptiosHandleFixture()
ProteinOptiosHandleFixture()
~ProteinOptiosHandleFixture()
CBlastProteinOptionsHandle * m_OptsHandle
UniversalOptiosHandleFixture()
CBlastOptionsHandle * m_OptsHandle
~UniversalOptiosHandleFixture()
Declares the CTBlastnOptionsHandle class.
Declares the CTBlastxOptionsHandle class.
Utility stuff for more convenient using of Boost.Test library.