SeqAn3
3.4.0
The Modern C++ library for sequence analysis.
Toggle main menu visibility
Loading...
Searching...
No Matches
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
9
10
#pragma once
11
12
#include <
deque
>
13
#include <ranges>
14
#include <
unordered_map
>
15
#include <
vector
>
16
17
#include <
seqan3/alphabet/concept.hpp
>
18
#include <
seqan3/io/sam_file/detail/cigar.hpp
>
19
#include <
seqan3/utility/views/type_reduce.hpp
>
20
21
namespace
seqan3
22
{
23
29
struct
sam_file_program_info_t
30
{
31
std::string
id
;
32
std::string
name
;
33
std::string
command_line_call
;
34
std::string
previous
;
35
std::string
description
;
36
std::string
version
;
37
std::string
user_tags
;
38
};
39
45
template
<std::ranges::forward_range ref_
id
s_type = std::deque<std::
string
>>
46
class
sam_file_header
47
{
48
public
:
52
sam_file_header
() =
default
;
53
sam_file_header
(
sam_file_header
const
&) =
default
;
54
sam_file_header
&
operator=
(
sam_file_header
const
&) =
default
;
55
sam_file_header
(
sam_file_header
&&) =
default
;
56
sam_file_header
&
operator=
(
sam_file_header
&&) =
default
;
57
~sam_file_header
() =
default
;
58
62
sam_file_header
(ref_ids_type
ref_ids
) : reference_ids{
std
::move(
ref_ids
)}
63
{}
64
65
66
using
program_info_t
=
67
sam_file_program_info_t
;
68
std::string
format_version
;
69
std::string
sorting
;
70
std::string
71
subsorting
;
72
std::string
grouping
;
73
74
std::vector<program_info_t>
program_infos
;
75
76
std::vector<std::string>
comments
;
77
78
private
:
80
using
key_type =
std::conditional_t<std::ranges::contiguous_range<std::ranges::range_reference_t<ref_ids_type>
>,
81
std::span<range_innermost_value_t<ref_ids_type>
const
>,
82
type_reduce_t<std::ranges::range_reference_t<ref_ids_type>
>>;
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};
95
std::hash<char_t>
h{};
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
105
public
:
124
ref_ids_type &
ref_ids
()
125
{
126
return
reference_ids;
127
}
128
160
std::vector<std::tuple<int32_t, std::string>
>
ref_id_info
{};
161
163
std::unordered_map<key_type, int32_t, key_hasher, detail::view_equality_fn>
ref_dict
{};
164
199
std::vector<std::pair<std::string, std::string>
>
read_groups
;
200
201
std::string
user_tags
;
202
};
203
204
}
// namespace seqan3
concept.hpp
Core alphabet concept and free function/type trait wrappers.
std::string
seqan3::sam_file_header::sam_file_header
sam_file_header(sam_file_header const &)=default
Defaulted.
seqan3::sam_file_header::program_info_t
sam_file_program_info_t program_info_t
Stores information of the program/tool that was used to create the file.
Definition
header.hpp:66
seqan3::sam_file_header< typename traits_type::ref_ids >::read_groups
std::vector< std::pair< std::string, std::string > > read_groups
Definition
header.hpp:199
seqan3::sam_file_header< typename traits_type::ref_ids >::sorting
std::string sorting
Definition
header.hpp:69
seqan3::sam_file_header::operator=
sam_file_header & operator=(sam_file_header const &)=default
Defaulted.
seqan3::sam_file_header< typename traits_type::ref_ids >::ref_ids
ref_ids_type & ref_ids()
Definition
header.hpp:124
seqan3::sam_file_header::sam_file_header
sam_file_header(sam_file_header &&)=default
Defaulted.
seqan3::sam_file_header< typename traits_type::ref_ids >::user_tags
std::string user_tags
Definition
header.hpp:201
seqan3::sam_file_header< typename traits_type::ref_ids >::ref_dict
std::unordered_map< key_type, int32_t, key_hasher, detail::view_equality_fn > ref_dict
Definition
header.hpp:163
seqan3::sam_file_header< typename traits_type::ref_ids >::ref_id_info
std::vector< std::tuple< int32_t, std::string > > ref_id_info
Definition
header.hpp:160
seqan3::sam_file_header< typename traits_type::ref_ids >::format_version
std::string format_version
Definition
header.hpp:68
seqan3::sam_file_header::~sam_file_header
~sam_file_header()=default
Defaulted.
seqan3::sam_file_header< typename traits_type::ref_ids >::comments
std::vector< std::string > comments
Definition
header.hpp:76
seqan3::sam_file_header::sam_file_header
sam_file_header(ref_ids_type ref_ids)
Construct from a range of reference ids.
Definition
header.hpp:62
seqan3::sam_file_header::sam_file_header
sam_file_header()=default
Defaulted.
seqan3::sam_file_header< typename traits_type::ref_ids >::grouping
std::string grouping
Definition
header.hpp:72
seqan3::sam_file_header< typename traits_type::ref_ids >::subsorting
std::string subsorting
Definition
header.hpp:71
seqan3::sam_file_header::operator=
sam_file_header & operator=(sam_file_header &&)=default
Defaulted.
seqan3::sam_file_header< typename traits_type::ref_ids >::program_infos
std::vector< program_info_t > program_infos
Definition
header.hpp:74
std::conditional_t
deque
std::hash
cigar.hpp
Auxiliary functions for the SAM IO.
seqan3
The main SeqAn3 namespace.
Definition
aligned_sequence_concept.hpp:26
seqan3::type_reduce_t
decltype(views::type_reduce(std::declval< t >())) type_reduce_t
Deduces the return value of seqan3::views::type_reduce.
Definition
type_reduce.hpp:159
std
SeqAn specific customisations in the standard namespace.
seqan3::sam_file_program_info_t
Stores information of the program/tool that was used to create a SAM/BAM file.
Definition
header.hpp:30
seqan3::sam_file_program_info_t::description
std::string description
A description of the program and/or program call.
Definition
header.hpp:35
seqan3::sam_file_program_info_t::command_line_call
std::string command_line_call
The command line call that produces the file.
Definition
header.hpp:33
seqan3::sam_file_program_info_t::previous
std::string previous
The id of the previous program if program calls were chained.
Definition
header.hpp:34
seqan3::sam_file_program_info_t::name
std::string name
The official name.
Definition
header.hpp:32
seqan3::sam_file_program_info_t::user_tags
std::string user_tags
Additional user-defined tags.
Definition
header.hpp:37
seqan3::sam_file_program_info_t::id
std::string id
A unique (file scope) id.
Definition
header.hpp:31
seqan3::sam_file_program_info_t::version
std::string version
The program/tool version.
Definition
header.hpp:36
type_reduce.hpp
Provides seqan3::views::type_reduce.
unordered_map
vector
Hide me
Version:
seqan3
io
sam_file
header.hpp
Generated on
for SeqAn3 by
1.17.0