SeqAn3  3.0.2
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 <type_traits>
17 
35 #include <seqan3/std/ranges>
36 
37 namespace seqan3::detail
38 {
45 template <std::ranges::forward_range first_range_t,
46  std::ranges::forward_range second_range_t,
47  typename configuration_t>
49  requires is_type_specialisation_of_v<std::remove_cvref_t<configuration_t>, configuration>
51 struct align_result_selector
52 {
53 private:
55  using traits_type = alignment_configuration_traits<configuration_t>;
57  using score_type = typename alignment_configuration_traits<
58  std::remove_reference_t<configuration_t>>::original_score_type;
60  using disabled_type = std::nullopt_t *;
62  using debug_score_matrix_type = two_dimensional_matrix<std::optional<score_type>,
64  matrix_major_order::column>;
66  using debug_trace_matrix_type = two_dimensional_matrix<std::optional<trace_directions>,
68  matrix_major_order::column>;
72  using configured_end_position_type = std::conditional_t<traits_type::compute_end_positions,
73  alignment_coordinate,
74  disabled_type>;
76  using configured_begin_position_type = std::conditional_t<traits_type::compute_begin_positions,
77  alignment_coordinate,
78  disabled_type>;
80  using configured_alignment_type = typename lazy_conditional_t<traits_type::compute_sequence_alignment,
81  lazy<make_pairwise_alignment_type,
82  first_range_t &,
83  second_range_t &>,
85 
90 
92  using configured_debug_score_matrix_type = std::conditional_t<traits_type::is_debug,
93  debug_score_matrix_type,
94  disabled_type>;
95 
97  using configured_debug_trace_matrix_type =
98  std::conditional_t<traits_type::is_debug && traits_type::compute_sequence_alignment,
99  debug_trace_matrix_type,
100  disabled_type>;
101 
102 public:
104  using type = alignment_result_value_type<configured_sequence1_id_type,
105  configured_sequence2_id_type,
106  configured_score_type,
107  configured_end_position_type,
108  configured_begin_position_type,
109  configured_alignment_type,
110  configured_debug_score_matrix_type,
111  configured_debug_trace_matrix_type>;
112 };
113 
114 } // namespace seqan3::detail
type_traits.hpp
Provides helper type traits for the configuration and execution of the alignment algorithm.
gap_decorator.hpp
Provides seqan3::gap_decorator.
configuration.hpp
Provides seqan3::detail::configuration and utility functions.
basic.hpp
Provides various type traits on generic types.
template_inspection.hpp
Provides seqan3::type_list and auxiliary type traits.
two_dimensional_matrix.hpp
Provides seqan3::detail::two_dimensional_matrix.
trace_directions.hpp
Provides the declaration of seqan3::detail::trace_directions.
gapped.hpp
Provides seqan3::gapped.
type_reduce.hpp
Provides seqan3::views::type_reduce.
range.hpp
Provides various transformation traits used by the range module.
transformation_trait_or.hpp
Provides seqan3::detail::transformation_trait_or.
aligned_sequence_builder.hpp
Provides seqan3::detail::aligned_sequence_builder.
ranges
Adaptations of concepts from the Ranges TS.
std::remove_reference_t
std::nullopt_t
std::type_identity
The identity transformation (a transformation_trait that returns the input).
std::allocator
optional
alignment_coordinate.hpp
Provides seqan3::detail::alignment_coordinate.
std::conditional_t
traits.hpp
Provides traits for seqan3::type_list.
lazy.hpp
Provides lazy template instantiation traits.
align_config_debug.hpp
Provides seqan3::align_cfg::detail::debug.
type_list.hpp
Provides seqan3::type_list.