SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::alignment_result< alignment_result_value_t > Class Template Reference

Stores the alignment results and gives access to score, alignment and the front and end positions. More...

#include <seqan3/alignment/pairwise/alignment_result.hpp>

Public Member Functions

constexpr auto const & score_matrix () const noexcept
 Returns the score matrix used to compute the alignment.
 
constexpr auto const & trace_matrix () const noexcept
 Returns the trace matrix used to compute the alignment.
 
Access functions

Functions to access elements of the alignment result type.

constexpr sequence1_id_t sequence1_id () const noexcept
 Returns the alignment identifier of the first sequence.
 
constexpr sequence2_id_t sequence2_id () const noexcept
 Returns the alignment identifier of the second sequence.
 
constexpr score_t score () const noexcept
 Returns the alignment score.
 
constexpr auto sequence1_end_position () const noexcept
 Returns the end position of the first sequence of the alignment.
 
constexpr auto sequence2_end_position () const noexcept
 Returns the end position of the second sequence of the alignment.
 
constexpr auto sequence1_begin_position () const noexcept
 Returns the begin position of the first sequence of the alignment.
 
constexpr auto sequence2_begin_position () const noexcept
 Returns the begin position of the second sequence of the alignment.
 
constexpr alignment_t const & alignment () const noexcept
 Returns the actual alignment, i.e. the base pair matching.
 

Private Types

Member types

Local definition of the types contained in the data object.

using sequence1_id_t = decltype(data.sequence1_id)
 The type for the alignment identifier for the first sequence.
 
using sequence2_id_t = decltype(data.sequence2_id)
 The type for the alignment identifier for the second sequence.
 
using score_t = decltype(data.score)
 The type for the resulting score.
 
using end_positions_t = decltype(data.end_positions)
 The type for the end positions.
 
using begin_positions_t = decltype(data.begin_positions)
 The type for the begin positions.
 
using alignment_t = decltype(data.alignment)
 The type for the alignment.
 

Private Attributes

alignment_result_value_t data {}
 Object that stores the computed alignment results.
 

Friends

template<typename configuration_t >
class detail::policy_alignment_result_builder
 Befriend alignment result builder.
 

Constructors, destructor and assignment

 alignment_result (alignment_result_value_t value)
 Constructs a seqan3::alignment_result from an value_type object.
 
 alignment_result ()=default
 
 alignment_result (alignment_result const &)=default
 Defaulted.
 
 alignment_result (alignment_result &&)=default
 Defaulted.
 
alignment_resultoperator= (alignment_result const &)=default
 Defaulted.
 
alignment_resultoperator= (alignment_result &&)=default
 Defaulted.
 
 ~alignment_result ()=default
 Defaulted.
 

Detailed Description

template<typename alignment_result_value_t>
requires detail::is_type_specialisation_of_v<alignment_result_value_t, detail::alignment_result_value_type>
class seqan3::alignment_result< alignment_result_value_t >

Stores the alignment results and gives access to score, alignment and the front and end positions.

Template Parameters
alignment_result_value_tThe underlying value type containing the information from the alignment computation.

This class provides read-only access to the results of a pairwise alignment computation. It always contains an alignment identifier and the resulting score. Optionally – if the user requests – also the begin and end positions within the sequences and the alignment can be calculated. When accessing a field that has not been calculated, an assertion will fail during compilation.

Remarks
The template type argument is set internally by a result factory and depends on the configuration of the alignment result. For the general use of this class the concrete type information is not relevant and it suffices to know that this is a template class with one template type argument.

To access the type of the passed alignment result value use the seqan3::detail::alignment_result_value_type_accessor transformation trait. The seqan3::detail::policy_alignment_result_builder is used to set the respective values. This class is befriended with this class to allow access to the private data member.

Constructor & Destructor Documentation

◆ alignment_result() [1/2]

template<typename alignment_result_value_t >
seqan3::alignment_result< alignment_result_value_t >::alignment_result ( alignment_result_value_t  value)
inlineprivate

Constructs a seqan3::alignment_result from an value_type object.

Parameters
[in]valueThe alignment results.

◆ alignment_result() [2/2]

template<typename alignment_result_value_t >
seqan3::alignment_result< alignment_result_value_t >::alignment_result ( )
default

Defaulted.

Member Function Documentation

◆ alignment()

template<typename alignment_result_value_t >
constexpr alignment_t const & seqan3::alignment_result< alignment_result_value_t >::alignment ( ) const
inlineconstexprnoexcept

