From 06b4afda854e2c5260afd9939861a12921e46475 Mon Sep 17 00:00:00 2001 From: marehr Date: Wed, 12 Aug 2020 23:07:03 +0200 Subject: [PATCH 01/19] [FIX] gcc-11 bugs hidden by SEQAN3_WORKAROUND_GCC_93467 --- include/seqan3/alignment/pairwise/alignment_result.hpp | 6 +++--- include/seqan3/search/search_result.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/seqan3/alignment/pairwise/alignment_result.hpp b/include/seqan3/alignment/pairwise/alignment_result.hpp index 1eb02e5603..434f27a352 100644 --- a/include/seqan3/alignment/pairwise/alignment_result.hpp +++ b/include/seqan3/alignment/pairwise/alignment_result.hpp @@ -22,8 +22,8 @@ namespace seqan3::detail { -// forward declaration for friend declaraion in alignment_result. -template +// forward declaration for friend declaration in alignment_result. +template #if !SEQAN3_WORKAROUND_GCC_93467 //!\cond requires is_type_specialisation_of_v @@ -159,7 +159,7 @@ class alignment_result template #if !SEQAN3_WORKAROUND_GCC_93467 //!\cond - requires is_type_specialisation_of_v + requires detail::is_type_specialisation_of_v //!\endcond #endif // !SEQAN3_WORKAROUND_GCC_93467 friend class detail::policy_alignment_result_builder; diff --git a/include/seqan3/search/search_result.hpp b/include/seqan3/search/search_result.hpp index 8913f3c349..c1fb994f38 100644 --- a/include/seqan3/search/search_result.hpp +++ b/include/seqan3/search/search_result.hpp @@ -89,7 +89,7 @@ class search_result template #if !SEQAN3_WORKAROUND_GCC_93467 //!\cond - requires is_type_specialisation_of_v + requires detail::is_type_specialisation_of_v //!\endcond #endif // !SEQAN3_WORKAROUND_GCC_93467 friend struct detail::policy_search_result_builder; From c73b010fab8b7967d1bb415fd343528b85d311ba Mon Sep 17 00:00:00 2001 From: marehr Date: Wed, 12 Aug 2020 23:29:47 +0200 Subject: [PATCH 02/19] [FIX] gcc-11: argument_parser: maybe-uninitialized warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` /seqan3/include/seqan3/argument_parser/detail/format_base.hpp: In static member function ‘static std::string seqan3::detail::format_base::get_type_name_as_string(const container_type&) [with container_type = std::vector]’: /seqan3/include/seqan3/argument_parser/detail/format_base.hpp:91:43: error: ‘tmp’ may be used uninitialized [-Werror=maybe-uninitialized] 91 | return get_type_name_as_string(tmp); | ^ ``` --- include/seqan3/argument_parser/detail/format_base.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/seqan3/argument_parser/detail/format_base.hpp b/include/seqan3/argument_parser/detail/format_base.hpp index 4133143be7..25a1067e01 100644 --- a/include/seqan3/argument_parser/detail/format_base.hpp +++ b/include/seqan3/argument_parser/detail/format_base.hpp @@ -87,7 +87,7 @@ class format_base //!\endcond static std::string get_type_name_as_string(container_type const & /**/) { - typename container_type::value_type tmp; + typename container_type::value_type tmp{}; return get_type_name_as_string(tmp); } From cf0c44b518cf79cb8257f46c654b6ab99356b851 Mon Sep 17 00:00:00 2001 From: marehr Date: Thu, 13 Aug 2020 00:19:09 +0200 Subject: [PATCH 03/19] [MISC] gcc-11: SEQAN3_WORKAROUND_GCC_96070 is still needed for gcc-11.0 --- include/seqan3/core/platform.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/seqan3/core/platform.hpp b/include/seqan3/core/platform.hpp index 574e7342b8..de3f62d594 100644 --- a/include/seqan3/core/platform.hpp +++ b/include/seqan3/core/platform.hpp @@ -269,7 +269,7 @@ //!\brief See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96070 and https://github.com/seqan/product_backlog/issues/151 #ifndef SEQAN3_WORKAROUND_GCC_96070 // not yet fixed, this is a defect within the standard lib // remind us of this issue once gcc-11 was released. -# if defined(__GNUC__) && (__GNUC__ < 11) +# if defined(__GNUC__) && ((__GNUC__ < 11) || (__GNUC__ == 11 && __GNUC_MINOR__ < 1)) # define SEQAN3_WORKAROUND_GCC_96070 1 # else # define SEQAN3_WORKAROUND_GCC_96070 0 From 4f4589d4eeaedc4b35fe89b3b7b88f57534a125d Mon Sep 17 00:00:00 2001 From: marehr Date: Thu, 13 Aug 2020 00:33:00 +0200 Subject: [PATCH 04/19] [MISC] gcc-10.2: SEQAN3_WORKAROUND_GCC_93467 was fixed --- include/seqan3/core/platform.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/seqan3/core/platform.hpp b/include/seqan3/core/platform.hpp index de3f62d594..f4a5e1a84d 100644 --- a/include/seqan3/core/platform.hpp +++ b/include/seqan3/core/platform.hpp @@ -258,8 +258,8 @@ #endif //!\brief See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93467 -#ifndef SEQAN3_WORKAROUND_GCC_93467 -# if defined(__GNUC__) && ((__GNUC__ == 7) || (__GNUC__ == 8) || (__GNUC__ == 9) || (__GNUC__ == 10)) +#ifndef SEQAN3_WORKAROUND_GCC_93467 // fixed since gcc10.2 +# if defined(__GNUC__) && ((__GNUC__ <= 9) || (__GNUC__ == 10 && __GNUC_MINOR__ < 2)) # define SEQAN3_WORKAROUND_GCC_93467 1 # else # define SEQAN3_WORKAROUND_GCC_93467 0 From 78c6942a87e3e0939defe7e2a62cc6cf0df022c3 Mon Sep 17 00:00:00 2001 From: smehringer Date: Tue, 18 Aug 2020 07:52:09 +0200 Subject: [PATCH 05/19] [MISC] Change member variables of method_global to booleans. --- .../configuration/align_config_method.hpp | 16 +++++------ .../align_config_method_test.cpp | 28 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/seqan3/alignment/configuration/align_config_method.hpp b/include/seqan3/alignment/configuration/align_config_method.hpp index 3bfc6926c4..6941a04096 100644 --- a/include/seqan3/alignment/configuration/align_config_method.hpp +++ b/include/seqan3/alignment/configuration/align_config_method.hpp @@ -132,14 +132,14 @@ struct method_global : public pipeable_config_element {} //!\} - //!\brief If set to `true`, leading gaps in sequence1 are not penalized when computing the optimal alignment. - seqan3::align_cfg::free_end_gaps_sequence1_leading free_end_gaps_sequence1_leading{false}; - //!\brief If set to `true`, leading gaps in sequence2 are not penalized when computing the optimal alignment. - seqan3::align_cfg::free_end_gaps_sequence2_leading free_end_gaps_sequence2_leading{false}; - //!\brief If set to `true`, trailing gaps in sequence1 are not penalized when computing the optimal alignment. - seqan3::align_cfg::free_end_gaps_sequence1_trailing free_end_gaps_sequence1_trailing{false}; - //!\brief If set to `true`, trailing gaps in sequence2 are not penalized when computing the optimal alignment. - seqan3::align_cfg::free_end_gaps_sequence2_trailing free_end_gaps_sequence2_trailing{false}; + //!\brief If set to `true`, leading gaps in sequence1 are not penalised when computing the optimal alignment. + bool free_end_gaps_sequence1_leading{false}; + //!\brief If set to `true`, leading gaps in sequence2 are not penalised when computing the optimal alignment. + bool free_end_gaps_sequence2_leading{false}; + //!\brief If set to `true`, trailing gaps in sequence1 are not penalised when computing the optimal alignment. + bool free_end_gaps_sequence1_trailing{false}; + //!\brief If set to `true`, trailing gaps in sequence2 are not penalised when computing the optimal alignment. + bool free_end_gaps_sequence2_trailing{false}; //!\privatesection //!\brief An internal id used to check for a valid alignment configuration. diff --git a/test/unit/alignment/configuration/align_config_method_test.cpp b/test/unit/alignment/configuration/align_config_method_test.cpp index 793a508869..01611ede25 100644 --- a/test/unit/alignment/configuration/align_config_method_test.cpp +++ b/test/unit/alignment/configuration/align_config_method_test.cpp @@ -28,18 +28,18 @@ TEST(method_global, access_member_variables) seqan3::align_cfg::method_global opt{}; // default construction // all default to false - EXPECT_FALSE(opt.free_end_gaps_sequence1_leading.get()); - EXPECT_FALSE(opt.free_end_gaps_sequence2_leading.get()); - EXPECT_FALSE(opt.free_end_gaps_sequence1_trailing.get()); - EXPECT_FALSE(opt.free_end_gaps_sequence2_trailing.get()); - - opt.free_end_gaps_sequence1_leading = seqan3::align_cfg::free_end_gaps_sequence1_leading{true}; - opt.free_end_gaps_sequence2_leading = seqan3::align_cfg::free_end_gaps_sequence2_leading{true}; - opt.free_end_gaps_sequence1_trailing = seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}; - opt.free_end_gaps_sequence2_trailing = seqan3::align_cfg::free_end_gaps_sequence2_trailing{true}; - - EXPECT_TRUE(opt.free_end_gaps_sequence1_leading.get()); - EXPECT_TRUE(opt.free_end_gaps_sequence2_leading.get()); - EXPECT_TRUE(opt.free_end_gaps_sequence1_trailing.get()); - EXPECT_TRUE(opt.free_end_gaps_sequence2_trailing.get()); + EXPECT_FALSE(opt.free_end_gaps_sequence1_leading); + EXPECT_FALSE(opt.free_end_gaps_sequence2_leading); + EXPECT_FALSE(opt.free_end_gaps_sequence1_trailing); + EXPECT_FALSE(opt.free_end_gaps_sequence2_trailing); + + opt.free_end_gaps_sequence1_leading = true; + opt.free_end_gaps_sequence2_leading = true; + opt.free_end_gaps_sequence1_trailing = true; + opt.free_end_gaps_sequence2_trailing = true; + + EXPECT_TRUE(opt.free_end_gaps_sequence1_leading); + EXPECT_TRUE(opt.free_end_gaps_sequence2_leading); + EXPECT_TRUE(opt.free_end_gaps_sequence1_trailing); + EXPECT_TRUE(opt.free_end_gaps_sequence2_trailing); } From 8ff5e00d001cce1b556798efb60a10b29f046a66 Mon Sep 17 00:00:00 2001 From: marehr Date: Fri, 12 Jun 2020 23:59:53 +0200 Subject: [PATCH 06/19] [FIX] use feature-testing macro for std::type_identity in type_traits --- include/seqan3/std/type_traits | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/seqan3/std/type_traits b/include/seqan3/std/type_traits index 3e101c9327..9b0baf6e4a 100644 --- a/include/seqan3/std/type_traits +++ b/include/seqan3/std/type_traits @@ -18,6 +18,7 @@ namespace std { +#ifndef __cpp_lib_type_identity /*!\defgroup std_type_traits type_traits * \ingroup std * \brief The \ header from C++20's standard library. @@ -44,5 +45,6 @@ struct type_identity //!\ingroup std_type_traits template using type_identity_t = typename type_identity::type; +#endif // __cpp_lib_type_identity } // namespace std From fbef1fcb8706e7316318a6978a9cb941d545fcbe Mon Sep 17 00:00:00 2001 From: marehr Date: Fri, 21 Aug 2020 15:41:47 +0200 Subject: [PATCH 07/19] [FEATURE] seqan3::detail::ceil_log2 and seqan3::detail::floor_log2 --- include/seqan3/core/math.hpp | 75 ++++++++++++++++++++++- test/snippet/core/detail/ceil_log2.cpp | 18 ++++++ test/snippet/core/detail/floor_log2.cpp | 18 ++++++ test/unit/core/math_test.cpp | 79 +++++++++++++++++++++++++ 4 files changed, 189 insertions(+), 1 deletion(-) create mode 100644 test/snippet/core/detail/ceil_log2.cpp create mode 100644 test/snippet/core/detail/floor_log2.cpp diff --git a/include/seqan3/core/math.hpp b/include/seqan3/core/math.hpp index dc0de096f6..4385e51ab4 100644 --- a/include/seqan3/core/math.hpp +++ b/include/seqan3/core/math.hpp @@ -16,7 +16,80 @@ #include #include -#include +#include + +namespace seqan3::detail +{ + +/*!\brief Computes the floor of the logarithm to the base of two for unsigned integers. + * \ingroup core + * \param[in] n An unsigned integer. + * \attention *n = 0* is a special case and is undefined. + * \returns \f$ \lfloor log_2(n) \rfloor \f$. + * + * \details + * + * The difference to `std::floor(std::log2(n))` is that everything is computed *exactly* (without precision loss due to + * promoting to `double`) + * + * ### Example + * + * \include test/snippet/core/detail/floor_log2.cpp + * + * ### Exception + * + * No-throw guarantee. + * + * ### Thread-safety + * + * Thread safe. + * + * ### Complexity + * + * Constant. + */ +template +constexpr unsigned_t floor_log2(unsigned_t const n) noexcept +{ + assert(n > 0u); // n == 0 is undefined behaviour + return most_significant_bit_set(n); +} + +/*!\brief Computes the ceil of the logarithm to the base of two for unsigned integers. + * \ingroup core + * \param[in] n An unsigned integer. + * \attention *n = 0* is a special case and is undefined. + * \returns \f$ \lceil log_2(n) \rceil \f$. + * + * \details + * + * The difference to `std::ceil(std::log2(n))` is that everything is computed *exactly* (without precision loss due to + * promoting to `double`) + * + * ### Example + * + * \include test/snippet/core/detail/ceil_log2.cpp + * + * ### Exception + * + * No-throw guarantee. + * + * ### Thread-safety + * + * Thread safe. + * + * ### Complexity + * + * Constant. + */ +template +constexpr unsigned_t ceil_log2(unsigned_t const n) noexcept +{ + assert(n > 0u); // n == 0 is undefined behaviour + return (n == 1u) ? 0u : seqan3::detail::floor_log2(n - 1u) + 1u; +} + +} // namespace seqan3::detail namespace seqan3 { diff --git a/test/snippet/core/detail/ceil_log2.cpp b/test/snippet/core/detail/ceil_log2.cpp new file mode 100644 index 0000000000..cd9ba01066 --- /dev/null +++ b/test/snippet/core/detail/ceil_log2.cpp @@ -0,0 +1,18 @@ +#include +#include + +int main() +{ + // the same as std::ceil(std::log2(x)), but exact for unsigned integers + seqan3::debug_stream << "ceil_log2(2^0 + 0): " << seqan3::detail::ceil_log2(1u) << '\n'; // 0u + seqan3::debug_stream << "ceil_log2(2^1 + 0): " << seqan3::detail::ceil_log2(2u) << '\n'; // 1u + seqan3::debug_stream << "ceil_log2(2^1 + 1): " << seqan3::detail::ceil_log2(3u) << '\n'; // 2u + seqan3::debug_stream << "ceil_log2(2^2 + 0): " << seqan3::detail::ceil_log2(4u) << '\n'; // 2u + seqan3::debug_stream << "ceil_log2(2^2 + 1): " << seqan3::detail::ceil_log2(5u) << '\n'; // 3u + seqan3::debug_stream << "ceil_log2(2^2 + 2): " << seqan3::detail::ceil_log2(6u) << '\n'; // 3u + seqan3::debug_stream << "ceil_log2(2^2 + 3): " << seqan3::detail::ceil_log2(7u) << '\n'; // 3u + seqan3::debug_stream << "ceil_log2(2^3 + 0): " << seqan3::detail::ceil_log2(8u) << '\n'; // 3u + seqan3::debug_stream << "ceil_log2(2^3 + 1): " << seqan3::detail::ceil_log2(9u) << '\n'; // 4u + + return 0; +} diff --git a/test/snippet/core/detail/floor_log2.cpp b/test/snippet/core/detail/floor_log2.cpp new file mode 100644 index 0000000000..967796672e --- /dev/null +++ b/test/snippet/core/detail/floor_log2.cpp @@ -0,0 +1,18 @@ +#include +#include + +int main() +{ + // the same as std::floor(std::log2(x)), but exact for unsigned integers + seqan3::debug_stream << "floor_log2(2^0 + 0): " << seqan3::detail::floor_log2(1u) << '\n'; // 0u + seqan3::debug_stream << "floor_log2(2^1 + 0): " << seqan3::detail::floor_log2(2u) << '\n'; // 1u + seqan3::debug_stream << "floor_log2(2^1 + 1): " << seqan3::detail::floor_log2(3u) << '\n'; // 1u + seqan3::debug_stream << "floor_log2(2^2 + 0): " << seqan3::detail::floor_log2(4u) << '\n'; // 2u + seqan3::debug_stream << "floor_log2(2^2 + 1): " << seqan3::detail::floor_log2(5u) << '\n'; // 2u + seqan3::debug_stream << "floor_log2(2^2 + 2): " << seqan3::detail::floor_log2(6u) << '\n'; // 2u + seqan3::debug_stream << "floor_log2(2^2 + 3): " << seqan3::detail::floor_log2(7u) << '\n'; // 2u + seqan3::debug_stream << "floor_log2(2^3 + 0): " << seqan3::detail::floor_log2(8u) << '\n'; // 3u + seqan3::debug_stream << "floor_log2(2^3 + 1): " << seqan3::detail::floor_log2(9u) << '\n'; // 3u + + return 0; +} diff --git a/test/unit/core/math_test.cpp b/test/unit/core/math_test.cpp index ca3d30d835..8a21893908 100644 --- a/test/unit/core/math_test.cpp +++ b/test/unit/core/math_test.cpp @@ -9,6 +9,85 @@ #include +static constexpr size_t max_iterations = 1;//1 << 15; + +using unsigned_types = ::testing::Types; + +template +class unsigned_operations : public ::testing::Test +{}; + +TYPED_TEST_SUITE(unsigned_operations, unsigned_types, ); + +TYPED_TEST(unsigned_operations, floor_log2) +{ + using unsigned_t = TypeParam; + constexpr size_t zero = seqan3::detail::floor_log2(0b0001); + constexpr size_t one1 = seqan3::detail::floor_log2(0b0010); + constexpr size_t one2 = seqan3::detail::floor_log2(0b0011); + constexpr size_t two1 = seqan3::detail::floor_log2(0b0101); + constexpr size_t two2 = seqan3::detail::floor_log2(0b0111); + constexpr size_t seven = seqan3::detail::floor_log2(0b10010010); + EXPECT_EQ(zero, 0u); + EXPECT_EQ(one1, 1u); + EXPECT_EQ(one2, 1u); + EXPECT_EQ(two1, 2u); + EXPECT_EQ(two2, 2u); + EXPECT_EQ(seven, 7u); + + for (uint8_t log2_value = 0; log2_value < seqan3::detail::sizeof_bits; ++log2_value) + { + unsigned_t start = unsigned_t{1u} << log2_value; + unsigned_t end = start << 1u; + for (unsigned_t n = start, k = 0u; n < end && k < max_iterations; ++n, ++k) + { + EXPECT_EQ(seqan3::detail::floor_log2(n), log2_value); + EXPECT_EQ(std::floor(std::log2(n)), log2_value) << "If this fails this might be a floating point rounding " + << "error on your machine"; + } + } +} + +TYPED_TEST(unsigned_operations, ceil_log2) +{ + using unsigned_t = TypeParam; + constexpr size_t zero = seqan3::detail::ceil_log2(0b0001); + constexpr size_t one = seqan3::detail::ceil_log2(0b0010); + constexpr size_t two = seqan3::detail::ceil_log2(0b0011); + constexpr size_t three1 = seqan3::detail::ceil_log2(0b0101); + constexpr size_t three2 = seqan3::detail::ceil_log2(0b0111); + constexpr size_t eight = seqan3::detail::ceil_log2(0b10010010); + EXPECT_EQ(zero, 0u); + EXPECT_EQ(one, 1u); + EXPECT_EQ(two, 2u); + EXPECT_EQ(three1, 3u); + EXPECT_EQ(three2, 3u); + EXPECT_EQ(eight, 8u); + + for (uint8_t log2_value = 0; log2_value < seqan3::detail::sizeof_bits; ++log2_value) + { + unsigned_t start = unsigned_t{1u} << log2_value; + unsigned_t end = start << 1u; + EXPECT_EQ(seqan3::detail::ceil_log2(start), log2_value); + EXPECT_EQ(std::ceil(std::log2(start)), log2_value) << "ceil_log2 of " << start << " should be " << log2_value + << "; If this fails this might be a floating point rounding " + << "error on your machine."; + + for (unsigned_t n = start + 1u, k = 0u; n < end && k < max_iterations; ++n, ++k) + { + EXPECT_EQ(seqan3::detail::ceil_log2(n), log2_value + 1u); + + if constexpr (seqan3::detail::sizeof_bits <= 32u) // known to fail for 64bit unsigned integers + { + EXPECT_EQ(std::ceil(std::log2(n)), log2_value + 1u) << "ceil_log2 of " << start << " should be " + << log2_value + << "; If this fails this might be a floating point" + << "rounding error on your machine."; + } + } + } +} + TEST(pow, unsigned_base) { EXPECT_EQ(0u, seqan3::pow(0u, 2u)); From 543d1f9a89a839679d6cf5dd67f4ccdefe882d2e Mon Sep 17 00:00:00 2001 From: marehr Date: Wed, 3 Jun 2020 00:28:53 +0200 Subject: [PATCH 08/19] [FIX] clang: use constexpr version of std::ceil(std::log2(x)) --- include/seqan3/range/container/bitcompressed_vector.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/seqan3/range/container/bitcompressed_vector.hpp b/include/seqan3/range/container/bitcompressed_vector.hpp index fb02f7a366..7edc54abf1 100644 --- a/include/seqan3/range/container/bitcompressed_vector.hpp +++ b/include/seqan3/range/container/bitcompressed_vector.hpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -65,7 +66,7 @@ class bitcompressed_vector { private: //!\brief The number of bits needed to represent a single letter of the alphabet_type. - static constexpr size_t bits_per_letter = std::ceil(std::log2(alphabet_size)); + static constexpr size_t bits_per_letter = detail::ceil_log2(alphabet_size); static_assert(bits_per_letter <= 64, "alphabet must be representable in at most 64bit."); From b53bba3b6a426173866997bf4867bd2c7ef2d609 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Mon, 24 Aug 2020 12:40:53 +0200 Subject: [PATCH 09/19] [INFRA] GitHub CI (#2034) * [INFRA] Github CI --- .github/workflows/ci.yml | 228 +++++++++++++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 229 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..0ff0c041bb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,228 @@ +name: SeqAn3 CI + +on: [push, pull_request] + +env: + CMAKE_VERSION: 3.7.2 + DOXYGEN_VERSION: 1.8.19 + SEQAN3_NO_VERSION_CHECK: 1 + TZ: Europe/Berlin + +jobs: + cancel: + name: "Cancel previous runs" + runs-on: ubuntu-20.04 + steps: + - uses: styfle/cancel-workflow-action@0.4.1 + with: + access_token: ${{ github.token }} + build: + needs: cancel + name: ${{ matrix.name }} + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + include: + - name: "Coverage gcc7" + requires_ubuntu_toolchain: true + requires_ccache: true + cxx: "g++-7" + cc: "gcc-7" + build: coverage + build_type: Debug + + - name: "Unit gcc9 (c++2a)" + requires_ubuntu_toolchain: true + requires_ccache: true + cxx: "g++-9" + cc: "gcc-9" + build: unit + build_type: Release + cxx_flags: "-std=c++2a" + + - name: "Unit gcc10 (c++17)" + requires_ubuntu_toolchain: true + requires_ccache: true + cxx: "g++-10" + cc: "gcc-10" + build: unit + build_type: Release + cxx_flags: "-std=c++17 -fconcepts" + + - name: "Unit gcc10 (c++20)" + requires_ubuntu_toolchain: true + requires_ccache: true + cxx: "g++-10" + cc: "gcc-10" + build: unit + build_type: Release + + - name: "Unit gcc8" + requires_ubuntu_toolchain: true + requires_ccache: true + cxx: "g++-8" + cc: "gcc-8" + build: unit + build_type: Release + + - name: "Unit gcc7" + requires_ubuntu_toolchain: true + requires_ccache: true + cxx: "g++-7" + cc: "gcc-7" + build: unit + build_type: Release + + - name: "Performance gcc7" + requires_ubuntu_toolchain: true + requires_ccache: true + cxx: "g++-7" + cc: "gcc-7" + build: performance + build_type: Release + + - name: "Header gcc7" + requires_ubuntu_toolchain: true + requires_ccache: true + cxx: "g++-7" + cc: "gcc-7" + build: header + build_type: Release + + - name: "Snippet gcc7" + requires_ubuntu_toolchain: true + requires_ccache: true + cxx: "g++-7" + cc: "gcc-7" + build: snippet + build_type: Release + + - name: "Documentation" + requires_ubuntu_toolchain: false + requires_ccache: false + build: documentation + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + path: seqan3 + submodules: true + + - name: Setup CMake + shell: bash + run: | + mkdir -p /tmp/cmake-download + wget --no-clobber --quiet --directory-prefix=/tmp/cmake-download/ https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz + tar -C /tmp/ -zxf /tmp/cmake-download/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz + echo "::add-path::/tmp/cmake-${CMAKE_VERSION}-Linux-x86_64/bin" # Only available in subsequent steps! + + - name: Setup Doxygen + if: matrix.build == 'documentation' + shell: bash + run: | + sudo apt-get install texlive-font-utils ghostscript texlive-latex-extra graphviz libclang-9-dev libclang-cpp9 # graphviz for dot, latex to parse formulas, libclang for doxygen + mkdir -p /tmp/doxygen-download + wget --no-clobber --quiet --directory-prefix=/tmp/doxygen-download/ https://sourceforge.net/projects/doxygen/files/rel-${DOXYGEN_VERSION}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz + tar -C /tmp/ -zxf /tmp/doxygen-download/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz + echo "::add-path::/tmp/doxygen-${DOXYGEN_VERSION}/bin" # Only available in subsequent steps! + + - name: Add package source + if: matrix.requires_ubuntu_toolchain + shell: bash + run: sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/ppa && sudo apt-get update + + - name: Install ccache + if: matrix.requires_ccache + shell: bash + run: sudo apt-get install --yes ccache + + - name: Install compiler ${{ matrix.cxx }} + if: matrix.requires_ubuntu_toolchain + shell: bash + run: sudo apt-get install --yes ${{ matrix.cxx }} + + - name: Install lcov + if: matrix.build == 'coverage' + shell: bash + run: | + sudo apt-get install --yes lcov + sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-7 100 + + - name: Prepare ccache + if: matrix.requires_ccache + id: ccache_prepare + shell: cmake -P {0} + run: | + string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S") + message("::set-output name=timestamp::${current_date}") + + - name: Load ccache + if: matrix.requires_ccache + uses: actions/cache@v1.1.0 + with: + path: .ccache + key: ${{ matrix.name }}-ccache-${{ steps.ccache_prepare.outputs.timestamp }} + restore-keys: | + ${{ matrix.name }}-ccache- + + - name: Configure tests + env: + CXX: ${{ matrix.cxx }} + CC: ${{ matrix.cc }} + shell: bash + run: | + mkdir seqan3-build + cd seqan3-build + cmake ../seqan3/test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" + if [[ "${{ matrix.build }}" =~ ^(unit|header|snippet|coverage)$ ]]; then + make gtest_project + fi + if [[ "${{ matrix.build }}" =~ ^(performance)$ ]]; then + make gbenchmark_project + fi + + - name: Build tests + env: + CCACHE_BASEDIR: ${{ github.workspace }} + CCACHE_DIR: ${{ github.workspace }}/.ccache + CCACHE_COMPRESS: true + CCACHE_COMPRESSLEVEL: 6 + CCACHE_MAXSIZE: 5G + shell: bash + run: | + ccache -p || true + cd seqan3-build + make -k -j2 + ccache -s || true + + - name: Run tests + shell: bash + run: | + cd seqan3-build + if [[ "${{ matrix.build }}" =~ ^(coverage)$ ]]; then + : ; else + if [[ "${{ matrix.build }}" =~ ^(snippet)$ ]]; then + ctest . --output-on-failure]; else + ctest . -j2 --output-on-failure + fi + fi + + - name: Submit coverage build + if: matrix.build == 'coverage' + shell: bash + run: bash <(curl -s https://codecov.io/bash) -f ./seqan3-build/seqan3_coverage -R ./seqan3 || echo 'Codecov failed to upload' + + - name: Package documentation + if: matrix.build == 'documentation' + continue-on-error: true + run: tar -zcf documentation.tar.gz seqan3-build + + - name: Upload documentation + if: matrix.build == 'documentation' + continue-on-error: true + uses: actions/upload-artifact@v2 + with: + name: documentation + path: documentation.tar.gz diff --git a/README.md b/README.md index b2f3d6e0c0..9366b9c9fd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # SeqAn3 -- the modern C++ library for sequence analysis -[![build status](https://img.shields.io/travis/seqan/seqan3/master.svg?logo=travis)](https://travis-ci.org/seqan/seqan3) +[![build status](https://github.com/seqan/seqan3/workflows/SeqAn3%20CI/badge.svg?branch=master)](https://github.com/seqan/seqan3/actions) [![codecov](https://codecov.io/gh/seqan/seqan3/branch/master/graph/badge.svg?logo=codecov)](https://codecov.io/gh/seqan/seqan3) [![license](https://img.shields.io/badge/license-BSD-green.svg)](https://docs.seqan.de/seqan/3-master-user/about_copyright.html) [![latest release](https://img.shields.io/github/release/seqan/seqan3.svg)](https://github.com/seqan/seqan3/releases/latest) From c4dffa82738a7ba2501520717187ae4fd78d36f7 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Mon, 24 Aug 2020 12:42:21 +0200 Subject: [PATCH 10/19] [INFRA] Deactivate travis --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index cc6845b024..c946e6c382 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,10 @@ os: linux dist: bionic language: cpp +branches: + only: + - master + git: submodules: true From 9e32fe3e06dddb51df9d345ce65a73a3fd944adb Mon Sep 17 00:00:00 2001 From: smehringer Date: Tue, 11 Aug 2020 12:14:43 +0200 Subject: [PATCH 11/19] [MISC] Add free end gap configuration to method_global calls. --- .../pa_assignment_3_solution.cpp | 6 +++- .../pairwise_alignment_solution_2.cpp | 6 +++- .../pairwise_alignment_solution_4.cpp | 8 +++-- .../pairwise_alignment_solution_5.cpp | 6 +++- .../read_mapper/read_mapper_step3.cpp | 6 +++- .../read_mapper/read_mapper_step4.cpp | 6 +++- doc/tutorial/search/search_solution5.cpp | 14 ++++++-- test/performance/io/format_sam_benchmark.cpp | 6 +++- .../configuration/align_cfg_edit_example.cpp | 12 +++++-- .../pairwise/alignment_configurator_test.cpp | 12 +++++-- .../fixture/semi_global_affine_banded.hpp | 21 +++++++++--- .../fixture/semi_global_affine_unbanded.hpp | 21 +++++++++--- .../semi_global_edit_distance_unbanded.hpp | 6 +++- .../semi_global_affine_banded_test.cpp | 33 +++++++++++++++++-- 14 files changed, 138 insertions(+), 25 deletions(-) diff --git a/doc/tutorial/pairwise_alignment/pa_assignment_3_solution.cpp b/doc/tutorial/pairwise_alignment/pa_assignment_3_solution.cpp index 301f997694..2ad915f188 100644 --- a/doc/tutorial/pairwise_alignment/pa_assignment_3_solution.cpp +++ b/doc/tutorial/pairwise_alignment/pa_assignment_3_solution.cpp @@ -27,7 +27,11 @@ int main() } // Configure the alignment kernel. - auto config = seqan3::align_cfg::method_global{} | + auto config = seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{false}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{false}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{true}} | seqan3::align_cfg::scoring_scheme{seqan3::aminoacid_scoring_scheme{ seqan3::aminoacid_similarity_matrix::BLOSUM62}} | seqan3::align_cfg::aligned_ends{seqan3::free_ends_second}; diff --git a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_2.cpp b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_2.cpp index 6345f9dca1..28048bd056 100644 --- a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_2.cpp +++ b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_2.cpp @@ -17,7 +17,11 @@ int main() "AGGTACGAGCGACACT"_dna4}; // Configure the alignment kernel. - auto config = seqan3::align_cfg::method_global{} | + auto config = seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{false}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{false}} | seqan3::align_cfg::scoring_scheme{seqan3::nucleotide_scoring_scheme{}} | seqan3::align_cfg::aligned_ends{seqan3::free_ends_first}; diff --git a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_4.cpp b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_4.cpp index db3cd9a032..5fa1742e87 100644 --- a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_4.cpp +++ b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_4.cpp @@ -18,8 +18,12 @@ int main() seqan3::align_cfg::output_end_position | seqan3::align_cfg::output_alignment; - // Configure the alignment kernel with the output. - auto config = seqan3::align_cfg::method_global{} | + // Configure the alignment kernel together with the previous output configuration. + auto config = seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{true}} | seqan3::align_cfg::scoring_scheme{seqan3::nucleotide_scoring_scheme{ seqan3::match_score{4}, seqan3::mismatch_score{-2}}} | seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{-4}}} | diff --git a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_5.cpp b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_5.cpp index fa77b31f81..f283ff469b 100644 --- a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_5.cpp +++ b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_5.cpp @@ -19,7 +19,11 @@ int main() seqan3::align_cfg::output_alignment; // Configure the alignment kernel. - auto config = seqan3::align_cfg::method_global{} | + auto config = seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{true}} | seqan3::align_cfg::scoring_scheme{seqan3::nucleotide_scoring_scheme{ seqan3::match_score{4}, seqan3::mismatch_score{-2}}} | seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{-4}}} | diff --git a/doc/tutorial/read_mapper/read_mapper_step3.cpp b/doc/tutorial/read_mapper/read_mapper_step3.cpp index 8064de1cce..5a5ea6617d 100644 --- a/doc/tutorial/read_mapper/read_mapper_step3.cpp +++ b/doc/tutorial/read_mapper/read_mapper_step3.cpp @@ -53,7 +53,11 @@ void map_reads(std::filesystem::path const & query_path, seqan3::search_cfg::hit_all_best; //! [alignment_config] - seqan3::configuration const align_config = seqan3::align_cfg::method_global{} | + seqan3::configuration const align_config = seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{false}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{false}} | seqan3::align_cfg::edit_scheme | seqan3::align_cfg::aligned_ends{seqan3::free_ends_first} | seqan3::align_cfg::result{seqan3::with_alignment}; diff --git a/doc/tutorial/read_mapper/read_mapper_step4.cpp b/doc/tutorial/read_mapper/read_mapper_step4.cpp index 10932f772f..dcbd7f6ae6 100644 --- a/doc/tutorial/read_mapper/read_mapper_step4.cpp +++ b/doc/tutorial/read_mapper/read_mapper_step4.cpp @@ -62,7 +62,11 @@ void map_reads(std::filesystem::path const & query_path, seqan3::search_cfg::error_count{errors}} | seqan3::search_cfg::hit_all_best; - seqan3::configuration const align_config = seqan3::align_cfg::method_global{} | + seqan3::configuration const align_config = seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{false}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{false}} | seqan3::align_cfg::edit_scheme | seqan3::align_cfg::aligned_ends{seqan3::free_ends_first} | seqan3::align_cfg::result{seqan3::with_alignment}; diff --git a/doc/tutorial/search/search_solution5.cpp b/doc/tutorial/search/search_solution5.cpp index 7c27b35d19..bf0baf33ec 100644 --- a/doc/tutorial/search/search_solution5.cpp +++ b/doc/tutorial/search/search_solution5.cpp @@ -19,7 +19,12 @@ void run_text_single() seqan3::configuration const search_config = seqan3::search_cfg::max_error_total{seqan3::search_cfg::error_count{1}} | seqan3::search_cfg::hit_all_best; - seqan3::configuration const align_config = seqan3::align_cfg::method_global{} | + + seqan3::configuration const align_config = seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{false}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{false}} | seqan3::align_cfg::edit_scheme | seqan3::align_cfg::aligned_ends{seqan3::free_ends_first} | seqan3::align_cfg::result{seqan3::with_alignment}; @@ -56,7 +61,12 @@ void run_text_collection() seqan3::configuration const search_config = seqan3::search_cfg::max_error_total{seqan3::search_cfg::error_count{1}} | seqan3::search_cfg::hit_all_best; - seqan3::configuration const align_config = seqan3::align_cfg::method_global{} | + + seqan3::configuration const align_config = seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{false}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{false}} | seqan3::align_cfg::edit_scheme | seqan3::align_cfg::aligned_ends{seqan3::free_ends_first} | seqan3::align_cfg::result{seqan3::with_alignment}; diff --git a/test/performance/io/format_sam_benchmark.cpp b/test/performance/io/format_sam_benchmark.cpp index 438a7ac3af..e33ca7e619 100644 --- a/test/performance/io/format_sam_benchmark.cpp +++ b/test/performance/io/format_sam_benchmark.cpp @@ -40,7 +40,11 @@ static std::string create_sam_file_string(size_t const n_queries) // align constexpr auto nt_score_scheme = seqan3::nucleotide_scoring_scheme{seqan3::match_score{4}, seqan3::mismatch_score{-2}}; - auto config = seqan3::align_cfg::method_global{} | + auto config = seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{false}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{false}} | seqan3::align_cfg::scoring_scheme{nt_score_scheme} | seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{-1}, seqan3::gap_open_score{-10}}} | seqan3::align_cfg::aligned_ends{seqan3::free_ends_first} | diff --git a/test/snippet/alignment/configuration/align_cfg_edit_example.cpp b/test/snippet/alignment/configuration/align_cfg_edit_example.cpp index 8841476018..fda1786c79 100644 --- a/test/snippet/alignment/configuration/align_cfg_edit_example.cpp +++ b/test/snippet/alignment/configuration/align_cfg_edit_example.cpp @@ -6,12 +6,20 @@ int main() { // Computes semi global edit distance using fast-bit vector algorithm. - auto cfg_fast = seqan3::align_cfg::method_global{} | + auto cfg_fast = seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{false}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{false}} | seqan3::align_cfg::edit_scheme | seqan3::align_cfg::aligned_ends{seqan3::free_ends_first}; // Computes semi global edit distance using slower standard pairwise algorithm. - auto cfg_slow = seqan3::align_cfg::method_global{} | + auto cfg_slow = seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{false}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{false}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{true}} | seqan3::align_cfg::edit_scheme | seqan3::align_cfg::aligned_ends{seqan3::free_ends_second}; diff --git a/test/unit/alignment/pairwise/alignment_configurator_test.cpp b/test/unit/alignment/pairwise/alignment_configurator_test.cpp index b2d771c984..6c41df5b6f 100644 --- a/test/unit/alignment/pairwise/alignment_configurator_test.cpp +++ b/test/unit/alignment/pairwise/alignment_configurator_test.cpp @@ -73,7 +73,11 @@ TEST(alignment_configurator, configure_edit_trace) TEST(alignment_configurator, configure_edit_semi) { - EXPECT_EQ(run_test(seqan3::align_cfg::method_global{} | + EXPECT_EQ(run_test(seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{false}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{false}} | seqan3::align_cfg::edit_scheme | seqan3::align_cfg::aligned_ends{seqan3::free_ends_first}).score(), 0); } @@ -186,7 +190,11 @@ TEST(alignment_configurator, configure_affine_global_banded_with_alignment) TEST(alignment_configurator, configure_affine_global_semi) { - auto cfg = seqan3::align_cfg::method_global{} | + auto cfg = seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{true}} | seqan3::align_cfg::scoring_scheme{seqan3::nucleotide_scoring_scheme{}} | seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{-1}, seqan3::gap_open_score{-10}}} | seqan3::align_cfg::aligned_ends{seqan3::free_ends_all}; diff --git a/test/unit/alignment/pairwise/fixture/semi_global_affine_banded.hpp b/test/unit/alignment/pairwise/fixture/semi_global_affine_banded.hpp index ce02696117..f56d126c92 100644 --- a/test/unit/alignment/pairwise/fixture/semi_global_affine_banded.hpp +++ b/test/unit/alignment/pairwise/fixture/semi_global_affine_banded.hpp @@ -27,14 +27,27 @@ using seqan3::operator""_dna4; namespace seqan3::test::alignment::fixture::semi_global::affine::banded { -inline constexpr auto align_config = seqan3::align_cfg::method_global{} | - seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{-1}, +inline constexpr auto align_config = seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{-1}, seqan3::gap_open_score{-10}}} | seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-4}, seqan3::align_cfg::upper_diagonal{8}}; -inline constexpr auto align_config_semi_seq1 = align_config | seqan3::align_cfg::aligned_ends{seqan3::free_ends_first}; -inline constexpr auto align_config_semi_seq2 = align_config | seqan3::align_cfg::aligned_ends{seqan3::free_ends_second}; +inline constexpr auto align_config_semi_seq1 = align_config | + seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{false}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{false} + } | + seqan3::align_cfg::aligned_ends{seqan3::free_ends_first}; +inline constexpr auto align_config_semi_seq2 = align_config | + seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{false}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{false}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{true} + } | + seqan3::align_cfg::aligned_ends{seqan3::free_ends_second}; static auto dna4_01_semi_first = []() { diff --git a/test/unit/alignment/pairwise/fixture/semi_global_affine_unbanded.hpp b/test/unit/alignment/pairwise/fixture/semi_global_affine_unbanded.hpp index 4fccff8aa6..464f421780 100644 --- a/test/unit/alignment/pairwise/fixture/semi_global_affine_unbanded.hpp +++ b/test/unit/alignment/pairwise/fixture/semi_global_affine_unbanded.hpp @@ -26,12 +26,25 @@ using seqan3::operator""_dna4; namespace seqan3::test::alignment::fixture::semi_global::affine::unbanded { -inline constexpr auto align_config = seqan3::align_cfg::method_global{} | - seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{-1}, +inline constexpr auto align_config = seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{-1}, seqan3::gap_open_score{-10}}}; -inline constexpr auto align_config_semi_seq1 = align_config | seqan3::align_cfg::aligned_ends{seqan3::free_ends_first}; -inline constexpr auto align_config_semi_seq2 = align_config | seqan3::align_cfg::aligned_ends{seqan3::free_ends_second}; +inline constexpr auto align_config_semi_seq1 = align_config | + seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{false}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{false} + } | + seqan3::align_cfg::aligned_ends{seqan3::free_ends_first}; +inline constexpr auto align_config_semi_seq2 = align_config | + seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{false}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{false}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{true} + } | + seqan3::align_cfg::aligned_ends{seqan3::free_ends_second}; static auto dna4_01_semi_first = []() { diff --git a/test/unit/alignment/pairwise/fixture/semi_global_edit_distance_unbanded.hpp b/test/unit/alignment/pairwise/fixture/semi_global_edit_distance_unbanded.hpp index 1c6e0cb9e9..556cd39c80 100644 --- a/test/unit/alignment/pairwise/fixture/semi_global_edit_distance_unbanded.hpp +++ b/test/unit/alignment/pairwise/fixture/semi_global_edit_distance_unbanded.hpp @@ -25,7 +25,11 @@ namespace seqan3::test::alignment::fixture::semi_global::edit_distance::unbanded using seqan3::detail::column_index_type; using seqan3::detail::row_index_type; -static constexpr auto semi_global_edit_distance = seqan3::align_cfg::method_global{} | +static constexpr auto semi_global_edit_distance = seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{false}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{false}} | seqan3::align_cfg::edit_scheme | seqan3::align_cfg::aligned_ends{seqan3::free_ends_first}; diff --git a/test/unit/alignment/pairwise/semi_global_affine_banded_test.cpp b/test/unit/alignment/pairwise/semi_global_affine_banded_test.cpp index bd9415a2a7..5e18167517 100644 --- a/test/unit/alignment/pairwise/semi_global_affine_banded_test.cpp +++ b/test/unit/alignment/pairwise/semi_global_affine_banded_test.cpp @@ -32,8 +32,7 @@ struct pairwise_semiglobal_affine_banded : public ::testing::Test auto base_config() const { - return seqan3::align_cfg::method_global{} | - seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{-1}, + return seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{-1}, seqan3::gap_open_score{-10}}} | seqan3::align_cfg::scoring_scheme{seqan3::nucleotide_scoring_scheme{seqan3::match_score{4}, seqan3::mismatch_score{-5}}}; @@ -43,6 +42,12 @@ struct pairwise_semiglobal_affine_banded : public ::testing::Test TEST_F(pairwise_semiglobal_affine_banded, invalid_band_lower_diagonal_greater_0) { auto config = base_config() | + seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{false}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{true} + } | seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{1}, seqan3::align_cfg::upper_diagonal{8}} | seqan3::align_cfg::aligned_ends{seqan3::end_gaps{seqan3::front_end_first{std::false_type{}}, @@ -57,6 +62,12 @@ TEST_F(pairwise_semiglobal_affine_banded, invalid_band_lower_diagonal_greater_0) TEST_F(pairwise_semiglobal_affine_banded, invalid_band_upper_diagonal_smaller_0) { auto config = base_config() | + seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{false}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{true} + } | seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-8}, seqan3::align_cfg::upper_diagonal{-1}} | seqan3::align_cfg::aligned_ends{seqan3::end_gaps{seqan3::front_end_first{std::true_type{}}, @@ -71,6 +82,12 @@ TEST_F(pairwise_semiglobal_affine_banded, invalid_band_upper_diagonal_smaller_0) TEST_F(pairwise_semiglobal_affine_banded, invalid_band_upper_diagonal_smaller_lower_diagonal) { auto config = base_config() | + seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{true} + } | seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{3}, seqan3::align_cfg::upper_diagonal{-3}} | seqan3::align_cfg::aligned_ends{seqan3::free_ends_all}; @@ -82,6 +99,12 @@ TEST_F(pairwise_semiglobal_affine_banded, invalid_band_upper_diagonal_smaller_lo TEST_F(pairwise_semiglobal_affine_banded, invalid_band_lower_diagonal_ends_in_last_column) { auto config = base_config() | + seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{true}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{false} + } | seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{4}, seqan3::align_cfg::upper_diagonal{8}} | seqan3::align_cfg::aligned_ends{seqan3::end_gaps{seqan3::front_end_first{std::true_type{}}, @@ -96,6 +119,12 @@ TEST_F(pairwise_semiglobal_affine_banded, invalid_band_lower_diagonal_ends_in_la TEST_F(pairwise_semiglobal_affine_banded, invalid_band_upper_diagonal_ends_in_last_row) { auto config = base_config() | + seqan3::align_cfg::method_global{ + seqan3::align_cfg::free_end_gaps_sequence1_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence2_leading{true}, + seqan3::align_cfg::free_end_gaps_sequence1_trailing{false}, + seqan3::align_cfg::free_end_gaps_sequence2_trailing{true} + } | seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-8}, seqan3::align_cfg::upper_diagonal{-4}} | seqan3::align_cfg::aligned_ends{seqan3::end_gaps{seqan3::front_end_first{std::true_type{}}, From 8800fcbcf633fa8af0a2821a301972376fb01114 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Mon, 24 Aug 2020 15:33:04 +0200 Subject: [PATCH 12/19] [INFRA] Add macOS to GitHub actions --- .github/workflows/ci.yml | 118 +++++++++++++++++++++++++++++++-------- 1 file changed, 95 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ff0c041bb..967aeacab5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,21 +19,33 @@ jobs: build: needs: cancel name: ${{ matrix.name }} - runs-on: ubuntu-20.04 + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: - name: "Coverage gcc7" - requires_ubuntu_toolchain: true + os: ubuntu-20.04 + requires_toolchain: true requires_ccache: true cxx: "g++-7" cc: "gcc-7" build: coverage build_type: Debug - - name: "Unit gcc9 (c++2a)" - requires_ubuntu_toolchain: true + - name: "Unit gcc9 (c++2a) on Linux" + os: ubuntu-20.04 + requires_toolchain: true + requires_ccache: true + cxx: "g++-9" + cc: "gcc-9" + build: unit + build_type: Release + cxx_flags: "-std=c++2a" + + - name: "Unit gcc9 (c++2a) on macOS" + os: macos-10.15 + requires_toolchain: true requires_ccache: true cxx: "g++-9" cc: "gcc-9" @@ -41,8 +53,9 @@ jobs: build_type: Release cxx_flags: "-std=c++2a" - - name: "Unit gcc10 (c++17)" - requires_ubuntu_toolchain: true + - name: "Unit gcc10 (c++17) on Linux" + os: ubuntu-20.04 + requires_toolchain: true requires_ccache: true cxx: "g++-10" cc: "gcc-10" @@ -50,24 +63,64 @@ jobs: build_type: Release cxx_flags: "-std=c++17 -fconcepts" - - name: "Unit gcc10 (c++20)" - requires_ubuntu_toolchain: true + - name: "Unit gcc10 (c++17) on macOS" + os: macos-10.15 + requires_toolchain: true + requires_ccache: true + cxx: "g++-10" + cc: "gcc-10" + build: unit + build_type: Release + cxx_flags: "-std=c++17 -fconcepts" + + - name: "Unit gcc10 (c++20) on Linux" + os: ubuntu-20.04 + requires_toolchain: true + requires_ccache: true + cxx: "g++-10" + cc: "gcc-10" + build: unit + build_type: Release + + - name: "Unit gcc10 (c++20) on macOS" + os: macos-10.15 + requires_toolchain: true requires_ccache: true cxx: "g++-10" cc: "gcc-10" build: unit build_type: Release - - name: "Unit gcc8" - requires_ubuntu_toolchain: true + - name: "Unit gcc8 on Linux" + os: ubuntu-20.04 + requires_toolchain: true + requires_ccache: true + cxx: "g++-8" + cc: "gcc-8" + build: unit + build_type: Release + + - name: "Unit gcc8 on macOS" + os: macos-10.15 + requires_toolchain: true requires_ccache: true cxx: "g++-8" cc: "gcc-8" build: unit build_type: Release - - name: "Unit gcc7" - requires_ubuntu_toolchain: true + - name: "Unit gcc7 on Linux" + os: ubuntu-20.04 + requires_toolchain: true + requires_ccache: true + cxx: "g++-7" + cc: "gcc-7" + build: unit + build_type: Release + + - name: "Unit gcc7 on macOS" + os: macos-10.15 + requires_toolchain: true requires_ccache: true cxx: "g++-7" cc: "gcc-7" @@ -75,7 +128,8 @@ jobs: build_type: Release - name: "Performance gcc7" - requires_ubuntu_toolchain: true + os: ubuntu-20.04 + requires_toolchain: true requires_ccache: true cxx: "g++-7" cc: "gcc-7" @@ -83,7 +137,8 @@ jobs: build_type: Release - name: "Header gcc7" - requires_ubuntu_toolchain: true + os: ubuntu-20.04 + requires_toolchain: true requires_ccache: true cxx: "g++-7" cc: "gcc-7" @@ -91,7 +146,8 @@ jobs: build_type: Release - name: "Snippet gcc7" - requires_ubuntu_toolchain: true + os: ubuntu-20.04 + requires_toolchain: true requires_ccache: true cxx: "g++-7" cc: "gcc-7" @@ -99,7 +155,8 @@ jobs: build_type: Release - name: "Documentation" - requires_ubuntu_toolchain: false + os: ubuntu-20.04 + requires_toolchain: false requires_ccache: false build: documentation @@ -113,10 +170,15 @@ jobs: - name: Setup CMake shell: bash run: | + if [ "$RUNNER_OS" == "Linux" ]; then + OS="Linux" + else + OS="Darwin" + fi mkdir -p /tmp/cmake-download - wget --no-clobber --quiet --directory-prefix=/tmp/cmake-download/ https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz - tar -C /tmp/ -zxf /tmp/cmake-download/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz - echo "::add-path::/tmp/cmake-${CMAKE_VERSION}-Linux-x86_64/bin" # Only available in subsequent steps! + wget --no-clobber --quiet --directory-prefix=/tmp/cmake-download/ https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-${OS}-x86_64.tar.gz + tar -C /tmp/ -zxf /tmp/cmake-download/cmake-${CMAKE_VERSION}-${OS}-x86_64.tar.gz + echo "::add-path::/tmp/cmake-${CMAKE_VERSION}-${OS}-x86_64/bin" # Only available in subsequent steps! - name: Setup Doxygen if: matrix.build == 'documentation' @@ -129,19 +191,29 @@ jobs: echo "::add-path::/tmp/doxygen-${DOXYGEN_VERSION}/bin" # Only available in subsequent steps! - name: Add package source - if: matrix.requires_ubuntu_toolchain + if: matrix.requires_toolchain && runner.os == 'Linux' shell: bash run: sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/ppa && sudo apt-get update - name: Install ccache if: matrix.requires_ccache shell: bash - run: sudo apt-get install --yes ccache + run: | + if [ "$RUNNER_OS" == "Linux" ]; then + sudo apt-get install --yes ccache + else + brew install --force-bottle ccache + fi - name: Install compiler ${{ matrix.cxx }} - if: matrix.requires_ubuntu_toolchain + if: matrix.requires_toolchain shell: bash - run: sudo apt-get install --yes ${{ matrix.cxx }} + run: | + if [ "$RUNNER_OS" == "Linux" ]; then + sudo apt-get install --yes ${{ matrix.cxx }} + else + brew install --force-bottle $(echo "${{ matrix.cxx }}" | sed "s/++-/cc@/g") + fi - name: Install lcov if: matrix.build == 'coverage' From 87c4c8b7b7ae625ad0790b561d59b638e926037e Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Mon, 24 Aug 2020 15:48:40 +0200 Subject: [PATCH 13/19] [INFRA] Deactivate jenkins --- .jenkinsfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.jenkinsfile b/.jenkinsfile index c9dc592244..534caf0244 100644 --- a/.jenkinsfile +++ b/.jenkinsfile @@ -280,9 +280,12 @@ for (int h = 0; h < axis_agent.size(); ++h) // This is the main stage that executes all jobs registered in the tasks map // All steps are executed in parallel. If the contention on the agents are to high // consider moving some tasks out into another stage that runs after this one. -stage ("matrix") +if (is_nightly) { - parallel tasks + stage ("matrix") + { + parallel tasks + } } // ============================================================================ From 8d180fde67b66b90c0f695f5d1e71bcfb685c2b1 Mon Sep 17 00:00:00 2001 From: marehr Date: Mon, 24 Aug 2020 15:23:29 +0200 Subject: [PATCH 14/19] [DOC] filesystem module description --- include/seqan3/std/filesystem | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/seqan3/std/filesystem b/include/seqan3/std/filesystem index 71fc4e008e..f22eca35b2 100644 --- a/include/seqan3/std/filesystem +++ b/include/seqan3/std/filesystem @@ -7,7 +7,8 @@ // ----------------------------------------------------------------------------------------------------- /*!\file - * \brief This header includes C++17 filesystem support and imports it into namespace seqan3::filesystem (independent of whether it is marked as "experimental"). + * \brief This header includes C++17 filesystem support and imports it into namespace std::filesystem (independent of + * whether it is marked as "experimental"). * \author Vitor C. Piro */ From b06d4636792d4f0b68f4ff4b80a7bad5f6ff6605 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Tue, 25 Aug 2020 12:10:08 +0200 Subject: [PATCH 15/19] [FIX] Type comparison error on macOS --- .../core/type_traits/range_iterator_test.cpp | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/test/unit/core/type_traits/range_iterator_test.cpp b/test/unit/core/type_traits/range_iterator_test.cpp index 008deca9cc..b17a54819c 100644 --- a/test/unit/core/type_traits/range_iterator_test.cpp +++ b/test/unit/core/type_traits/range_iterator_test.cpp @@ -159,13 +159,19 @@ TEST(range_and_iterator, difference_type) //TODO(h-2): add something that actually has a different difference_type using iterator_of_int_vector = std::ranges::iterator_t>; using foreign_iterator = seqan3::detail::random_access_iterator>; - auto v = std::views::iota(1); using type_list_example = seqan3::type_list>, // short typename std::vector::difference_type, // member type std::ranges::range_difference_t const>, // const container std::iter_difference_t, // iterator - std::iter_difference_t, // iterator2 - std::ranges::range_difference_t>; // range, no member + std::iter_difference_t>; // range, no member + + using comp_list = seqan3::type_list; + + expect_same_types(); // views::ints' difference_type is not std::ptrdiff_t, but depends on the size. // For infinite views, like in our case, it's std::int_fast64_t (or std::int_fast32_t on 32bit). @@ -177,14 +183,10 @@ TEST(range_and_iterator, difference_type) std::int_fast64_t, std::int_fast32_t>; - using comp_list = seqan3::type_list; - - expect_same_types(); + auto v = std::views::iota(1); + using iota_difference_t = std::ranges::range_difference_t; + EXPECT_TRUE((std::signed_integral)); + EXPECT_EQ(sizeof(iota_difference_t), sizeof(view_int_diff_t)); } TEST(range_and_iterator, size_type) From 0072a04c478981bd86fbdce6ed07327a01008c29 Mon Sep 17 00:00:00 2001 From: smehringer Date: Tue, 11 Aug 2020 12:21:28 +0200 Subject: [PATCH 16/19] [MISC] Use method_global free_end gap config in policies. --- .../detail/policy_affine_gap_recursion.hpp | 6 ++--- .../detail/policy_alignment_matrix.hpp | 27 +++++++------------ .../detail/policy_optimum_tracker.hpp | 8 +++--- 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/include/seqan3/alignment/pairwise/detail/policy_affine_gap_recursion.hpp b/include/seqan3/alignment/pairwise/detail/policy_affine_gap_recursion.hpp index d0fc862c57..2404527a52 100644 --- a/include/seqan3/alignment/pairwise/detail/policy_affine_gap_recursion.hpp +++ b/include/seqan3/alignment/pairwise/detail/policy_affine_gap_recursion.hpp @@ -98,9 +98,9 @@ class policy_affine_gap_recursion gap_open_score = static_cast(selected_gap_scheme.get_gap_open_score()) + gap_extension_score; } - auto align_ends_config = config.get_or(align_cfg::aligned_ends{free_ends_none}).value; - first_row_is_free = align_ends_config[0]; - first_column_is_free = align_ends_config[2]; + auto method_global_config = config.get_or(align_cfg::method_global{}); + first_row_is_free = method_global_config.free_end_gaps_sequence1_leading; + first_column_is_free = method_global_config.free_end_gaps_sequence2_leading; } //!\} diff --git a/include/seqan3/alignment/pairwise/detail/policy_alignment_matrix.hpp b/include/seqan3/alignment/pairwise/detail/policy_alignment_matrix.hpp index 3ab995b345..a162f701e8 100644 --- a/include/seqan3/alignment/pairwise/detail/policy_alignment_matrix.hpp +++ b/include/seqan3/alignment/pairwise/detail/policy_alignment_matrix.hpp @@ -100,23 +100,20 @@ class policy_alignment_matrix bool invalid_band = upper_diagonal < lower_diagonal; std::string error_cause = (invalid_band) ? " The upper diagonal is smaller than the lower diagonal." : ""; - if constexpr (traits_t::with_free_end_gaps) + + if constexpr (traits_t::is_global) { - auto aligned_ends_config = seqan3::get(config).value; - bool first_row_is_free = aligned_ends_config[0]; - bool first_column_is_free = aligned_ends_config[2]; + auto method_global_config = get(config); + + bool first_row_is_free = method_global_config.free_end_gaps_sequence1_leading; + bool first_column_is_free = method_global_config.free_end_gaps_sequence2_leading; - last_row_is_free = aligned_ends_config[1]; - last_column_is_free = aligned_ends_config[3]; + last_row_is_free = method_global_config.free_end_gaps_sequence1_trailing; + last_column_is_free = method_global_config.free_end_gaps_sequence2_trailing; // band starts in first column without free gaps or band starts in first row without free gaps. invalid_band |= (upper_diagonal < 0 && !first_column_is_free) || (lower_diagonal > 0 && !first_row_is_free); error_cause += " The band starts in a region without free gaps."; } - else if constexpr (traits_t::is_global) - { - invalid_band |= (upper_diagonal < 0 || lower_diagonal > 0); - error_cause += " The first cell of the matrix is not enclosed by the band."; - } if (invalid_band) throw invalid_alignment_configuration{"The selected band [" + std::to_string(lower_diagonal) + ":" + @@ -193,18 +190,14 @@ class policy_alignment_matrix bool invalid_band = false; std::string error_cause{}; - if constexpr (traits_t::with_free_end_gaps) + + if constexpr (traits_t::is_global) { // band ends in last column without free gaps or band ends in last row without free gaps. invalid_band |= (lower_diagonal_ends_behind_last_cell && !last_column_is_free) || (upper_diagonal_ends_before_last_cell && !last_row_is_free); error_cause = "The band ends in a region without free gaps."; } - else if constexpr (traits_t::is_global) - { - invalid_band |= (upper_diagonal_ends_before_last_cell || lower_diagonal_ends_behind_last_cell); - error_cause = "The last cell of the matrix is not enclosed by the band."; - } if (invalid_band) throw invalid_alignment_configuration{"The selected band [" + std::to_string(lower_diagonal) + ":" + diff --git a/include/seqan3/alignment/pairwise/detail/policy_optimum_tracker.hpp b/include/seqan3/alignment/pairwise/detail/policy_optimum_tracker.hpp index 6a0dfa7c2a..953a56fd1b 100644 --- a/include/seqan3/alignment/pairwise/detail/policy_optimum_tracker.hpp +++ b/include/seqan3/alignment/pairwise/detail/policy_optimum_tracker.hpp @@ -133,14 +133,14 @@ class policy_optimum_tracker * * \details * - * Reads the state of seqan3::align_cfg::aligned_ends and enables the tracking of the last row or column if + * Reads the state of seqan3::align_cfg::method_global and enables the tracking of the last row or column if * requested. Otherwise, only the last cell will be tracked. */ policy_optimum_tracker(alignment_configuration_t const & config) { - auto align_ends_config = config.get_or(align_cfg::aligned_ends{free_ends_none}).value; - test_last_row_cell = align_ends_config[1]; - test_last_column_cell = align_ends_config[3]; + auto method_global_config = config.get_or(align_cfg::method_global{}); + test_last_row_cell = method_global_config.free_end_gaps_sequence1_trailing; + test_last_column_cell = method_global_config.free_end_gaps_sequence2_trailing; } //!\} From 0eefbab8ddf1e05880e4f5812370083e6611e3d4 Mon Sep 17 00:00:00 2001 From: simonsasse <59832939+simonsasse@users.noreply.github.com> Date: Thu, 27 Aug 2020 14:19:15 +0200 Subject: [PATCH 17/19] [Alignment Configuration] Rename align_cfg::alignment_result_capture to align_cfg::detail::result_type (#2031) * [Alignment Configuration] Rename align_cfg::alignment_result_capture to align_cfg::detail::result_type * Update include/seqan3/alignment/configuration/align_config_vectorised.hpp Co-authored-by: Marcel --- ...pture.hpp => align_config_result_type.hpp} | 20 +++--- .../seqan3/alignment/configuration/all.hpp | 2 +- .../seqan3/alignment/configuration/detail.hpp | 72 +++++++++---------- .../pairwise/alignment_configurator.hpp | 5 +- .../alignment/pairwise/detail/type_traits.hpp | 6 +- .../edit_distance_unbanded_benchmark.cpp | 4 +- .../align_config_common_test.cpp | 2 +- .../edit_distance_unbanded_test_template.hpp | 4 +- 8 files changed, 57 insertions(+), 58 deletions(-) rename include/seqan3/alignment/configuration/{align_config_alignment_result_capture.hpp => align_config_result_type.hpp} (82%) diff --git a/include/seqan3/alignment/configuration/align_config_alignment_result_capture.hpp b/include/seqan3/alignment/configuration/align_config_result_type.hpp similarity index 82% rename from include/seqan3/alignment/configuration/align_config_alignment_result_capture.hpp rename to include/seqan3/alignment/configuration/align_config_result_type.hpp index 341d917bc8..995a9289e7 100644 --- a/include/seqan3/alignment/configuration/align_config_alignment_result_capture.hpp +++ b/include/seqan3/alignment/configuration/align_config_result_type.hpp @@ -6,7 +6,7 @@ // ----------------------------------------------------------------------------------------------------- /*!\file - * \brief Provides seqan3::align_cfg::alignment_result_capture. + * \brief Provides seqan3::align_cfg::detail::result_type and seqan3::detail::result_type_tag. * \author Rene Rahn */ @@ -28,25 +28,23 @@ namespace seqan3::detail * * \details * - * Implementation of the alignment result capture config. + * Implementation of the alignment result type config. * - * \see seqan3::align_cfg::alignment_result_capture + * \see seqan3::align_cfg::detail::result_type */ template //!\cond requires is_type_specialisation_of_v //!\endcond -struct alignment_result_capture_element : - public pipeable_config_element, - std::type_identity> +struct result_type_tag : + public pipeable_config_element, std::type_identity> { //!\brief Internal id to check for consistent configuration settings. - static constexpr detail::align_config_id id{detail::align_config_id::alignment_result_capture}; + static constexpr detail::align_config_id id{detail::align_config_id::result_type}; }; - } // namespace seqan3::detail -namespace seqan3::align_cfg +namespace seqan3::align_cfg::detail { /*!\if DEV * \brief Configuration element capturing the configured seqan3::alignment_result for the alignment algorithm. @@ -73,5 +71,5 @@ template //!\cond requires seqan3::detail::is_type_specialisation_of_v //!\endcond -inline constexpr seqan3::detail::alignment_result_capture_element alignment_result_capture{}; -} // namespace seqan3::align_cfg +inline constexpr seqan3::detail::result_type_tag result_type{}; +} // namespace seqan3::align_cfg::detail diff --git a/include/seqan3/alignment/configuration/all.hpp b/include/seqan3/alignment/configuration/all.hpp index 5a0ca47e44..b079605b32 100644 --- a/include/seqan3/alignment/configuration/all.hpp +++ b/include/seqan3/alignment/configuration/all.hpp @@ -13,7 +13,7 @@ #pragma once #include -#include +#include #include #include #include diff --git a/include/seqan3/alignment/configuration/detail.hpp b/include/seqan3/alignment/configuration/detail.hpp index 561d5ba7ba..9d23772104 100644 --- a/include/seqan3/alignment/configuration/detail.hpp +++ b/include/seqan3/alignment/configuration/detail.hpp @@ -22,8 +22,7 @@ namespace seqan3::detail */ enum struct align_config_id : uint8_t { - //!\brief ID for the \ref seqan3::align_cfg::alignment_result_capture "alignment_result_capture" option. - alignment_result_capture, + aligned_ends, //!< ID for the \ref seqan3::align_cfg::aligned_ends "aligned_ends" option. band, //!< ID for the \ref seqan3::align_cfg::band_fixed_size "band" option. debug, //!< ID for the \ref seqan3::align_cfg::detail::debug "debug" option. @@ -40,6 +39,7 @@ enum struct align_config_id : uint8_t output_score, //!< ID for the \ref seqan3::align_cfg::output_score "score output" option. parallel, //!< ID for the \ref seqan3::align_cfg::parallel "parallel" option. result, //!< ID for the \ref seqan3::align_cfg::result "result" option. + result_type, //!< ID for the \ref seqan3::align_cfg::detail::result_type "result_type" option. scoring, //!< ID for the \ref seqan3::align_cfg::scoring_scheme "scoring_scheme" option. vectorised, //!< ID for the \ref seqan3::align_cfg::vectorised "vectorised" option. SIZE //!< Represents the number of configuration elements. @@ -58,42 +58,42 @@ template <> inline constexpr std::array(align_config_id::SIZE)>, static_cast(align_config_id::SIZE)> compatibility_table { - { //alignment_result_capture - //| aligned_ends - //| | band - //| | | debug - //| | | | gap - //| | | | | global - //| | | | | | local - //| | | | | | | max_error - //| | | | | | | | on_result - //| | | | | | | | | output_alignment - //| | | | | | | | | | output_begin_position - //| | | | | | | | | | | output_end_position - //| | | | | | | | | | | | output_sequence1_id - //| | | | | | | | | | | | | output_sequence2_id - //| | | | | | | | | | | | | | output_score - //| | | | | | | | | | | | | | | parallel - //| | | | | | | | | | | | | | | | result + { //aligned_ends + //| band + //| | debug + //| | | gap + //| | | | global + //| | | | | local + //| | | | | | max_error + //| | | | | | | on_result + //| | | | | | | | output_alignment + //| | | | | | | | | output_begin_position + //| | | | | | | | | | output_end_position + //| | | | | | | | | | | output_sequence1_id + //| | | | | | | | | | | | output_sequence2_id + //| | | | | | | | | | | | | output_score + //| | | | | | | | | | | | | | parallel + //| | | | | | | | | | | | | | | result + //| | | | | | | | | | | | | | | | result_type //| | | | | | | | | | | | | | | | | scoring //| | | | | | | | | | | | | | | | | | vectorised - { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 0: alignment_result_capture - { 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 1: aligned_ends - { 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 2: band - { 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 3: debug - { 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 4: gap - { 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 5: global - { 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 6: local - { 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 7: max_error - { 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 8: on_result - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 9: output_alignment - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1}, // 10: output_begin_position - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1}, // 11: output_end_position - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1}, // 12: output_sequence1_id - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1}, // 13: output_sequence2_id - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1}, // 14: output_score - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1}, // 15: parallel - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1}, // 16: result + { 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 0: aligned_ends + { 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 1: band + { 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 2: debug + { 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 3: gap + { 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 4: global + { 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 5: local + { 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 6: max_error + { 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 7: on_result + { 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 8: output_alignment + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 9: output_begin_position + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1}, // 10: output_end_position + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1}, // 11: output_sequence1_id + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1}, // 12: output_sequence2_id + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1}, // 13: output_score + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1}, // 14: parallel + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1}, // 15: result + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1}, // 16: result_type { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}, // 17: scoring { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0} // 18: vectorised } diff --git a/include/seqan3/alignment/pairwise/alignment_configurator.hpp b/include/seqan3/alignment/pairwise/alignment_configurator.hpp index a877286849..60abbcdf9e 100644 --- a/include/seqan3/alignment/pairwise/alignment_configurator.hpp +++ b/include/seqan3/alignment/pairwise/alignment_configurator.hpp @@ -17,8 +17,9 @@ #include #include -#include + #include +#include #include #include #include @@ -295,7 +296,7 @@ struct alignment_configurator using function_wrapper_t = std::function; // Capture the alignment result type. - auto config_with_result_type = config_with_output | align_cfg::alignment_result_capture; + auto config_with_result_type = config_with_output | align_cfg::detail::result_type; // ---------------------------------------------------------------------------- // Test some basic preconditions diff --git a/include/seqan3/alignment/pairwise/detail/type_traits.hpp b/include/seqan3/alignment/pairwise/detail/type_traits.hpp index 44552f94d6..4620adcc04 100644 --- a/include/seqan3/alignment/pairwise/detail/type_traits.hpp +++ b/include/seqan3/alignment/pairwise/detail/type_traits.hpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -103,10 +103,10 @@ struct alignment_configuration_traits //!\brief Helper function to determine the alignment result type. static constexpr auto determine_alignment_result_type() noexcept { - if constexpr (configuration_t::template exists()) + if constexpr (configuration_t::template exists()) { using wrapped_result_t = - decltype(seqan3::get(std::declval()).value); + decltype(seqan3::get(std::declval()).value); return typename wrapped_result_t::type{}; // Unwrap the type_identity. } else diff --git a/test/performance/alignment/edit_distance_unbanded_benchmark.cpp b/test/performance/alignment/edit_distance_unbanded_benchmark.cpp index 565c1be82f..5340245eaf 100644 --- a/test/performance/alignment/edit_distance_unbanded_benchmark.cpp +++ b/test/performance/alignment/edit_distance_unbanded_benchmark.cpp @@ -71,7 +71,7 @@ void seqan3_edit_distance_dna4(benchmark::State & state) using alignment_result_t = alignment_result_type_t; auto edit_distance_cfg_with_result_type = edit_distance_cfg | - seqan3::align_cfg::alignment_result_capture; + seqan3::align_cfg::detail::result_type; using edit_traits_t = seqan3::detail::default_edit_distance_trait_type; auto edit_distance_cfg_with_result_type = edit_distance_cfg | - seqan3::align_cfg::alignment_result_capture; + seqan3::align_cfg::detail::result_type; using edit_traits_t = seqan3::detail::default_edit_distance_trait_type, seqan3::align_cfg::scoring_scheme>, seqan3::detail::vectorised_tag, - seqan3::detail::alignment_result_capture_element>; + seqan3::detail::result_type_tag>; TYPED_TEST_SUITE(alignment_configuration_test, test_types, ); diff --git a/test/unit/alignment/pairwise/edit_distance_unbanded_test_template.hpp b/test/unit/alignment/pairwise/edit_distance_unbanded_test_template.hpp index 8a9eabdfcd..f76f86cb92 100644 --- a/test/unit/alignment/pairwise/edit_distance_unbanded_test_template.hpp +++ b/test/unit/alignment/pairwise/edit_distance_unbanded_test_template.hpp @@ -9,7 +9,7 @@ #include -#include +#include #include #include @@ -94,7 +94,7 @@ auto edit_distance(database_t && database, query_t && query, align_cfg_t && alig std::remove_reference_t>::type; using alignment_result_t = seqan3::alignment_result; auto align_cfg_with_result_type = align_cfg_with_score_type | - seqan3::align_cfg::alignment_result_capture; + seqan3::align_cfg::detail::result_type; using align_config_with_result_type_t = decltype(align_cfg_with_result_type); using edit_traits = edit_traits_type Date: Thu, 27 Aug 2020 20:25:09 +0200 Subject: [PATCH 18/19] [FIX,DOCS] Restrict image folders --- test/documentation/seqan3_doxygen_cfg.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/documentation/seqan3_doxygen_cfg.in b/test/documentation/seqan3_doxygen_cfg.in index f094d791eb..9f89352cb4 100644 --- a/test/documentation/seqan3_doxygen_cfg.in +++ b/test/documentation/seqan3_doxygen_cfg.in @@ -16,7 +16,8 @@ INPUT = ${SEQAN3_DOXYGEN_SOURCE_DIR}/include \ STRIP_FROM_PATH = ${SEQAN3_DOXYGEN_SOURCE_DIR}/include STRIP_FROM_INC_PATH = ${SEQAN3_DOXYGEN_SOURCE_DIR}/include EXAMPLE_PATH = ${SEQAN3_DOXYGEN_SOURCE_DIR} -IMAGE_PATH = ${SEQAN3_DOXYGEN_SOURCE_DIR} +IMAGE_PATH = ${SEQAN3_DOXYGEN_SOURCE_DIR}/doc \ + ${SEQAN3_DOXYGEN_SOURCE_DIR}/test/documentation ## DOT SUPPORT HAVE_DOT = ${SEQAN3_DOXYGEN_HAVE_DOT} From 7726965ac562b87df7826e17759f91a193c4ad30 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Tue, 25 Aug 2020 17:17:22 +0200 Subject: [PATCH 19/19] [INFRA] Run CI with SeqAn2 included --- .github/workflows/ci.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 967aeacab5..5a37fabf24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,12 +161,19 @@ jobs: build: documentation steps: - - name: Checkout + - name: Checkout SeqAn3 uses: actions/checkout@v2 with: path: seqan3 submodules: true + - name: Checkout SeqAn2 + uses: actions/checkout@v2 + with: + repository: seqan/seqan + ref: develop + path: seqan3/submodules/seqan + - name: Setup CMake shell: bash run: |