SeqAn3  3.0.0
The Modern C++ library for sequence analysis.
Configuration

Provides configuration elements for the pairwise alignment configuration. More...

+ Collaboration diagram for Configuration:

Classes

struct  seqan3::align_cfg::aligned_ends< end_gaps_t >
 The configuration for aligned sequence ends. More...
 
struct  seqan3::back_end_first< value_t >
 The penalty configuration for aligning the back of the first sequence with a gap. More...
 
struct  seqan3::back_end_second< value_t >
 The penalty configuration for aligning the back of the second sequence with a gap. More...
 
struct  seqan3::align_cfg::band< band_t >
 Configuration element for setting the band. More...
 
class  seqan3::end_gaps< ends_t >
 Wraps the sequence end-gap specifiers and provides ordered access to the respective values. More...
 
struct  seqan3::front_end_first< value_t >
 The penalty configuration for aligning the front of the first sequence with a gap. More...
 
struct  seqan3::front_end_second< value_t >
 The penalty configuration for aligning the front of the second sequence with a gap. More...
 
struct  seqan3::align_cfg::gap< gap_scheme_t >
 A configuration element for the gap scheme. More...
 
struct  seqan3::align_cfg::max_error
 Sets the maximal errors allowed during an edit distance computation. More...
 
struct  seqan3::align_cfg::mode< mode_type >
 Sets the alignment mode. More...
 
class  seqan3::align_cfg::result< with_type >
 Sets the result of the alignment computation. More...
 
struct  seqan3::sequence_end_gap_specifier_base< value_t, _is_static, _value >
 A mixin class which can maintain a static or a dynamic bool state. More...
 

Variables

constexpr configuration seqan3::align_cfg::edit
 Shortcut for edit distance configuration. More...
 
constexpr detail::global_alignment_type seqan3::global_alignment
 Helper variable to select the global alignment. More...
 
constexpr detail::local_alignment_type seqan3::local_alignment
 Helper variable to select the local alignment. More...
 

Detailed Description

Provides configuration elements for the pairwise alignment configuration.

See also
Alignment

Variable Documentation

◆ edit

constexpr configuration seqan3::align_cfg::edit
inline
Initial value:
nucleotide_scoring_scheme() -> nucleotide_scoring_scheme< int8_t >
Default constructed objects deduce to int8_t.
constexpr detail::global_alignment_type global_alignment
Helper variable to select the global alignment.
Definition: align_config_mode.hpp:54
gap(scheme_t) -> gap< scheme_t >
Deduces the gap scheme from the constructor argument.
gap_score(score_type &&) -> gap_score< score_type >
Deduce the score type from the given argument.
mode(mode_type) -> mode< mode_type >
Deduces the alignment mode from the given constructor argument.
scoring(scheme_t) -> scoring< remove_cvref_t< scheme_t >>
Deduces the scoring scheme type from the constructor argument.
gap_scheme() -> gap_scheme< int8_t >
Default constructed objects deduce to int8_t.

Shortcut for edit distance configuration.

The edit distance computation is a specific sub-problem of the alignment computation with the aim to count the number of edits to transform one sequence into another. An edit operation can be a substitution, an insertion, or a deletion. Accordingly, this algorithm uses a predefined scoring scheme as well as a gap scheme, where the score for a match is 0, for a mismatch -1, for a gap -1, and for a gap open 0.

Performance

Under the hood SeqAn uses a fast bit-vector algorithm to compute the edit distance whenever possible. This depends on the final alignment configuration. Currently, the fast edit distance algorithm is only triggered for global alignments and semi-global alignments with free ends in the first sequence.

using namespace seqan3;
// Computes semi global edit distance using fast-bit vector algorithm.
auto cfg_fast = align_cfg::edit | align_cfg::aligned_ends{free_ends_first};
// Computes semi global edit distance using slower standard pairwise algorithm.
auto cfg_slow = align_cfg::edit | align_cfg::aligned_ends{free_ends_second};

The performance of the algorithm can further be improved if the number of maximal errors (edits) is known by using the align_cfg::max_error configuration.

using namespace seqan3;
// Computes global edit distance allowing maximal 3 errors.
Attention
If the edit distance configuration is combined with any other configuration element or setting, the algorithm falls back to the slower standard pairwise algorithm. For example the cfg_slow in the above example will trigger the slower algorithm which can handle the case if the ends are free in the second sequence instead of the first sequence.

◆ global_alignment

constexpr detail::global_alignment_type seqan3::global_alignment
inline

Helper variable to select the global alignment.

Example

using namespace seqan3;
// Select the global mode.

◆ local_alignment

constexpr detail::local_alignment_type seqan3::local_alignment
inline

Helper variable to select the local alignment.

Example

// Select the local mode.
align_cfg::mode cfg_local{local_alignment};