16 #include <type_traits> 45 template <
typename first_t,
typename second_t>
46 struct alignment_type;
49 template <
typename first_t,
typename second_t>
50 requires std::ranges::random_access_range<first_t> &&
51 std::ranges::sized_range<first_t> &&
52 std::ranges::random_access_range<second_t> &&
53 std::ranges::sized_range<second_t>
54 struct alignment_type<first_t, second_t>
66 template <std::ranges::forward_range first_range_t,
67 std::ranges::forward_range second_range_t,
68 typename configuration_t>
70 requires is_type_specialisation_of_v<remove_cvref_t<configuration_t>, configuration>
72 struct align_result_selector
76 using score_type =
typename alignment_configuration_traits<configuration_t>::original_score_t;
79 static constexpr
auto select()
81 static_assert(configuration_t::template exists<align_cfg::result>());
83 if constexpr (configuration_t::template exists<align_cfg::result<with_back_coordinate_type, score_type>>())
85 return alignment_result_value_type<uint32_t,
87 alignment_coordinate>{};
89 else if constexpr (configuration_t::template exists<align_cfg::result<with_front_coordinate_type, score_type>>())
91 return alignment_result_value_type<uint32_t,
94 alignment_coordinate>{};
96 else if constexpr (configuration_t::template exists<align_cfg::result<with_alignment_type, score_type>>())
99 using first_gapped_seq_type = gapped<value_type_t<first_range_t>>;
100 using second_gapped_seq_type = gapped<value_type_t<second_range_t>>;
106 using decorator_t = alignment_type<first_range_t, second_range_t>;
108 return alignment_result_value_type<uint32_t,
110 alignment_coordinate,
111 alignment_coordinate,
112 detail::transformation_trait_or_t<decorator_t, fallback_t>>{};
116 return alignment_result_value_type<uint32_t, score_type>{};
121 template <
typename alignment_result_value_t>
122 static constexpr
auto augment_if_debug(alignment_result_value_t)
124 if constexpr (configuration_t::template exists<detail::debug_mode>())
126 using as_type_list = transfer_template_args_onto_t<alignment_result_value_t, type_list>;
127 using score_matrix_t = two_dimensional_matrix<std::optional<score_type>,
129 matrix_major_order::column>;
130 using trace_matrix_t = two_dimensional_matrix<std::optional<trace_directions>,
132 matrix_major_order::column>;
134 if constexpr (configuration_t::template exists<align_cfg::result<with_alignment_type>>())
136 using with_score_t = list_traits::replace_at<score_matrix_t, 5, as_type_list>;
137 return transfer_template_args_onto_t<list_traits::replace_at<trace_matrix_t, 6, with_score_t>,
138 alignment_result_value_type>{};
142 return transfer_template_args_onto_t<list_traits::replace_at<score_matrix_t, 5, as_type_list>,
143 alignment_result_value_type>{};
148 return alignment_result_value_t{};
154 using type = decltype(augment_if_debug(select()));
Provides seqan3::type_list and auxiliary type traits.
Provides traits for seqan3::type_list.
Provides seqan3::align_cfg::debug.
Provides seqan3::type_list.
Adaptations of concepts from the Ranges TS.
Provides the declaration of seqan3::detail::trace_directions.
Definition: aligned_sequence_concept.hpp:36
Provides helper type traits for the configuration and execution of the alignment algorithm.
Provides seqan3::views::type_reduce.
Provides various type traits on generic types.
Provides seqan3::detail::two_dimensional_matrix.
Provides seqan3::detail::alignment_coordinate.
Provides seqan3::detail::configuration and utility functions.
Provides various transformation traits used by the range module.
Provides configuration for alignment output.
Provides seqan3::gap_decorator.