Loading...
Searching...
No Matches
seqan3::align_cfg::gap_cost_affine Class Reference
Sequence Alignment » Configuration

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:
[legend]

## 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_affine & | operator= (gap_cost_affine const &)=default
| Defaulted.
constexpr gap_cost_affine & | operator= (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-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
#include <iostream>
#include <seqan3/alignment/configuration/align_config_gap_cost_affine.hpp>
int main()
{
// Configuration with linear gap costs.
seqan3::align_cfg::gap_cost_affine linear_cfg{seqan3::align_cfg::open_score{0},
seqan3::align_cfg::extension_score{-1}};
// Configuration with affine gap costs. Score for opening a gap during the alignment algorithm will be -11.
seqan3::align_cfg::gap_cost_affine affine_cfg{seqan3::align_cfg::open_score{-1},
seqan3::align_cfg::extension_score{-10}};
// 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
}
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:72
seqan3::align_cfg::gap_cost_affine::open_score
int32_t open_score
The score per consecutive sequence of gaps. Defaults to 0.
Definition align_config_gap_cost_affine.hpp:75
seqan3::align_cfg::gap_cost_affine::extension_score
int32_t extension_score
The cost per gap character. Defaults to -1.
Definition align_config_gap_cost_affine.hpp:77
std::cout
iostream
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:48
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:31

## Constructor & Destructor Documentation

## gap_cost_affine()

seqan3::align_cfg::gap_cost_affine::gap_cost_affine | ( | seqan3::align_cfg::open_score | open_score,
|  | seqan3::align_cfg::extension_score | extension_score )

inline constexpr

Construction from strongly typed open score and extension score.

Parameters

  open_score | The cost per consecutive sequence of gaps (of type seqan3::open_score).
  extension_score | The 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

Hide me