SeqAn3 3.4.0-rc.4
The Modern C++ library for sequence analysis.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
header.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <deque>
13#include <ranges>
14#include <unordered_map>
15#include <vector>
16
20
21namespace seqan3
22{
23
39
45template <std::ranges::forward_range ref_ids_type = std::deque<std::string>>
47{
48public:
52 sam_file_header() = default;
53 sam_file_header(sam_file_header const &) = default;
57 ~sam_file_header() = default;
58
63 {}
65
73
75
77
78private:
84 ref_ids_type reference_ids{};
85
87 struct key_hasher
88 {
90 template <typename key_t>
91 size_t operator()(key_t && key) const noexcept
92 {
93 using char_t = std::ranges::range_value_t<key_t>;
94 size_t result{0};
96 for (char_t character : key)
97 {
98 result *= 0x8F'3F'73'B5'CF'1C'9A'DE;
99 result += h(character);
100 }
101 return result;
102 }
103 };
104
105public:
125 {
126 return reference_ids;
127 }
128
161
164
200
202};
203
204} // namespace seqan3
Core alphabet concept and free function/type trait wrappers.
A "pretty printer" for most SeqAn data structures and related types.
Definition debug_stream_type.hpp:79
Stores the header information of SAM/BAM files.
Definition header.hpp:47
sam_file_header(sam_file_header const &)=default
Defaulted.
std::vector< std::pair< std::string, std::string > > read_groups
The Read Group Dictionary (used by the SAM/BAM format).
Definition header.hpp:199
std::string sorting
The sorting of the file. SAM: [unknown, unsorted, queryname, coordinate].
Definition header.hpp:69
sam_file_header & operator=(sam_file_header const &)=default
Defaulted.
ref_ids_type & ref_ids()
The range of reference ids.
Definition header.hpp:124
sam_file_header(sam_file_header &&)=default
Defaulted.
std::string user_tags
Additional user-defined tags.
Definition header.hpp:201
std::unordered_map< key_type, int32_t, key_hasher, detail::view_equality_fn > ref_dict
The mapping of reference id to position in the ref_ids() range and the ref_id_info range.
Definition header.hpp:163
std::vector< std::tuple< int32_t, std::string > > ref_id_info
The reference information. (used by the SAM/BAM format)
Definition header.hpp:160
std::string format_version
The file format version. Note: this is overwritten by our formats on output.
Definition header.hpp:68
~sam_file_header()=default
Defaulted.
std::vector< std::string > comments
The list of comments.
Definition header.hpp:76
sam_file_header(ref_ids_type ref_ids)
Construct from a range of reference ids.
Definition header.hpp:62
sam_file_header()=default
Defaulted.
std::string grouping
The grouping of the file. SAM: [none, query, reference].
Definition header.hpp:72
std::string subsorting
The sub-sorting of the file. SAM: [unknown, unsorted, queryname, coordinate](:[A-Za-z0-9_-]+)+.
Definition header.hpp:71
sam_file_header & operator=(sam_file_header &&)=default
Defaulted.
std::vector< program_info_t > program_infos
The list of program information.
Definition header.hpp:74
Auxiliary functions for the SAM IO.
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
SeqAn specific customisations in the standard namespace.
Stores information of the program/tool that was used to create a SAM/BAM file.
Definition header.hpp:30
std::string description
A description of the program and/or program call.
Definition header.hpp:35
std::string command_line_call
The command line call that produces the file.
Definition header.hpp:33
std::string previous
The id of the previous program if program calls were chained.
Definition header.hpp:34
std::string name
The official name.
Definition header.hpp:32
std::string user_tags
Additional user-defined tags.
Definition header.hpp:37
std::string id
A unique (file scope) id.
Definition header.hpp:31
std::string version
The program/tool version.
Definition header.hpp:36
Provides seqan3::views::type_reduce.
Hide me