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

Configuration element for setting a fixed size band. More...

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

Inheritance diagram for seqan3::align_cfg::band_fixed_size:
[legend]

## Public Member Functions

Constructor, destructor and assignment
constexpr | band_fixed_size ()=default
| Defaulted.
constexpr | band_fixed_size (band_fixed_size const &)=default
| Defaulted.
constexpr | band_fixed_size (band_fixed_size &&)=default
| Defaulted.
constexpr band_fixed_size & | operator= (band_fixed_size const &)=default
| Defaulted.
constexpr band_fixed_size & | operator= (band_fixed_size &&)=default
| Defaulted.
| ~band_fixed_size ()=default
| Defaulted.
constexpr | band_fixed_size (seqan3::align_cfg::lower_diagonal const lower_diagonal, seqan3::align_cfg::upper_diagonal const upper_diagonal)
| Initialises the fixed size band by setting the lower and the upper matrix diagonal.

## Public Attributes

int32_t | lower_diagonal {std::numeric_limits<int32_t>::lowest()}
| The selected lower diagonal. Defaults to std::numeric_limits<int32_t>::lowest().
int32_t | upper_diagonal {std::numeric_limits<int32_t>::max()}
| The selected upper diagonal. Defaults to std::numeric_limits<int32_t>::max().

## Detailed Description

Configuration element for setting a fixed size band.

SeqAn offers the computation of banded alignments to reduce the running time of the algorithm. This can be helpful if the region in which the optimal alignment exists is known a priori. To specify the banded alignment the developer can use the seqan3::align_cfg::band_fixed_size option.
This band configuration is initialised with a seqan3::align_cfg::lower_diagonal and a seqan3::align_cfg::upper_diagonal. The term diagonal is used to describe the position of the band boundary within the alignment matrix. The given value represents the offset that the lower, respectively upper, diagonal is shifted from the main diagonal, which starts in the origin of the alignment matrix. Accordingly, a negative value shifts the band boundary downwards in the alignment matrix and a positive value shifts the band boundary to the right.
The band parameters might be restricted depending on the configured alignment algorithm, e.g. the origin of the alignment matrix and the sink (the last cell in the last column) must be covered by the band when a global alignment is ought to be computed.
In general, the upper diagonal must always be greater than or equal to the lower diagonal to specify a valid band.

### 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_band.hpp>
int main()
{
// A symmetric band around the main diagonal.
seqan3::align_cfg::band_fixed_size band_cfg{seqan3::align_cfg::lower_diagonal{-4},
seqan3::align_cfg::upper_diagonal{4}};
// A band starting with the main diagonal shifted by 3 cells to the right.
seqan3::align_cfg::band_fixed_size band_cfg_hi{seqan3::align_cfg::lower_diagonal{3},
seqan3::align_cfg::upper_diagonal{7}};
// A band starting with the main diagonal shifted by 3 cells down.
seqan3::align_cfg::band_fixed_size band_cfg_lo{seqan3::align_cfg::lower_diagonal{-7},
seqan3::align_cfg::upper_diagonal{-3}};
// An invalid band configuration.
// Using this band as a configuration in seqan3::align_pairwise would cause the algorithm to throw an exception.
seqan3::align_cfg::band_fixed_size band_cfg_invalid{seqan3::align_cfg::lower_diagonal{7},
seqan3::align_cfg::upper_diagonal{3}};
}
align_config_band.hpp
Provides seqan3::detail::align_config_band.
seqan3::align_cfg::band_fixed_size
Configuration element for setting a fixed size band.
Definition align_config_band.hpp:60
seqan3::align_cfg::lower_diagonal
A strong type representing the lower diagonal of the seqan3::align_cfg::band_fixed_size.
Definition align_config_band.hpp:28
seqan3::align_cfg::upper_diagonal
A strong type representing the upper diagonal of the seqan3::align_cfg::band_fixed_size.
Definition align_config_band.hpp:39

Remarks
  For a complete overview, take a look at Pairwise Alignments.

## Constructor & Destructor Documentation

## band_fixed_size()

seqan3::align_cfg::band_fixed_size::band_fixed_size | ( | seqan3::align_cfg::lower_diagonal const | lower_diagonal,
|  | seqan3::align_cfg::upper_diagonal const | upper_diagonal )

inline constexpr

Initialises the fixed size band by setting the lower and the upper matrix diagonal.

Parameters

  lower_diagonal | The selected lower diagonal. Defaults to std::numeric_limits<int32_t>::lowest().
  upper_diagonal | The selected upper diagonal. Defaults to std::numeric_limits<int32_t>::max().

The lower diagonal represents the lower bound of the banded matrix, i.e. the alignment cannot pass below this diagonal. Similar, the upper diagonal represents the upper bound of the alignment. During the alignment configuration and execution the band parameters will be checked and an exception will be thrown in case of an invalid configuration.

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

- align_config_band.hpp

Hide me