Class BlastProgramSelector
A datatype that can act as either a BlastProgram or as an constexpr integral constant thereof.

Defined in <seqan/blast.h>
Signature template <BlastProgram p> struct BlastProgramSelector { ... };

Interface Function Overview

Detailed Description

This is a proxy datatype that enables compile-time optimizations through constexpressions iff the value is known at compile time. You will rarely need to instantiate objects of this type yourself, but they are used in the BlastIOContext.

The interface functions work on regular enum values of BlastProgram, as well, but are gathered here for convenience.

Please note that the default value for BlastProgramSelector<BlastProgram::DYNAMIC> is BlastProgram::UNKNOWN, not BlastProgram::DYNAMIC.

Example

mutable variable:

BlastProgramSelector<BlastProgram::DYNAMIC> myProgram = BlastProgram::BLASTN;
// same as:
// BlastProgram myProgram = BlastProgram::BLASTN;

SEQAN_ASSERT(myProgram == BlastProgram::BLASTN); // assertion is checked at run-time
myProgram = BlastProgram::BLASTP; // works without problems

compile time integral constant:

BlastProgramSelector<BlastProgram::BLASTN> myProgram;
static_assert(myProgram == BlastProgram::BLASTN, ""); // assertion is checked at compile time
myProgram = BlastProgram::BLASTP; // would fail, because value is fixed (and different)

Interface Functions Detail

constexpr bool qHasRevComp(BlastProgram const p);

Whether the reverse complement of the query sequence(s) is searched with the given BlastProgram

Returns

false for BLASTP and TBLASTN
true otherwise

Data Races

Thread safety unknown!

constexpr bool qIsTranslated(BlastProgram const p);

Whether the query sequence is translated in the given BlastProgram

Returns

true for BLASTX and TBLASTX
false otherwise

Data Races

Thread safety unknown!

constexpr uint8_t qNumFrames(BlastProgram const p);

The number of frames per query sequence implied by the given BlastProgram

Returns

6 for BLASTX and TBLASTX
2 for BLASTN
1 for BLASTP and TBLASTN

Data Races

Thread safety unknown!

constexpr bool sHasRevComp(BlastProgram const p);

Whether the reverse complement of the subject sequence(s) is searched with the given BlastProgram

Returns

true for TBLASTX and TBLASTN
false otherwise

Data Races

Thread safety unknown!

constexpr bool sIsTranslated(BlastProgram const p);

Whether the subject sequence is translated in the given BlastProgram

Returns

true for TBLASTX and TBLASTN
false otherwise

Data Races

Thread safety unknown!

constexpr uint8_t sNumFrames(BlastProgram const p);

The number of frames per query sequence implied by the given BlastProgram

Returns

6 for TBLASTX and TBLASTN
1 otherwise

Data Races

Thread safety unknown!