SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
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.
 

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.

See also
seqan3::align_cfg::method_global

Example

// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
#include <iostream>
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;
int extension = affine_cfg.extension_score;
std::cout << open << '\n'; // -1
std::cout << extension << '\n'; // -10
}
Provides seqan3::align_config::gap_cost_affine.
A configuration element for the affine gap cost scheme.
Definition align_config_gap_cost_affine.hpp:72
A strong type of underlying type int32_t that represents the score (usually negative) of any characte...
Definition align_config_gap_cost_affine.hpp:48
A strong type of underlying type int32_t that represents a score (usually negative) that is incurred ...
Definition align_config_gap_cost_affine.hpp:31

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:
Hide me