Loading...
Searching...
No Matches
structure_file/input.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 <cassert>
#include <filesystem>
#include <fstream>
#include <limits>
#include <optional>
#include <string>
#include <type_traits>
#include <utility>
#include <variant>
#include <vector>
#include <seqan3/alphabet/adaptation/char.hpp>
#include <seqan3/alphabet/aminoacid/aa27.hpp>
#include <seqan3/alphabet/nucleotide/rna15.hpp>
#include <seqan3/alphabet/nucleotide/rna5.hpp>
#include <seqan3/alphabet/structure/dssp9.hpp>
#include <seqan3/alphabet/structure/structured_aa.hpp>
#include <seqan3/io/detail/in_file_iterator.hpp>
#include <seqan3/io/detail/misc_input.hpp>
#include <seqan3/io/detail/record.hpp>
#include <seqan3/io/exception.hpp>
#include <seqan3/io/stream/concept.hpp>
#include <seqan3/io/structure_file/format_vienna.hpp>
#include <seqan3/io/structure_file/input_format_concept.hpp>
#include <seqan3/io/structure_file/input_options.hpp>
#include <seqan3/io/structure_file/record.hpp>
#include <seqan3/utility/container/concept.hpp>
#include <seqan3/utility/type_list/traits.hpp>
namespace seqan3
{
// ----------------------------------------------------------------------------
// structure_file_input_traits
// ----------------------------------------------------------------------------
template <typename t>
concept structure_file_input_traits = requires (t v) {
// TODO(joergi-w) The expensive concept checks are currently omitted. Check again when compiler has improved.
// sequence
requires writable_alphabet<typename t::seq_alphabet>;
requires writable_alphabet<typename t::seq_legal_alphabet>;
requires explicitly_convertible_to<typename t::seq_legal_alphabet, typename t::seq_alphabet>;
requires sequence_container<typename t::template seq_container<typename t::seq_alphabet>>;
// id
requires writable_alphabet<typename t::id_alphabet>;
requires sequence_container<typename t::template id_container<typename t::id_alphabet>>;
// bpp
requires std::is_floating_point_v<typename t::bpp_prob>;
requires std::numeric_limits<typename t::bpp_partner>::is_integer;
// requires container // TODO check Associative container Concept when implemented
// <typename t::template bpp_queue
// <typename t::template bpp_item
// <typename t::bpp_prob, typename t::bpp_partner>>>
// && requires(typename t::template bpp_queue // TODO maybe implement also a version that allows emplace_back
// <typename t::template bpp_item
// <typename t::bpp_prob, typename t::bpp_partner>> value) { value.emplace(1.0, 1); };
// requires sequence_container
// <typename t::template bpp_container
// <typename t::template bpp_queue
// <typename t::template bpp_item
// <typename t::bpp_prob, typename t::bpp_partner>>>>;
// structure
requires std::is_same_v<typename t::structure_alphabet, dssp9> // TODO(joergi-w) add aa_structure_concept
|| rna_structure_alphabet<typename t::structure_alphabet>;
requires sequence_container<typename t::template structure_container<typename t::structure_alphabet>>;
// structured sequence: tuple composites of seq and structure
requires std::is_base_of_v<
alphabet_tuple_base<
typename t::template structured_seq_alphabet<typename t::seq_alphabet, typename t::structure_alphabet>,
typename t::seq_alphabet,
typename t::structure_alphabet>,
typename t::template structured_seq_alphabet<typename t::seq_alphabet, typename t::structure_alphabet>>;
// requires sequence_container
// <typename t::template structured_seq_container
// <typename t::template structured_seq_alphabet
// <typename t::seq_alphabet, typename t::structure_alphabet>>>;
// energy: std::optional of floating point number
requires std::is_floating_point_v<typename t::energy_type::value_type>;
// reactivity [error]
requires std::is_floating_point_v<typename t::react_type>;
requires sequence_container<typename t::template react_container<typename t::react_type>>;
// comment
requires writable_alphabet<typename t::comment_alphabet>;
requires sequence_container<typename t::template comment_container<typename t::comment_alphabet>>;
// offset
requires std::numeric_limits<typename t::offset_type>::is_integer;
};
// ----------------------------------------------------------------------------
// structure_file_input_default_traits
// ----------------------------------------------------------------------------
struct structure_file_input_default_traits_rna
{
// sequence
using seq_alphabet = rna5;
using seq_legal_alphabet = rna15;
template <typename _seq_alphabet>
using seq_container = std::vector<_seq_alphabet>;
// id
using id_alphabet = char;
template <typename _id_alphabet>
using id_container = std::basic_string<_id_alphabet>;
// base pair probability structure
using bpp_prob = double;
using bpp_partner = size_t;
template <typename _bpp_prob, typename _bpp_partner>
using bpp_item = std::pair<_bpp_prob, _bpp_partner>;
template <typename _bpp_item>
using bpp_queue = std::set<_bpp_item>;
template <typename _bpp_queue>
using bpp_container = std::vector<_bpp_queue>;
// fixed structure
using structure_alphabet = wuss51;
template <typename _structure_alphabet>
using structure_container = std::vector<_structure_alphabet>;
// combined sequence and structure
template <typename _seq_alphabet, typename _structure_alphabet>
using structured_seq_alphabet = structured_rna<_seq_alphabet, _structure_alphabet>;
template <typename _structured_seq_alphabet>
using structured_seq_container = std::vector<_structured_seq_alphabet>;
// energy
using energy_type = std::optional<double>;
// reactivity [error]
using react_type = double;
template <typename _react_type>
using react_container = std::vector<_react_type>;
// comment
using comment_alphabet = char;
template <typename _comment_alphabet>
using comment_container = std::basic_string<_comment_alphabet>;
// offset
using offset_type = size_t;
};
struct structure_file_input_default_traits_aa : structure_file_input_default_traits_rna
{
using seq_alphabet = aa27;
using seq_legal_alphabet = aa27;
using structure_alphabet = dssp9;
template <typename _seq_alphabet, typename _structure_alphabet>
using structured_seq_alphabet = structured_aa<_seq_alphabet, _structure_alphabet>;
};
// ----------------------------------------------------------------------------
// structure_file_input
// ----------------------------------------------------------------------------
template <structure_file_input_traits traits_type_ = structure_file_input_default_traits_rna,
detail::fields_specialisation selected_field_ids_ = fields<field::seq, field::id, field::structure>,
detail::type_list_of_structure_file_input_formats valid_formats_ = type_list<format_vienna>>
class structure_file_input
{
public:
using traits_type = traits_type_;
using selected_field_ids = selected_field_ids_;
using valid_formats = valid_formats_;
using stream_char_type = char;
using field_ids = fields<field::seq,
field::id,
field::bpp,
field::structure,
field::structured_seq,
field::energy,
field::react,
field::react_err,
field::comment,
field::offset>;
static_assert(
[]() constexpr
{
for (field f : selected_field_ids::as_array)
if (!field_ids::contains(f))
return false;
return true;
}(),
"You selected a field that is not valid for structure files, please refer to the documentation "
"of structure_file_input::field_ids for the accepted values.");
static_assert(
[]() constexpr
{
return !(selected_field_ids::contains(field::structured_seq)
&& (selected_field_ids::contains(field::seq) || (selected_field_ids::contains(field::structure))));
}(),
"You may not select field::structured_seq and either of field::seq and field::structure "
"at the same time.");
using seq_type = typename traits_type::template seq_container<typename traits_type::seq_alphabet>;
using id_type = typename traits_type::template id_container<typename traits_type::id_alphabet>;
using bpp_type = typename traits_type::template bpp_container<typename traits_type::template bpp_queue<
typename traits_type::template bpp_item<typename traits_type::bpp_prob, typename traits_type::bpp_partner>>>;
using structure_type = typename traits_type::template structure_container<typename traits_type::structure_alphabet>;
using structured_seq_type = typename traits_type::template structured_seq_container<
typename traits_type::template structured_seq_alphabet<typename traits_type::seq_alphabet,
typename traits_type::structure_alphabet>>;
using energy_type = typename traits_type::energy_type;
using react_type = typename traits_type::template react_container<typename traits_type::react_type>;
using comment_type = typename traits_type::template comment_container<typename traits_type::comment_alphabet>;
using offset_type = typename traits_type::offset_type;
using field_types = type_list<seq_type,
id_type,
bpp_type,
structure_type,
structured_seq_type,
energy_type,
react_type,
react_type,
comment_type,
offset_type>;
using record_type = structure_record<detail::select_types_with_ids_t<field_types, field_ids, selected_field_ids>,
selected_field_ids>;
using value_type = record_type;
using reference = record_type &;
using const_reference = void;
using size_type = size_t;
using difference_type = std::make_signed_t<size_t>;
using iterator = detail::in_file_iterator<structure_file_input>;
using const_iterator = void;
using sentinel = std::default_sentinel_t;
structure_file_input() = delete;
structure_file_input(structure_file_input const &) = delete;
structure_file_input & operator=(structure_file_input const &) = delete;
structure_file_input(structure_file_input &&) = default;
structure_file_input & operator=(structure_file_input &&) = default;
~structure_file_input() = default;
structure_file_input(std::filesystem::path filename,
selected_field_ids const & SEQAN3_DOXYGEN_ONLY(fields_tag) = selected_field_ids{}) :
primary_stream{new std::ifstream{}, stream_deleter_default}
{
primary_stream->rdbuf()->pubsetbuf(stream_buffer.data(), stream_buffer.size());
static_cast<std::basic_ifstream<char> *>(primary_stream.get())
->open(filename, std::ios_base::in | std::ios::binary);
if (!primary_stream->good())
throw file_open_error{"Could not open file " + filename.string() + " for reading."};
// possibly add intermediate decompression stream
secondary_stream = detail::make_secondary_istream(*primary_stream, filename);
// initialise format handler
detail::set_format(format, filename);
}
template <input_stream stream_t, structure_file_input_format file_format>
requires std::same_as<typename std::remove_reference_t<stream_t>::char_type, char>
structure_file_input(stream_t & stream,
file_format const & SEQAN3_DOXYGEN_ONLY(format_tag),
selected_field_ids const & SEQAN3_DOXYGEN_ONLY(fields_tag) = selected_field_ids{}) :
primary_stream{&stream, stream_deleter_noop},
format{detail::structure_file_input_format_exposer<file_format>{}}
{
static_assert(list_traits::contains<file_format, valid_formats>,
"You selected a format that is not in the valid_formats of this file.");
// possibly add intermediate decompression stream
secondary_stream = detail::make_secondary_istream(*primary_stream);
}
template <input_stream stream_t, structure_file_input_format file_format>
requires std::same_as<typename std::remove_reference_t<stream_t>::char_type, char>
structure_file_input(stream_t && stream,
file_format const & SEQAN3_DOXYGEN_ONLY(format_tag),
selected_field_ids const & SEQAN3_DOXYGEN_ONLY(fields_tag) = selected_field_ids{}) :
primary_stream{new stream_t{std::move(stream)}, stream_deleter_default},
format{detail::structure_file_input_format_exposer<file_format>{}}
{
static_assert(list_traits::contains<file_format, valid_formats>,
"You selected a format that is not in the valid_formats of this file.");
// possibly add intermediate compression stream
secondary_stream = detail::make_secondary_istream(*primary_stream);
}
iterator begin()
{
// buffer first record
if (!first_record_was_read)
{
read_next_record();
first_record_was_read = true;
}
return {*this};
}
sentinel end() noexcept
{
return {};
}
reference front() noexcept
{
return *begin();
}
structure_file_input_options<typename traits_type::seq_legal_alphabet,
selected_field_ids::contains(field::structured_seq)>
options;
protected:
record_type record_buffer;
std::vector<char> stream_buffer{std::vector<char>(1'000'000)};
std::streampos position_buffer{};
using stream_ptr_t = std::unique_ptr<std::basic_istream<stream_char_type>,
std::function<void(std::basic_istream<stream_char_type> *)>>;
static void stream_deleter_noop(std::basic_istream<stream_char_type> *)
{}
static void stream_deleter_default(std::basic_istream<stream_char_type> * ptr)
{
delete ptr;
}
stream_ptr_t primary_stream{nullptr, stream_deleter_noop};
stream_ptr_t secondary_stream{nullptr, stream_deleter_noop};
bool first_record_was_read{false};
bool at_end{false};
using format_type =
typename detail::variant_from_tags<valid_formats, detail::structure_file_input_format_exposer>::type;
format_type format;
void read_next_record()
{
// clear the record
record_buffer.clear();
// store the current position in the position buffer
position_buffer = secondary_stream->tellg();
// at end if we could not read further
if ((std::istreambuf_iterator<stream_char_type>{*secondary_stream}
== std::istreambuf_iterator<stream_char_type>{}))
{
at_end = true;
return;
}
assert(!format.valueless_by_exception());
std::visit(
[&](auto & f)
{
// read new record
if constexpr (selected_field_ids::contains(field::structured_seq))
{
static_assert(!selected_field_ids::contains(field::structure),
"You may not select field::structured_seq and field::structure at the same time.");
static_assert(!selected_field_ids::contains(field::seq),
"You may not select field::structured_seq and field::seq at the same time.");
f.read_structure_record(*secondary_stream,
options,
detail::get_or_ignore<field::structured_seq>(record_buffer), // seq
detail::get_or_ignore<field::id>(record_buffer),
detail::get_or_ignore<field::bpp>(record_buffer),
detail::get_or_ignore<field::structured_seq>(record_buffer), // structure
detail::get_or_ignore<field::energy>(record_buffer),
detail::get_or_ignore<field::react>(record_buffer),
detail::get_or_ignore<field::react_err>(record_buffer),
detail::get_or_ignore<field::comment>(record_buffer),
detail::get_or_ignore<field::offset>(record_buffer));
}
else
{
f.read_structure_record(*secondary_stream,
options,
detail::get_or_ignore<field::seq>(record_buffer),
detail::get_or_ignore<field::id>(record_buffer),
detail::get_or_ignore<field::bpp>(record_buffer),
detail::get_or_ignore<field::structure>(record_buffer),
detail::get_or_ignore<field::energy>(record_buffer),
detail::get_or_ignore<field::react>(record_buffer),
detail::get_or_ignore<field::react_err>(record_buffer),
detail::get_or_ignore<field::comment>(record_buffer),
detail::get_or_ignore<field::offset>(record_buffer));
}
},
format);
}
friend iterator;
};
template <input_stream stream_type,
structure_file_input_format file_format,
detail::fields_specialisation selected_field_ids>
structure_file_input(stream_type && stream, file_format const &, selected_field_ids const &)
-> structure_file_input<typename structure_file_input<>::traits_type, // actually use the default
selected_field_ids,
type_list<file_format>>;
template <input_stream stream_type,
structure_file_input_format file_format,
detail::fields_specialisation selected_field_ids>
structure_file_input(stream_type & stream, file_format const &, selected_field_ids const &)
-> structure_file_input<typename structure_file_input<>::traits_type, // actually use the default
selected_field_ids,
type_list<file_format>>;
} // namespace seqan3
aa27.hpp
Provides seqan3::aa27, container aliases and string literals.
std::basic_ifstream
std::basic_istream
std::basic_string
cassert
char.hpp
Provides alphabet adaptations for standard char types.
seqan3::aa27
The twenty-seven letter amino acid alphabet.
Definition aa27.hpp:43
seqan3::dssp9
The protein structure alphabet of the characters "HGIEBTSCX".
Definition dssp9.hpp:59
seqan3::rna15
The 15 letter RNA alphabet, containing all IUPAC smybols minus the gap.
Definition rna15.hpp:48
seqan3::rna5
The five letter RNA alphabet of A,C,G,U and the unknown character N.
Definition rna5.hpp:46
seqan3::structure_file_input_format
The generic concept for structure file in formats.
Definition structure_file/input_format_concept.hpp:138
seqan3::structure_file_input::structured_seq_type
typename traits_type::template structured_seq_container< typename traits_type::template structured_seq_alphabet< typename traits_type::seq_alphabet, typename traits_type::structure_alphabet > > structured_seq_type
The type of the sequence-structure field (default std::vector of structured_rna<rna5,...
Definition structure_file/input.hpp:423
seqan3::structure_file_input::options
structure_file_input_options< typename traits_type::seq_legal_alphabet, selected_field_ids::contains(field::structured_seq)> options
The options are public and its members can be set directly.
Definition structure_file/input.hpp:651
seqan3::structure_file_input::front
reference front() noexcept
Return the record we are currently at in the file.
Definition structure_file/input.hpp:642
seqan3::structure_file_input::structure_file_input
structure_file_input(structure_file_input const &)=delete
Copy construction is explicitly deleted, because you cannot have multiple access to the same file.
seqan3::structure_file_input::field_types
type_list< seq_type, id_type, bpp_type, structure_type, structured_seq_type, energy_type, react_type, react_type, comment_type, offset_type > field_types
The previously defined types aggregated in a seqan3::type_list.
Definition structure_file/input.hpp:436
seqan3::structure_file_input::reference
record_type & reference
The reference type.
Definition structure_file/input.hpp:459
seqan3::structure_file_input::iterator
detail::in_file_iterator< structure_file_input > iterator
The iterator type of this view (an input iterator).
Definition structure_file/input.hpp:467
seqan3::structure_file_input::id_type
typename traits_type::template id_container< typename traits_type::id_alphabet > id_type
The type of the ID field (default std::string).
Definition structure_file/input.hpp:416
seqan3::structure_file_input::bpp_type
typename traits_type::template bpp_container< typename traits_type::template bpp_queue< typename traits_type::template bpp_item< typename traits_type::bpp_prob, typename traits_type::bpp_partner > > > bpp_type
The type of the base pair probabilies (default std::vector of std::set<std::pair<double,...
Definition structure_file/input.hpp:418
seqan3::structure_file_input::size_type
size_t size_type
An unsigned integer type, usually std::size_t.
Definition structure_file/input.hpp:463
seqan3::structure_file_input::seq_type
typename traits_type::template seq_container< typename traits_type::seq_alphabet > seq_type
The type of the sequence field (default std::vector of seqan3::rna5).
Definition structure_file/input.hpp:414
seqan3::structure_file_input::comment_type
typename traits_type::template comment_container< typename traits_type::comment_alphabet > comment_type
The type of the comment field (default double).
Definition structure_file/input.hpp:431
seqan3::structure_file_input::sentinel
std::default_sentinel_t sentinel
The type returned by end().
Definition structure_file/input.hpp:471
seqan3::structure_file_input::operator=
structure_file_input & operator=(structure_file_input const &)=delete
Copy assignment is explicitly deleted, because you cannot have multiple access to the same file.
seqan3::structure_file_input::structure_file_input
structure_file_input(stream_t &stream, file_format const &format_tag, selected_field_ids const &fields_tag=selected_field_ids{})
Construct from an existing stream and with specified format.
Definition structure_file/input.hpp:541
seqan3::structure_file_input::structure_file_input
structure_file_input(stream_type &&stream, file_format const &, selected_field_ids const &) -> structure_file_input< typename structure_file_input<>::traits_type, selected_field_ids, type_list< file_format > >
Deduction of the selected fields, the file format and the stream type.
seqan3::structure_file_input::structure_file_input
structure_file_input(stream_t &&stream, file_format const &format_tag, selected_field_ids const &fields_tag=selected_field_ids{})
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition structure_file/input.hpp:557
seqan3::structure_file_input::stream_char_type
char stream_char_type
Character type of the stream(s).
Definition structure_file/input.hpp:371
seqan3::structure_file_input::const_reference
void const_reference
The const_reference type is void, because files are not const-iterable.
Definition structure_file/input.hpp:461
seqan3::structure_file_input::structure_file_input
structure_file_input()=delete
Default constructor is explicitly deleted, you need to give a stream or file name.
seqan3::structure_file_input::traits_type
traits_type_ traits_type
A traits type that defines aliases and template for storage of the fields.
Definition structure_file/input.hpp:365
seqan3::structure_file_input::const_iterator
void const_iterator
The const iterator type is void, because files are not const-iterable.
Definition structure_file/input.hpp:469
seqan3::structure_file_input::selected_field_ids
selected_field_ids_ selected_field_ids
A seqan3::fields list with the fields selected for the record.
Definition structure_file/input.hpp:367
seqan3::structure_file_input::structure_file_input
structure_file_input(structure_file_input &&)=default
Move construction is defaulted.
seqan3::structure_file_input::record_type
structure_record< detail::select_types_with_ids_t< field_types, field_ids, selected_field_ids >, selected_field_ids > record_type
The type of the record, a specialisation of seqan3::record; acts as a tuple of the selected field typ...
Definition structure_file/input.hpp:448
seqan3::structure_file_input::structure_file_input
structure_file_input(stream_type &stream, file_format const &, selected_field_ids const &) -> structure_file_input< typename structure_file_input<>::traits_type, selected_field_ids, type_list< file_format > >
This is an overloaded member function, provided for convenience. It differs from the above function o...
seqan3::structure_file_input::structure_type
typename traits_type::template structure_container< typename traits_type::structure_alphabet > structure_type
The type of the structure field (default std::vector of seqan3::wuss51).
Definition structure_file/input.hpp:421
seqan3::structure_file_input::end
sentinel end() noexcept
Returns a sentinel for comparison with iterator.
Definition structure_file/input.hpp:614
seqan3::structure_file_input::field_ids
fields< field::seq, field::id, field::bpp, field::structure, field::structured_seq, field::energy, field::react, field::react_err, field::comment, field::offset > field_ids
The subset of seqan3::field IDs that are valid for this file; order corresponds to the types in field...
Definition structure_file/input.hpp:377
seqan3::structure_file_input::operator=
structure_file_input & operator=(structure_file_input &&)=default
Move assignment is defaulted.
seqan3::structure_file_input::begin
iterator begin()
Returns an iterator to current position in the file.
Definition structure_file/input.hpp:589
seqan3::structure_file_input::valid_formats
valid_formats_ valid_formats
A seqan3::type_list with the possible formats.
Definition structure_file/input.hpp:369
seqan3::structure_file_input::difference_type
std::make_signed_t< size_t > difference_type
A signed integer type, usually std::ptrdiff_t.
Definition structure_file/input.hpp:465
seqan3::structure_file_input::energy_type
typename traits_type::energy_type energy_type
The type of the energy field (default double).
Definition structure_file/input.hpp:427
seqan3::structure_file_input::offset_type
typename traits_type::offset_type offset_type
The type of the offset field (default size_t).
Definition structure_file/input.hpp:433
seqan3::structure_file_input::structure_file_input
structure_file_input(std::filesystem::path filename, selected_field_ids const &fields_tag=selected_field_ids{})
Construct from filename.
Definition structure_file/input.hpp:506
seqan3::structure_file_input::~structure_file_input
~structure_file_input()=default
Destructor is defaulted.
seqan3::structure_file_input::react_type
typename traits_type::template react_container< typename traits_type::react_type > react_type
The type of the reactivity and reactivity error fields (default double).
Definition structure_file/input.hpp:429
seqan3::structure_file_input::value_type
record_type value_type
The value_type is the record_type.
Definition structure_file/input.hpp:457
seqan3::structure_record
The record type of seqan3::structure_file_input.
Definition structure_file/record.hpp:26
seqan3::structured_aa
A seqan3::alphabet_tuple_base that joins an aminoacid alphabet with a protein structure alphabet.
Definition structured_aa.hpp:52
seqan3::structured_rna
A seqan3::alphabet_tuple_base that joins a nucleotide alphabet with an RNA structure alphabet.
Definition structured_rna.hpp:53
std::vector::data
T data(T... args)
dssp9.hpp
Provides the dssp format for protein structure.
filesystem
format_vienna.hpp
Provides the seqan3::format_vienna.
std::streampos
fstream
std::function
std::unique_ptr::get
T get(T... args)
seqan3::field
field
An enumerator for the fields used in file formats.
Definition record.hpp:60
seqan3::field::energy
@ energy
Energy of a folded sequence, represented by one float number.
Definition record.hpp:72
seqan3::field::comment
@ comment
Comment field of arbitrary content, usually a string.
Definition record.hpp:75
seqan3::field::structure
@ structure
Fixed interactions, usually a string of structure alphabet characters.
Definition record.hpp:70
seqan3::field::bpp
@ bpp
Base pair probability matrix of interactions, usually a matrix of float numbers.
Definition record.hpp:69
seqan3::field::react
@ react
Reactivity values of the sequence characters given in a vector of float numbers.
Definition record.hpp:73
seqan3::field::react_err
@ react_err
Reactivity error values given in a vector corresponding to seqan3::field::react.
Definition record.hpp:74
seqan3::field::offset
@ offset
Sequence (seqan3::field::seq) relative start position (0-based), unsigned value.
Definition record.hpp:66
seqan3::field::structured_seq
@ structured_seq
Sequence and fixed interactions combined in one range.
Definition record.hpp:71
seqan3::field::id
@ id
The identifier, usually a string.
Definition record.hpp:63
seqan3::field::seq
@ seq
The "sequence", usually a range of nucleotides or amino acids.
Definition record.hpp:62
seqan3::list_traits::contains
constexpr bool contains
Whether a type occurs in a type list or not.
Definition type_list/traits.hpp:249
in_file_iterator.hpp
Provides the seqan3::detail::in_file_iterator class template.
explicitly_convertible_to
Checks whether from can be explicitly converted to to.
rna_structure_alphabet
A concept that indicates whether an alphabet represents RNA structure.
sequence_container
A more refined container concept than seqan3::container.
structure_file_input_traits
The requirements a traits_type for seqan3::structure_file_input must meet.
writable_alphabet
Refines seqan3::alphabet and adds assignability.
exception.hpp
Provides exceptions used in the I/O module.
concept.hpp
Stream concepts.
std::is_base_of_v
T is_base_of_v
std::is_floating_point_v
T is_floating_point_v
std::is_same_v
T is_same_v
std::istreambuf_iterator
limits
std::make_signed_t
misc_input.hpp
Provides various utility functions required only for input.
seqan3
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
std
SeqAn specific customisations in the standard namespace.
std::numeric_limits
std::basic_ifstream::open
T open(T... args)
optional
std::pair
std::filesystem::path
rna15.hpp
Provides seqan3::rna15, container aliases and string literals.
rna5.hpp
Provides seqan3::rna5, container aliases and string literals.
std::set
std::vector::size
T size(T... args)
string
seqan3::fields
A class template that holds a choice of seqan3::field.
Definition record.hpp:125
seqan3::file_open_error
Thrown if there is an unspecified filesystem or stream error while opening, e.g. permission problem.
Definition io/exception.hpp:36
seqan3::record::clear
void clear() noexcept(noexcept(std::apply(expander, std::declval< record & >().as_base())))
Clears containers that provide .clear() and (re-)initialises all other elements with = {}...
Definition record.hpp:242
seqan3::structure_file_input_default_traits_aa
A traits type that specifies input as amino acids.
Definition structure_file/input.hpp:318
seqan3::structure_file_input_default_traits_aa::seq_alphabet
aa27 seq_alphabet
The sequence alphabet is seqan3::aa27.
Definition structure_file/input.hpp:325
seqan3::structure_file_input_default_traits_aa::structure_alphabet
dssp9 structure_alphabet
The structure annotation alphabet is seqan3::dssp9.
Definition structure_file/input.hpp:329
seqan3::structure_file_input_default_traits_aa::structured_seq_alphabet
structured_aa< _seq_alphabet, _structure_alphabet > structured_seq_alphabet
The combined structured sequence alphabet is seqan3::structured_aa<seqan3::aa27, seqan3::dssp9>.
Definition structure_file/input.hpp:332
seqan3::structure_file_input_default_traits_aa::seq_legal_alphabet
aa27 seq_legal_alphabet
The legal sequence alphabet for parsing is seqan3::aa27.
Definition structure_file/input.hpp:327
seqan3::structure_file_input_default_traits_rna
The default traits for seqan3::structure_file_input.
Definition structure_file/input.hpp:219
seqan3::structure_file_input_default_traits_rna::structure_alphabet
wuss51 structure_alphabet
The alphabet for a structure annotation is seqan3::phred42.
Definition structure_file/input.hpp:269
seqan3::structure_file_input_default_traits_rna::structured_seq_container
std::vector< _structured_seq_alphabet > structured_seq_container
The type of a structured RNA sequence is std::vector.
Definition structure_file/input.hpp:283
seqan3::structure_file_input_default_traits_rna::seq_legal_alphabet
rna15 seq_legal_alphabet
The legal sequence alphabet for parsing is seqan3::rna15.
Definition structure_file/input.hpp:231
seqan3::structure_file_input_default_traits_rna::id_container
std::basic_string< _id_alphabet > id_container
The string type for an identifier is std::basic_string.
Definition structure_file/input.hpp:244
seqan3::structure_file_input_default_traits_rna::seq_container
std::vector< _seq_alphabet > seq_container
The type of an RNA sequence is std::vector.
Definition structure_file/input.hpp:235
seqan3::structure_file_input_default_traits_rna::bpp_container
std::vector< _bpp_queue > bpp_container
A string over all bases containing the respective interaction queues is represented as std::vector.
Definition structure_file/input.hpp:264
seqan3::structure_file_input_default_traits_rna::offset_type
size_t offset_type
The type of the offset is size_t.
Definition structure_file/input.hpp:311
seqan3::structure_file_input_default_traits_rna::bpp_prob
double bpp_prob
The type for a base pair probability is double.
Definition structure_file/input.hpp:249
seqan3::structure_file_input_default_traits_rna::id_alphabet
char id_alphabet
The alphabet for an identifier string is char.
Definition structure_file/input.hpp:240
seqan3::structure_file_input_default_traits_rna::comment_alphabet
char comment_alphabet
The alphabet for a comment string is char.
Definition structure_file/input.hpp:302
seqan3::structure_file_input_default_traits_rna::seq_alphabet
rna5 seq_alphabet
The sequence alphabet is seqan3::rna5.
Definition structure_file/input.hpp:228
seqan3::structure_file_input_default_traits_rna::structured_seq_alphabet
structured_rna< _seq_alphabet, _structure_alphabet > structured_seq_alphabet
The combined structured sequence alphabet is seqan3::structured_rna<seqan3::rna5, seqan3::wuss51>.
Definition structure_file/input.hpp:279
seqan3::structure_file_input_default_traits_rna::comment_container
std::basic_string< _comment_alphabet > comment_container
The string type for a comment is std::basic_string.
Definition structure_file/input.hpp:306
seqan3::structure_file_input_default_traits_rna::structure_container
std::vector< _structure_alphabet > structure_container
The string type for a structure annotation is std::vector.
Definition structure_file/input.hpp:273
seqan3::structure_file_input_default_traits_rna::react_container
std::vector< _react_type > react_container
The type of a string of reactivity values is std::vector.
Definition structure_file/input.hpp:297
seqan3::structure_file_input_default_traits_rna::react_type
double react_type
The type of the reactivity and reactivity error is double.
Definition structure_file/input.hpp:293
seqan3::structure_file_input_default_traits_rna::bpp_queue
std::set< _bpp_item > bpp_queue
A queue of base pair items sorted by probability is realised with std::set.
Definition structure_file/input.hpp:260
seqan3::structure_file_input_default_traits_rna::bpp_item
std::pair< _bpp_prob, _bpp_partner > bpp_item
The type of a base pair item is std::pair<double, size_t>.
Definition structure_file/input.hpp:256
seqan3::structure_file_input_default_traits_rna::bpp_partner
size_t bpp_partner
The type for the partner position of a base pair probability is size_t.
Definition structure_file/input.hpp:252
seqan3::structure_file_input_default_traits_rna::energy_type
std::optional< double > energy_type
The type of the energy is std::optional<double>.
Definition structure_file/input.hpp:288
seqan3::structure_file_input_options
The options type defines various option members that influence the behaviour of all or some formats.
Definition structure_file/input_options.hpp:27
seqan3::type_list
Type that contains multiple types.
Definition type_list.hpp:26
input_format_concept.hpp
Provides seqan3::structure_file_input_format.
input_options.hpp
Provides seqan3::structure_file_input_options.
record.hpp
Provides seqan3::structure_record.
structured_aa.hpp
Provides the composite of aminoacid with structure alphabets.
traits.hpp
Provides traits for seqan3::type_list.
type_traits
std::unique_ptr
concept.hpp
Adaptations of concepts from the standard library.
utility
variant
vector
std::visit
T visit(T... args)
Hide me