SeqAn3  3.0.0
The Modern C++ library for sequence analysis.
input_format_concept.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2019, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2019, 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 <fstream>
16 #include <set>
17 #include <string>
18 #include <utility>
19 #include <vector>
20 
26 
27 namespace seqan3::detail
28 {
29 
31 template <typename format_tag>
32 class structure_file_input_format
33 {};
34 
35 } // namespace seqan3::detail
36 
37 namespace seqan3
38 {
39 
50 template<typename t>
52 SEQAN3_CONCEPT StructureFileInputFormat = requires(detail::structure_file_input_format<t> & v,
53  std::ifstream & f,
54  structure_file_input_options<rna5, false> & options,
55  rna5_vector & seq,
56  std::string & id,
58  std::vector<wuss51> & structure,
59  std::vector<structured_rna<rna5, wuss51>> & structured_seq,
60  double energy,
61  double react,
62  double react_err,
63  std::string & comment,
64  size_t offset)
65 {
66  t::file_extensions;
67 
68  { v.read(f, options, seq, id, bpp, structure,
69  energy, react, react_err, comment, offset) } -> void;
70 
71  { v.read(f, options, seq, id, bpp, std::ignore,
72  std::ignore, std::ignore, std::ignore, std::ignore, std::ignore) } -> void;
73 
74  { v.read(f, options, structured_seq, id, std::ignore, structured_seq,
75  energy, std::ignore, std::ignore, std::ignore, std::ignore) } -> void;
76 
77  { v.read(f, options, std::ignore, std::ignore, std::ignore, std::ignore,
78  std::ignore, std::ignore, std::ignore, std::ignore, std::ignore) } -> void;
79  // the last is required to be compile time valid, but should always throw at run-time.
80 };
82 
142 
144 } // namespace seqan3
145 
146 namespace seqan3::detail
147 {
148 
154 template<typename t>
155 constexpr bool is_type_list_of_structure_file_input_formats_v = false;
156 
162 template<typename ... ts>
163 constexpr bool is_type_list_of_structure_file_input_formats_v<type_list<ts...>>
164  = (StructureFileInputFormat<ts> && ...);
165 
171 template<typename t>
172 SEQAN3_CONCEPT TypeListOfStructureFileInputFormats = is_type_list_of_structure_file_input_formats_v<t>;
173 } // namespace seqan3::detail
constexpr sequenced_policy seq
Global execution policy object for sequenced execution policy.
Definition: execution.hpp:54
Provides seqan3::structure_file_input_options.
The main SeqAn3 namespace.
Provides seqan3::rna5, container aliases and string literals.
Provides seqan3::type_list and auxiliary type traits.
Provides the WUSS format for RNA structure.
Definition: aligned_sequence_concept.hpp:35
meta::list< types... > type_list
Type that contains multiple types, an alias for meta::list.
Definition: type_list.hpp:27
Provides the composite of nucleotide with structure alphabets.