Loading...
Searching...
No Matches
seqan3::align_cfg::scoring_scheme< scoring_scheme_t > Class Template Reference
Sequence Alignment » Configuration

Sets the scoring scheme for the alignment algorithm. More...

`#include <seqan3/alignment/configuration/align_config_scoring_scheme.hpp>`

Inheritance diagram for seqan3::align_cfg::scoring_scheme< scoring_scheme_t >:
[legend]

## Public Member Functions

Constructors, destructor and assignment
constexpr | scoring_scheme ()=default
| Defaulted.
constexpr | scoring_scheme (scoring_scheme const &)=default
| Defaulted.
constexpr | scoring_scheme (scoring_scheme &&)=default
| Defaulted.
constexpr scoring_scheme & | operator= (scoring_scheme const &)=default
| Defaulted.
constexpr scoring_scheme & | operator= (scoring_scheme &&)=default
| Defaulted.
| ~scoring_scheme ()=default
| Defaulted.
constexpr | scoring_scheme (scoring_scheme_t scheme)
| Initialises the scoring scheme config with the given scheme.

## Public Attributes

scoring_scheme_t | scheme {}
| The scoring scheme to be used in the alignment algorithm.

## Related Symbols

(Note that these are not member symbols.)
Type deduction guides
template<typename scheme_t>
| scoring_scheme (scheme_t) -> scoring_scheme< std::remove_cvref_t< scheme_t > >
| Deduces the scoring scheme type from the constructor argument.

## Detailed Description

template<std::semiregular scoring_scheme_t>
class seqan3::align_cfg::scoring_scheme< scoring_scheme_t >

Sets the scoring scheme for the alignment algorithm.

Template Parameters

  scoring_scheme_t | The type of the scoring scheme; must model std::semiregular.

The scoring scheme allows to specify how two symbols of an alphabet are scored inside of the alignment algorithm. The scheme depends on the alphabet type of the passed sequences and must be chosen accordingly. During the configuration of the pairwise alignment algorithm a static assert is triggered if the scoring scheme is not compatible with the given alphabet types (see seqan3::scoring_scheme_for). Accordingly, there is no default for this configuration since it depends on the sequences and it must be given as a minimal configuration.

### 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 <seqan3/alignment/configuration/align_config_method.hpp>
#include <seqan3/alignment/configuration/align_config_scoring_scheme.hpp>
#include <seqan3/alignment/pairwise/align_pairwise.hpp>
#include <seqan3/alignment/scoring/nucleotide_scoring_scheme.hpp>
#include <seqan3/alphabet/nucleotide/dna4.hpp>
#include <seqan3/core/debug_stream.hpp>
using namespace seqan3::literals;
int main()
{
auto min_cfg = seqan3::align_cfg::method_global{}
| seqan3::align_cfg::scoring_scheme{
seqan3::nucleotide_scoring_scheme{seqan3::match_score{4}, seqan3::mismatch_score{-5}}};
auto seq1 = "ACGT"_dna4;
auto seq2 = "ACCT"_dna4;
for (auto res : align_pairwise(std::tie(seq1, seq2), min_cfg))
seqan3::debug_stream << res.score() << '\n';
}
align_config_method.hpp
Provides global and local alignment configurations.
align_config_scoring_scheme.hpp
Provides seqan3::align_cfg::scoring_scheme.
align_pairwise.hpp
Provides pairwise alignment function.
seqan3::align_cfg::method_global
Sets the global alignment method.
Definition align_config_method.hpp:119
seqan3::align_cfg::scoring_scheme
Sets the scoring scheme for the alignment algorithm.
Definition align_config_scoring_scheme.hpp:42
seqan3::nucleotide_scoring_scheme
A data structure for managing and computing the score of two nucleotides.
Definition nucleotide_scoring_scheme.hpp:35
debug_stream.hpp
Provides seqan3::debug_stream and related types.
dna4.hpp
Provides seqan3::dna4, container aliases and string literals.
seqan3::align_pairwise
constexpr auto align_pairwise(sequence_t &&seq, alignment_config_t const &config)
Computes the pairwise alignment for a pair of sequences or a range over sequence pairs.
Definition align_pairwise.hpp:130
seqan3::debug_stream
debug_stream_type debug_stream
A global instance of seqan3::debug_stream_type.
Definition debug_stream.hpp:38
seqan3::literals
The SeqAn namespace for literals.
nucleotide_scoring_scheme.hpp
Provides seqan3::nucleotide_scoring_scheme.
seqan3::match_score
A strong type of underlying type score_type that represents the score of two matching characters.
Definition scoring_scheme_base.hpp:38
seqan3::mismatch_score
A strong type of underlying type score_type that represents the score two different characters.
Definition scoring_scheme_base.hpp:63
std::tie
T tie(T... args)

## Constructor & Destructor Documentation

## scoring_scheme()

template<std::semiregular scoring_scheme_t>

seqan3::align_cfg::scoring_scheme< scoring_scheme_t >::scoring_scheme | ( | scoring_scheme_t | scheme | ) |

inline explicit constexpr

Initialises the scoring scheme config with the given scheme.

Parameters

  [in] | scheme | The scoring scheme to be used in the alignment algorithm.

This config stores a copy of the provided scheme.

The documentation for this class was generated from the following file:

- align_config_scoring_scheme.hpp

Hide me