52template <std::ranges::viewable_range range_t>
65 using type = lazy_conditional_t<is_class_template_declarable_with_v<gap_decorator, unaligned_sequence_type>,
77template <std::ranges::viewable_range first_sequence_t, std::ranges::viewable_range second_sequence_t>
86 "first_aligned_t is required to model seqan3::writable_aligned_sequence!");
88 "second_aligned_t is required to model seqan3::writable_aligned_sequence!");
115template <std::ranges::viewable_range fst_sequence_t, std::ranges::viewable_range sec_sequence_t>
171 template <std::ranges::input_range trace_path_t>
174 static_assert(std::same_as<std::ranges::range_value_t<trace_path_t>,
trace_directions>,
175 "The value type of the trace path must be seqan3::detail::trace_directions");
179 std::tie(res.first_sequence_slice_positions.second, res.second_sequence_slice_positions.second) =
184 while (trace_it != std::ranges::end(trace_path))
188 for (; trace_it != std::ranges::end(trace_path) && *trace_it == last_dir; ++trace_it, ++span)
194 std::tie(res.first_sequence_slice_positions.first, res.second_sequence_slice_positions.first) =
198 std::get<0>(res.alignment),
200 |
views::slice(res.first_sequence_slice_positions.first, res.first_sequence_slice_positions.second));
202 std::get<1>(res.alignment),
204 |
views::slice(res.second_sequence_slice_positions.first, res.second_sequence_slice_positions.second));
208 std::get<0>(res.alignment),
209 std::get<1>(res.alignment));
221 template <
typename reverse_traces_t,
typename fst_aligned_t,
typename sec_aligned_t>
223 fst_aligned_t & fst_aligned,
224 sec_aligned_t & sec_aligned)
const
226 if (std::ranges::empty(rev_traces))
232 for (
auto const & [dir, span] : rev_traces)
237 fst_it = insert_gap(fst_aligned, fst_it, span);
240 sec_it = insert_gap(sec_aligned, sec_it, span);
256template <std::ranges::viewable_range fst_sequence_t, std::ranges::viewable_range sec_sequence_t>
Includes the aligned_sequence and the related insert_gap and erase_gap functions to enable stl contai...
Builds the alignment for a given pair of sequences and the respective trace.
Definition: aligned_sequence_builder.hpp:117
typename make_pairwise_alignment_type< fst_sequence_t, sec_sequence_t >::type alignment_type
The pairwise alignment type of the two sequences.
Definition: aligned_sequence_builder.hpp:120
constexpr aligned_sequence_builder()=default
Defaulted.
type_reduce_t< fst_sequence_t > fst_rng
A view over the first range.
Definition: aligned_sequence_builder.hpp:247
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.
result_type operator()(trace_path_t &&trace_path)
Builds the aligned sequences from the given trace path.
Definition: aligned_sequence_builder.hpp:172
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.
Definition: aligned_sequence_builder.hpp:222
type_reduce_t< sec_sequence_t > sec_rng
A view over the second range.
Definition: aligned_sequence_builder.hpp:248
T emplace_back(T... args)
Provides seqan3::gap_decorator.
trace_directions
The possible directions a trace can have. The values can be combined by the logical |-operator.
Definition: trace_directions.hpp:29
@ up
Trace comes from the above entry.
@ left
Trace comes from the left entry.
@ diagonal
Trace comes from the diagonal entry.
constexpr auto all
Returns a view that includes all elements of the range argument.
Definition: all_view.hpp:204
@ alignment
The (pairwise) alignment stored in an object that models seqan3::detail::pairwise_alignment.
constexpr auto slice
A view adaptor that returns a half-open interval on the underlying range.
Definition: slice.hpp:178
constexpr auto type_reduce
A view adaptor that behaves like std::views::all, but type erases certain ranges.
Definition: type_reduce.hpp:150
The generic concept for an aligned sequence that is writable.
Provides a type trait for verifying valid template declarations.
Provides lazy template instantiation traits.
Provides seqan3::detail::matrix_index, seqan3::detail::matrix_coordinate and associated strong types.
The internal SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
decltype(views::type_reduce(std::declval< t >())) type_reduce_t
Deduces the return value of seqan3::views::type_reduce.
Definition: type_reduce.hpp:162
SeqAn specific customisations in the standard namespace.
Provides seqan3::views::slice.
The result type when building the aligned sequences.
Definition: aligned_sequence_builder.hpp:124
An empty type whose only purpose is to hold an uninstantiated template plus its arguments.
Definition: lazy_conditional.hpp:33
A transformation trait that returns the correct aligned sequence type for a given sequence type.
Definition: aligned_sequence_builder.hpp:54
decltype(std::declval< range_t >()|views::type_reduce|views::slice(0, 1)) unaligned_sequence_type
The unaligned sequence type that will be used to assign a sequence to seqan3::assign_unaligned.
Definition: aligned_sequence_builder.hpp:61
lazy_conditional_t< is_class_template_declarable_with_v< gap_decorator, unaligned_sequence_type >, lazy< gap_decorator, unaligned_sequence_type >, lazy< std::vector, gapped< std::ranges::range_value_t< unaligned_sequence_type > > > > type
The resulting aligned sequence type.
Definition: aligned_sequence_builder.hpp:67
A transformation trait that returns the correct pairwise alignment type for two given sequence types.
Definition: aligned_sequence_builder.hpp:79
typename make_aligned_sequence_type< second_sequence_t >::type second_aligned_t
The aligned sequence type for the second sequence.
Definition: aligned_sequence_builder.hpp:83
typename make_aligned_sequence_type< first_sequence_t >::type first_aligned_t
The aligned sequence type for the first sequence.
Definition: aligned_sequence_builder.hpp:81
Provides the declaration of seqan3::detail::trace_directions.
Provides seqan3::views::type_reduce.
Provides the concepts seqan3::transformation_trait and seqan3::unary_type_trait.
Provides seqan3::views::convert.