SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
seqan3::align_cfg::gap_cost_affine Class Reference

A configuration element for the affine gap cost scheme. More...

#include <seqan3/alignment/configuration/align_config_gap_cost_affine.hpp>

+ Inheritance diagram for seqan3::align_cfg::gap_cost_affine:

Public Member Functions

Constructors, destructor and assignment
constexpr gap_cost_affine ()=default
 Defaulted.
 
constexpr gap_cost_affine (gap_cost_affine const &)=default
 Defaulted.
 
constexpr gap_cost_affine (gap_cost_affine &&)=default
 Defaulted.
 
constexpr gap_cost_affineoperator= (gap_cost_affine const &)=default
 Defaulted.
 
constexpr gap_cost_affineoperator= (gap_cost_affine &&)=default
 Defaulted.
 
 ~gap_cost_affine ()=default
 Defaulted.
 
constexpr gap_cost_affine (seqan3::align_cfg::open_score open_score, seqan3::align_cfg::extension_score extension_score)
 Construction from strongly typed open score and extension score. More...
 

Public Attributes

int32_t extension_score {-1}
 The cost per gap character. Defaults to -1.
 
int32_t open_score {0}
 The score per consecutive sequence of gaps. Defaults to 0.
 

Detailed Description

A configuration element for the affine gap cost scheme.

Configures the gap scheme for the alignment algorithm. The gap scheme determines how gaps are penalised inside of the alignment algorithm. If the gap scheme is not configured, it will default to a linear gap scheme initialised with edit distance. Note that the gap open score is used as an additional score. This means that the score for opening a gap during the affine alignment execution is the sum of the gap score and the gap open score.

Example

int main()
{
// Configuration with linear gap costs.
// Configuration with affine gap costs. Score for opening a gap during the alignment algorithm will be -11.
// Accessing the members of the gap scheme
int open = affine_cfg.open_score; // open == -1
int extension = affine_cfg.extension_score; // extension == -10
}

Constructor & Destructor Documentation

◆ gap_cost_affine()

constexpr seqan3::align_cfg::gap_cost_affine::gap_cost_affine ( seqan3::align_cfg::open_score  open_score,
seqan3::align_cfg::extension_score  extension_score 
)
inlineconstexpr

Construction from strongly typed open score and extension score.

Parameters
open_scoreThe cost per consecutive sequence of gaps (of type seqan3::open_score).
extension_scoreThe cost of each gap character (of type seqan3::extension_score).

The score for a sequence of n gap characters is computed as open_score + n * extension_score.

Attention
This is the formula used most commonly in the literature, but it is different from SeqAn2 where the formula was (n-1) * extension_score + open_score.

The documentation for this class was generated from the following file:
align_config_gap_cost_affine.hpp
Provides seqan3::align_config::gap_cost_affine.
seqan3::align_cfg::gap_cost_affine
A configuration element for the affine gap cost scheme.
Definition: align_config_gap_cost_affine.hpp:74
seqan3::align_cfg::open_score
A strong type of underlying type int32_t that represents a score (usually negative) that is incurred ...
Definition: align_config_gap_cost_affine.hpp:34
seqan3::align_cfg::extension_score
A strong type of underlying type int32_t that represents the score (usually negative) of any characte...
Definition: align_config_gap_cost_affine.hpp:52