SeqAn3 3.2.0
The Modern C++ library for sequence analysis.
record.hpp
Go to the documentation of this file.
1// -----------------------------------------------------------------------------------------------------
2// Copyright (c) 2006-2022, Knut Reinert & Freie Universität Berlin
3// Copyright (c) 2016-2022, 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 <seqan3/io/record.hpp>
16
17namespace seqan3
18{
27template <typename field_types, typename field_ids>
28class structure_record : public record<field_types, field_ids>
29{
32
34 using tuple_base_t = typename base_t::base_type;
35
37 template <field f>
38 using field_constant = typename base_t::template field_constant<f>;
39
40 using base_t::get_impl;
41
42public:
46 structure_record() = default;
51 ~structure_record() = default;
52
54 using base_t::base_t;
56
58 decltype(auto) id() &&
59 {
60 return get_impl(field_constant<seqan3::field::id>{}, static_cast<tuple_base_t &&>(*this));
61 }
63 decltype(auto) id() const &&
64 {
65 return get_impl(field_constant<seqan3::field::id>{}, static_cast<tuple_base_t const &&>(*this));
66 }
68 decltype(auto) id() &
69 {
70 return get_impl(field_constant<seqan3::field::id>{}, static_cast<tuple_base_t &>(*this));
71 }
73 decltype(auto) id() const &
74 {
75 return get_impl(field_constant<seqan3::field::id>{}, static_cast<tuple_base_t const &>(*this));
76 }
77
79 decltype(auto) sequence() &&
80 {
81 return get_impl(field_constant<seqan3::field::seq>{}, static_cast<tuple_base_t &&>(*this));
82 }
84 decltype(auto) sequence() const &&
85 {
86 return get_impl(field_constant<seqan3::field::seq>{}, static_cast<tuple_base_t const &&>(*this));
87 }
89 decltype(auto) sequence() &
90 {
91 return get_impl(field_constant<seqan3::field::seq>{}, static_cast<tuple_base_t &>(*this));
92 }
94 decltype(auto) sequence() const &
95 {
96 return get_impl(field_constant<seqan3::field::seq>{}, static_cast<tuple_base_t const &>(*this));
97 }
98
100 decltype(auto) sequence_structure() &&
101 {
102 return get_impl(field_constant<seqan3::field::structure>{}, static_cast<tuple_base_t &&>(*this));
103 }
105 decltype(auto) sequence_structure() const &&
106 {
107 return get_impl(field_constant<seqan3::field::structure>{}, static_cast<tuple_base_t const &&>(*this));
108 }
110 decltype(auto) sequence_structure() &
111 {
112 return get_impl(field_constant<seqan3::field::structure>{}, static_cast<tuple_base_t &>(*this));
113 }
115 decltype(auto) sequence_structure() const &
116 {
117 return get_impl(field_constant<seqan3::field::structure>{}, static_cast<tuple_base_t const &>(*this));
118 }
119
121 decltype(auto) energy() &&
122 {
123 return get_impl(field_constant<seqan3::field::energy>{}, static_cast<tuple_base_t &&>(*this));
124 }
126 decltype(auto) energy() const &&
127 {
128 return get_impl(field_constant<seqan3::field::energy>{}, static_cast<tuple_base_t const &&>(*this));
129 }
131 decltype(auto) energy() &
132 {
133 return get_impl(field_constant<seqan3::field::energy>{}, static_cast<tuple_base_t &>(*this));
134 }
136 decltype(auto) energy() const &
137 {
138 return get_impl(field_constant<seqan3::field::energy>{}, static_cast<tuple_base_t const &>(*this));
139 }
140
143 {
144 // this is computed
145 return get_impl(field_constant<seqan3::field::bpp>{}, static_cast<tuple_base_t &&>(*this));
146 }
148 decltype(auto) base_pair_probability_matrix() const &&
149 {
150 return get_impl(field_constant<seqan3::field::bpp>{}, static_cast<tuple_base_t const &&>(*this));
151 }
154 {
155 return get_impl(field_constant<seqan3::field::bpp>{}, static_cast<tuple_base_t &>(*this));
156 }
158 decltype(auto) base_pair_probability_matrix() const &
159 {
160 return get_impl(field_constant<seqan3::field::bpp>{}, static_cast<tuple_base_t const &>(*this));
161 }
162
163 // decltype(auto) reactivity(); // unused
164 // decltype(auto) reactivity_errors(); // unused
165 // decltype(auto) comment(); // unused
166 // decltype(auto) base_qualities(); // unused
167};
168} // namespace seqan3
169
170namespace std
171{
172
178template <typename field_types, typename field_ids>
179struct tuple_size<seqan3::structure_record<field_types, field_ids>> :
180 tuple_size<typename seqan3::structure_record<field_types, field_ids>::base_type>
181{};
182
188template <size_t elem_no, typename field_types, typename field_ids>
189struct tuple_element<elem_no, seqan3::structure_record<field_types, field_ids>> :
190 tuple_element<elem_no, typename seqan3::structure_record<field_types, field_ids>::base_type>
191{};
192
193} // namespace std
The record type of seqan3::structure_file_input.
Definition: record.hpp:29
structure_record()=default
Defaulted.
decltype(auto) base_pair_probability_matrix() &&
Base pair probability matrix of interactions, usually a matrix of float numbers.
Definition: record.hpp:142
decltype(auto) energy() &&
Energy of a folded sequence, represented by one float number.
Definition: record.hpp:121
structure_record & operator=(structure_record &&)=default
Defaulted.
decltype(auto) energy() &
Energy of a folded sequence, represented by one float number.
Definition: record.hpp:131
decltype(auto) sequence() const &
The "sequence", usually a range of nucleotides or amino acids.
Definition: record.hpp:94
decltype(auto) sequence_structure() &
Fixed interactions, usually a string of structure alphabet characters.
Definition: record.hpp:110
decltype(auto) base_pair_probability_matrix() &
Base pair probability matrix of interactions, usually a matrix of float numbers.
Definition: record.hpp:153
decltype(auto) sequence_structure() const &&
Fixed interactions, usually a string of structure alphabet characters.
Definition: record.hpp:105
structure_record(structure_record &&)=default
Defaulted.
decltype(auto) base_pair_probability_matrix() const &
Base pair probability matrix of interactions, usually a matrix of float numbers.
Definition: record.hpp:158
decltype(auto) base_pair_probability_matrix() const &&
Base pair probability matrix of interactions, usually a matrix of float numbers.
Definition: record.hpp:148
~structure_record()=default
Defaulted.
decltype(auto) sequence() &&
The "sequence", usually a range of nucleotides or amino acids.
Definition: record.hpp:79
decltype(auto) sequence_structure() const &
Fixed interactions, usually a string of structure alphabet characters.
Definition: record.hpp:115
decltype(auto) sequence_structure() &&
Fixed interactions, usually a string of structure alphabet characters.
Definition: record.hpp:100
decltype(auto) energy() const &&
Energy of a folded sequence, represented by one float number.
Definition: record.hpp:126
decltype(auto) energy() const &
Energy of a folded sequence, represented by one float number.
Definition: record.hpp:136
structure_record & operator=(structure_record const &)=default
Defaulted.
decltype(auto) sequence() &
The "sequence", usually a range of nucleotides or amino acids.
Definition: record.hpp:89
structure_record(structure_record const &)=default
Defaulted.
decltype(auto) sequence() const &&
The "sequence", usually a range of nucleotides or amino acids.
Definition: record.hpp:84
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
SeqAn specific customisations in the standard namespace.
Provides the seqan3::record template and the seqan3::field enum.
The class template that file records are based on; behaves like a std::tuple.
Definition: record.hpp:192
detail::transfer_template_args_onto_t< field_types, std::tuple > base_type
A specialisation of std::tuple.
Definition: record.hpp:217