SeqAn3
output_format_concept.hpp
Go to the documentation of this file.
1 // ============================================================================
2 // SeqAn - The Library for alignment Analysis
3 // ============================================================================
4 //
5 // Copyright (c) 2006-2018, Knut Reinert & Freie Universitaet Berlin
6 // Copyright (c) 2016-2018, Knut Reinert & MPI Molekulare Genetik
7 // All rights reserved.
8 //
9 // Redistribution and use in source and binary forms, with or without
10 // modification, are permitted provided that the following conditions are met:
11 //
12 // * Redistributions of source code must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
14 // * Redistributions in binary form must reproduce the above copyright
15 // notice, this list of conditions and the following disclaimer in the
16 // documentation and/or other materials provided with the distribution.
17 // * Neither the name of Knut Reinert or the FU Berlin nor the names of
18 // its contributors may be used to endorse or promote products derived
19 // from this software without specific prior written permission.
20 //
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
25 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
31 // DAMAGE.
32 //
33 // ============================================================================
34 
40 #pragma once
41 
42 #include <fstream>
43 #include <string>
44 #include <vector>
45 
54 
55 namespace seqan3
56 {
57 
69 template <typename t>
71 concept alignment_file_output_format_concept =
72  requires (t & v,
73  std::ofstream & stream,
74  alignment_file_output_options & options,
75  std::unique_ptr<alignment_file_header> & header_ptr,
76  dna5_vector & seq,
77  std::vector<phred42> & qual,
78  std::string & id,
79  uint8_t & offset,
80  dna5_vector & ref_seq,
81  std::string & ref_id,
82  uint32_t & ref_offset,
83  std::pair<std::vector<gapped<dna4>>, std::vector<gapped<dna4>>> & align,
84  uint16_t & flag,
85  uint16_t & mapq,
86  std::tuple<std::string, uint32_t, uint32_t> & mate, // mate_ref_id, mate_ref_offset, mate_tlen
87  sam_tag_dictionary & tag_dict,
88  double & e_value,
89  double & bit_score)
90 {
91  t::file_extensions;
92 
93  { v.write(stream,
94  options,
95  header_ptr,
96  seq,
97  qual,
98  id,
99  offset,
100  ref_seq,
101  ref_id,
102  ref_offset,
103  align,
104  flag,
105  mapq,
106  mate,
107  tag_dict,
108  e_value,
109  bit_score
110  ) } -> void;
111 };
113 
178 
180 } // namespace seqan3
181 
182 namespace seqan3::detail
183 {
184 
190 template <typename t>
191 constexpr bool is_type_list_of_alignment_file_output_formats_v = false;
192 
198 template <typename ... ts>
199 constexpr bool is_type_list_of_alignment_file_output_formats_v<type_list<ts...>>
200  = (alignment_file_output_format_concept<ts> && ...);
201 
207 template <typename t>
208 concept type_list_of_alignment_file_output_formats_concept = is_type_list_of_alignment_file_output_formats_v<t>;
209 } // namespace seqan3::detail
Provides the seqan3::sam_tag_dictionary class and auxiliaries.
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:58
Contains seqan3::dna5, container aliases and string literals.
Provides seqan3::alignment_file_output_options.
Provides seqan3::type_list and auxiliary metafunctions.
Provides the seqan3::alignment_file_header class.
Contains seqan3::gapped.
Definition: aligned_sequence_concept.hpp:288
Contains seqan3::phred42 quality scores.
meta::list< types... > type_list
Type that contains multiple types, an alias for meta::list.
Definition: type_list.hpp:54
Contains aliases for qualified.