SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
align_result_selector.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2020, Knut Reinert & MPI für molekulare Genetik
4 // This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5 // shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6 // -----------------------------------------------------------------------------------------------------
7 
13 #pragma once
14 
15 #include <optional>
16 #include <seqan3/std/ranges>
17 #include <type_traits>
18 
34 
35 namespace seqan3::detail
36 {
43 template <std::ranges::forward_range first_range_t,
44  std::ranges::forward_range second_range_t,
45  typename configuration_t>
47  requires is_type_specialisation_of_v<std::remove_cvref_t<configuration_t>, configuration>
49 struct align_result_selector
50 {
51 private:
53  using traits_type = alignment_configuration_traits<configuration_t>;
55  using score_type = typename alignment_configuration_traits<
56  std::remove_reference_t<configuration_t>>::original_score_type;
58  using disabled_type = std::nullopt_t *;
60  using debug_score_matrix_type = two_dimensional_matrix<std::optional<score_type>,
62  matrix_major_order::column>;
64  using debug_trace_matrix_type = two_dimensional_matrix<std::optional<trace_directions>,
66  matrix_major_order::column>;
70  using configured_end_position_type = std::conditional_t<traits_type::compute_end_positions,
71  alignment_coordinate,
72  disabled_type>;
74  using configured_begin_position_type = std::conditional_t<traits_type::compute_begin_positions,
75  alignment_coordinate,
76  disabled_type>;
78  using configured_alignment_type = typename lazy_conditional_t<traits_type::compute_sequence_alignment,
79  lazy<make_pairwise_alignment_type,
80  first_range_t &,
81  second_range_t &>,
83 
88 
90  using configured_debug_score_matrix_type = std::conditional_t<traits_type::is_debug,
91  debug_score_matrix_type,
92  disabled_type>;
93 
95  using configured_debug_trace_matrix_type =
96  std::conditional_t<traits_type::is_debug && traits_type::compute_sequence_alignment,
97  debug_trace_matrix_type,
98  disabled_type>;
99 
100 public:
102  using type = alignment_result_value_type<configured_sequence1_id_type,
103  configured_sequence2_id_type,
104  configured_score_type,
105  configured_end_position_type,
106  configured_begin_position_type,
107  configured_alignment_type,
108  configured_debug_score_matrix_type,
109  configured_debug_trace_matrix_type>;
110 };
111 
112 } // namespace seqan3::detail
Provides seqan3::align_cfg::detail::debug.
Provides seqan3::detail::aligned_sequence_builder.
Provides helper type traits for the configuration and execution of the alignment algorithm.
Provides seqan3::detail::alignment_coordinate.
Provides seqan3::configuration and utility functions.
Provides various transformation traits used by the range module.
Provides type traits for working with templates.
Provides seqan3::gap_decorator.
Provides seqan3::gapped.
Provides lazy template instantiation traits.
Adaptations of concepts from the Ranges TS.
Provides the declaration of seqan3::detail::trace_directions.
Provides seqan3::detail::two_dimensional_matrix.
Provides seqan3::views::type_reduce.
Provides various type traits on generic types.
Provides seqan3::detail::transformation_trait_or.