Returns the actual alignment, i.e. the base pair matching.

Returns
At least two aligned sequences, which represent the alignment.
Note
This function is only available if the alignment was requested via the alignment configuration (see seqan3::align_cfg::output_alignment).

◆ score()

template<typename alignment_result_value_t >
constexpr score_t seqan3::alignment_result< alignment_result_value_t >::score ( ) const
inlineconstexprnoexcept

Returns the alignment score.

Returns
The score field.

◆ score_matrix()

template<typename alignment_result_value_t >
constexpr auto const & seqan3::alignment_result< alignment_result_value_t >::score_matrix ( ) const
inlineconstexprnoexcept

Returns the score matrix used to compute the alignment.

Returns
The score matrix.

This function is only used for debugging such that performance can be affected significantly when enabling seqan3::align_cfg::detail::debug.

Note
This function is only available if the debug mode was requested via the alignment configuration (see seqan3::align_cfg::detail::debug).

◆ sequence1_begin_position()

template<typename alignment_result_value_t >
constexpr auto seqan3::alignment_result< alignment_result_value_t >::sequence1_begin_position ( ) const
inlineconstexprnoexcept

Returns the begin position of the first sequence of the alignment.

Returns
The calculated alignment begin of sequence 1 (inclusive).

The return type (default: size_t) is deduced from seqan3::detail::alignment_result_value_type::begin_positions_t::first.

Guaranteed to be smaller than or equal to sequence1_end_position().

Note
This function is only available if the begin position of the first sequence was requested via the alignment configuration (see seqan3::align_cfg::output_begin_position).

◆ sequence1_end_position()

template<typename alignment_result_value_t >
constexpr auto seqan3::alignment_result< alignment_result_value_t >::sequence1_end_position ( ) const
inlineconstexprnoexcept

Returns the end position of the first sequence of the alignment.

Returns
The calculated alignment end of sequence 1 (exclusive).

The return type (default: size_t) is deduced from seqan3::detail::alignment_result_value_type::end_positions_t::first.

Note
This function is only available if the end position of the first sequence was requested via the alignment configuration (see seqan3::align_cfg::output_end_position).

◆ sequence1_id()

template<typename alignment_result_value_t >
constexpr sequence1_id_t seqan3::alignment_result< alignment_result_value_t >::sequence1_id ( ) const
inlineconstexprnoexcept

Returns the alignment identifier of the first sequence.

Returns
The id of the first sequence.

◆ sequence2_begin_position()

template<typename alignment_result_value_t >
constexpr auto seqan3::alignment_result< alignment_result_value_t >::sequence2_begin_position ( ) const
inlineconstexprnoexcept

Returns the begin position of the second sequence of the alignment.

Returns
The calculated alignment begin of sequence 2 (inclusive).

The return type (default: size_t) is deduced from seqan3::detail::alignment_result_value_type::begin_positions_t::second.

Guaranteed to be smaller than or equal to sequence2_end_position().

Note
This function is only available if the begin position of the second sequence was requested via the alignment configuration (see seqan3::align_cfg::output_begin_position).

◆ sequence2_end_position()

template<typename alignment_result_value_t >
constexpr auto seqan3::alignment_result< alignment_result_value_t >::sequence2_end_position ( ) const
inlineconstexprnoexcept

Returns the end position of the second sequence of the alignment.

Returns
The calculated alignment end of sequence 2 (exclusive).

The return type (default: size_t) is deduced from seqan3::detail::alignment_result_value_type::end_positions_t::second.

Note
This function is only available if the end position of the second sequence was requested via the alignment configuration (see seqan3::align_cfg::output_end_position).

◆ sequence2_id()

template<typename alignment_result_value_t >
constexpr sequence2_id_t seqan3::alignment_result< alignment_result_value_t >::sequence2_id ( ) const
inlineconstexprnoexcept

Returns the alignment identifier of the second sequence.

Returns
The id of the second sequence.

◆ trace_matrix()

template<typename alignment_result_value_t >
constexpr auto const & seqan3::alignment_result< alignment_result_value_t >::trace_matrix ( ) const
inlineconstexprnoexcept

Returns the trace matrix used to compute the alignment.

Returns
The score matrix.

This function is only used for debugging such that performance can be affected significantly when enabling seqan3::align_cfg::detail::debug.

Note
This function is only available if the debug mode and the alignment was requested via the alignment configuration (see seqan3::align_cfg::detail::debug and seqan3::align_cfg::output_alignment).

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