BioC++ core-0.7.0
The Modern C++ libraries for Bioinformatics.
 
Loading...
Searching...
No Matches
complement.hpp
Go to the documentation of this file.
1// -----------------------------------------------------------------------------------------------------
2// Copyright (c) 2022 deCODE Genetics
3// Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
4// Copyright (c) 2016-2020, Knut Reinert & MPI für molekulare Genetik
5// This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
6// shipped with this file and also available at: https://github.com/biocpp/biocpp-core/blob/main/LICENSE.md
7// -----------------------------------------------------------------------------------------------------
8
14#pragma once
15
16#include <ranges>
17
20
21namespace bio::ranges::views
22{
23
71inline auto const complement = deep{std::views::transform(
72 [](auto const in)
73 {
74 static_assert(alphabet::nucleotide<decltype(in)>,
75 "The innermost value type must satisfy the alphabet::nucleotide.");
76 // call element-wise complement from the nucleotide
78 })};
79
81
82} // namespace bio::ranges::views
Provides bio::alphabet::nucleotide.
A wrapper type around an existing view adaptor that enables "deep view" behaviour for that view.
Definition: deep.hpp:104
A concept that indicates whether an alphabet represents nucleotides.
Definition: concept.hpp:113
Provides bio::views::deep.
constexpr auto complement
Return the complement of a nucleotide object.
Definition: concept.hpp:68
auto const complement
A view that converts a range of nucleotides to their complement.
Definition: complement.hpp:71
The BioC++ namespace for views.