SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::detail::aligned_sequence_builder< fst_sequence_t, sec_sequence_t > Class Template Reference

Builds the alignment for a given pair of sequences and the respective trace. More...

#include <seqan3/alignment/matrix/detail/aligned_sequence_builder.hpp>

Classes

struct  result_type
 The result type when building the aligned sequences. More...
 

Public Types

using alignment_type = typename make_pairwise_alignment_type< fst_sequence_t, sec_sequence_t >::type
 The pairwise alignment type of the two sequences.
 

Public Member Functions

template<std::ranges::input_range trace_path_t>
result_type operator() (trace_path_t &&trace_path)
 Builds the aligned sequences from the given trace path.
 
Constructors, destructor and assignment
constexpr aligned_sequence_builder ()=default
 Defaulted.
 
constexpr aligned_sequence_builder (aligned_sequence_builder const &)=default
 Defaulted.
 
constexpr aligned_sequence_builder (aligned_sequence_builder &&)=default
 Defaulted.
 
constexpr aligned_sequence_builderoperator= (aligned_sequence_builder const &)=default
 Defaulted.
 
constexpr aligned_sequence_builderoperator= (aligned_sequence_builder &&)=default
 Defaulted.
 
 ~aligned_sequence_builder ()=default
 Defaulted.
 
constexpr aligned_sequence_builder (fst_sequence_t fst_rng, sec_sequence_t sec_rng)
 Construction from the underlying sequences.
 

Private Member Functions

template<typename reverse_traces_t , typename fst_aligned_t , typename sec_aligned_t >
void fill_aligned_sequence (reverse_traces_t &&rev_traces, fst_aligned_t &fst_aligned, sec_aligned_t &sec_aligned) const
 Fills the sequences with gaps according to the given trace segments.
 

Private Attributes

type_reduce_t< fst_sequence_t > fst_rng
 A view over the first range.
 
type_reduce_t< sec_sequence_t > sec_rng
 A view over the second range.
 

Related Symbols

(Note that these are not member symbols.)

Type deduction guides
template<std::ranges::viewable_range fst_sequence_t, std::ranges::viewable_range sec_sequence_t>
 aligned_sequence_builder (fst_sequence_t &&, sec_sequence_t &&) -> aligned_sequence_builder< fst_sequence_t, sec_sequence_t >
 Deduces the type from the passed constructor arguments.
 

Detailed Description

template<std::ranges::viewable_range fst_sequence_t, std::ranges::viewable_range sec_sequence_t>
class seqan3::detail::aligned_sequence_builder< fst_sequence_t, sec_sequence_t >

Builds the alignment for a given pair of sequences and the respective trace.

Template Parameters
fst_sequence_tThe first sequence of the pairwise alignment; must model std::ranges::viewable_range.
sec_sequence_tThe second sequence of the pairwise alignment; must model std::ranges::viewable_range.

This class builds the alignment from a given trace path over the specified sequences. Use the interface seqan3::detail::aligned_sequence_builder::operator() to get the actual alignment. The returned seqan3::writable_aligned_sequence type is determined by the input types fst_sequence_t and sec_sequence_t.

See the seqan3::detail::make_aligned_sequence_type transformation trait for more information about the selected type.

Depending on the used alignment algorithm the computed alignment might only cover a subrange over the original sequences. Accordingly, the returned alignment covers only the part of the sequences that are part of the given trace path. One can use the seqan3::detail::aligned_sequence_builder::result_type to access the build alignment and also to access the actual slice positions over which the alignment was built for the first sequence and respectively the second sequence.

Constructor & Destructor Documentation

◆ aligned_sequence_builder()

template<std::ranges::viewable_range fst_sequence_t, std::ranges::viewable_range sec_sequence_t>
constexpr seqan3::detail::aligned_sequence_builder< fst_sequence_t, sec_sequence_t >::aligned_sequence_builder ( fst_sequence_t  fst_rng,
sec_sequence_t  sec_rng 
)
inlineconstexpr

Construction from the underlying sequences.

Parameters
[in]fst_rngThe first range to build the aligned sequence for.
[in]sec_rngThe second range to build the aligned sequence for.

Member Function Documentation

◆ fill_aligned_sequence()

template<std::ranges::viewable_range fst_sequence_t, std::ranges::viewable_range sec_sequence_t>
template<typename reverse_traces_t , typename fst_aligned_t , typename sec_aligned_t >
void seqan3::detail::aligned_sequence_builder< fst_sequence_t, sec_sequence_t >::fill_aligned_sequence ( reverse_traces_t &&  rev_traces,
fst_aligned_t &  fst_aligned,
sec_aligned_t &  sec_aligned 
) const
inlineprivate

Fills the sequences with gaps according to the given trace segments.

Template Parameters
reverse_traces_tThe type storing the reverse trace.
Parameters
[in]rev_tracesThe trace segments in order from source to sink in the trace matrix.
[in,out]fst_alignedThe first aligned sequence to insert gaps into.
[in,out]sec_alignedThe second aligned sequence to insert gaps into.

◆ operator()()

template<std::ranges::viewable_range fst_sequence_t, std::ranges::viewable_range sec_sequence_t>
template<std::ranges::input_range trace_path_t>
result_type seqan3::detail::aligned_sequence_builder< fst_sequence_t, sec_sequence_t >::operator() ( trace_path_t &&  trace_path)
inline

Builds the aligned sequences from the given trace path.

Template Parameters
trace_path_tThe type of the trace path; must model std::ranges::input_range and std::same_as<std::ranges::range_value_t<trace_path_t>, seqan3::detail::trace_directions> must evaluate to true.
Parameters
[in]trace_pathThe trace path.
Returns
seqan3::detail::aligned_sequence_builder::result_type with the built alignment.

From the given trace path this function builds the aligned sequences for the first and the second target sequence. The return type seqan3::detail::aligned_sequence_builder::result_type is an aggregate type containing the begin and end coordinates with the respective sequence positions and the respective alignment over the sliced sequences.


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