Loading...
Searching...
No Matches
structured_aa.hpp
Go to the documentation of this file.
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <seqan3/alphabet/aminoacid/aa27.hpp>
#include <seqan3/alphabet/composite/alphabet_tuple_base.hpp>
#include <seqan3/alphabet/concept.hpp>
#include <seqan3/alphabet/structure/dssp9.hpp>
namespace seqan3
{
template <writable_alphabet sequence_alphabet_t = aa27, writable_alphabet structure_alphabet_t = dssp9>
requires (!std::is_reference_v<sequence_alphabet_t>) && (!std::is_reference_v<structure_alphabet_t>)
class structured_aa :
public alphabet_tuple_base<structured_aa<sequence_alphabet_t, structure_alphabet_t>,
sequence_alphabet_t,
structure_alphabet_t>
{
private:
using base_type = alphabet_tuple_base<structured_aa<sequence_alphabet_t, structure_alphabet_t>,
sequence_alphabet_t,
structure_alphabet_t>;
public:
using sequence_alphabet_type = sequence_alphabet_t;
using structure_alphabet_type = structure_alphabet_t;
using char_type = alphabet_char_t<sequence_alphabet_type>;
constexpr structured_aa() noexcept = default;
constexpr structured_aa(structured_aa const &) noexcept = default;
constexpr structured_aa(structured_aa &&) noexcept = default;
constexpr structured_aa & operator=(structured_aa const &) noexcept = default;
constexpr structured_aa & operator=(structured_aa &&) noexcept = default;
~structured_aa() noexcept = default;
using base_type::base_type; // Inherit non-default constructors
#if SEQAN3_DOXYGEN_ONLY(1) 0
template <typename component_type>
constexpr structured_aa(component_type const alph)
{}
template <typename indirect_component_type>
constexpr structured_aa(indirect_component_type const alph)
{}
template <typename component_type>
constexpr structured_aa & operator=(component_type const alph)
{}
template <typename indirect_component_type>
constexpr structured_aa & operator=(indirect_component_type const alph)
{}
#endif
using base_type::operator=;
constexpr structured_aa & assign_char(char_type const c) noexcept
{
seqan3::assign_char_to(c, get<0>(*this));
return *this;
}
constexpr char_type to_char() const noexcept
{
return seqan3::to_char(get<0>(*this));
}
static constexpr bool char_is_valid(char_type const c) noexcept
{
return char_is_valid_for<sequence_alphabet_type>(c);
}
};
template <typename sequence_alphabet_type, typename structure_alphabet_type>
structured_aa(sequence_alphabet_type &&, structure_alphabet_type &&)
-> structured_aa<std::decay_t<sequence_alphabet_type>, std::decay_t<structure_alphabet_type>>;
} // namespace seqan3
aa27.hpp
Provides seqan3::aa27, container aliases and string literals.
concept.hpp
Core alphabet concept and free function/type trait wrappers.
alphabet_tuple_base.hpp
Provides seqan3::alphabet_tuple_base.
seqan3::alphabet_tuple_base< structured_aa< sequence_alphabet_t, structure_alphabet_t >, sequence_alphabet_t, structure_alphabet_t >::get
friend constexpr auto get(alphabet_tuple_base &l) noexcept
Definition alphabet_tuple_base.hpp:345
seqan3::structured_aa::structured_aa
constexpr structured_aa(component_type const alph)
Construction via a value of one of the components.
Definition structured_aa.hpp:97
seqan3::structured_aa::sequence_alphabet_type
sequence_alphabet_t sequence_alphabet_type
First template parameter as member type.
Definition structured_aa.hpp:64
seqan3::structured_aa::to_char
constexpr char_type to_char() const noexcept
Return a character. This reads the internal sequence letter.
Definition structured_aa.hpp:159
seqan3::structured_aa::operator=
constexpr structured_aa & operator=(component_type const alph)
Assignment via a value of one of the components.
Definition structured_aa.hpp:117
seqan3::structured_aa::char_is_valid
static constexpr bool char_is_valid(char_type const c) noexcept
Validate whether a character is valid in the sequence alphabet.
Definition structured_aa.hpp:169
seqan3::structured_aa::structure_alphabet_type
structure_alphabet_t structure_alphabet_type
Second template parameter as member type.
Definition structured_aa.hpp:69
seqan3::structured_aa::structured_aa
constexpr structured_aa() noexcept=default
Defaulted.
seqan3::structured_aa::char_type
alphabet_char_t< sequence_alphabet_type > char_type
Equals the char_type of sequence_alphabet_type.
Definition structured_aa.hpp:75
seqan3::structured_aa::operator=
constexpr structured_aa & operator=(indirect_component_type const alph)
Assignment via a value of a subtype that is assignable to one of the components.
Definition structured_aa.hpp:127
seqan3::structured_aa::structured_aa
constexpr structured_aa(indirect_component_type const alph)
Construction via a value of a subtype that is assignable to one of the components.
Definition structured_aa.hpp:107
seqan3::structured_aa::assign_char
constexpr structured_aa & assign_char(char_type const c) noexcept
Assign from a nucleotide character. This modifies the internal sequence letter.
Definition structured_aa.hpp:145
seqan3::structured_aa::structured_aa
structured_aa(sequence_alphabet_type &&, structure_alphabet_type &&) -> structured_aa< std::decay_t< sequence_alphabet_type >, std::decay_t< structure_alphabet_type > >
Type deduction guide enables usage of structured_aa without specifying template args.
std::decay_t
dssp9.hpp
Provides the dssp format for protein structure.
seqan3::assign_char_to
constexpr auto assign_char_to
Assign a character to an alphabet object.
Definition alphabet/concept.hpp:517
seqan3::to_char
constexpr auto to_char
Return the char representation of an alphabet object.
Definition alphabet/concept.hpp:381
seqan3::alphabet_char_t
decltype(seqan3::to_char(std::declval< alphabet_type const >())) alphabet_char_t
The char_type of the alphabet; defined as the return type of seqan3::to_char.
Definition alphabet/concept.hpp:393
seqan3::char_is_valid_for
constexpr auto char_is_valid_for
Returns whether a character is in the valid set of a seqan3::alphabet (usually implies a bijective ma...
Definition alphabet/concept.hpp:661
std::is_reference_v
T is_reference_v
seqan3
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
Hide me