SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
No Matches
seqan3::sam_file_input_default_traits< ref_sequences_t, ref_ids_t > Struct Template Reference

The default traits for seqan3::sam_file_input. More...

#include <seqan3/io/sam_file/input.hpp>

+ Inheritance diagram for seqan3::sam_file_input_default_traits< ref_sequences_t, ref_ids_t >:

Public Types

Member types

Definitions to model seqan3::sam_file_input_traits.

using sequence_alphabet = dna5
 The sequence alphabet is seqan3::dna5.
using sequence_legal_alphabet = dna15
 The legal sequence alphabet for parsing is seqan3::dna15.
template<typename _sequence_alphabet >
using sequence_container = std::vector< _sequence_alphabet >
 The container for a sequence is std::vector.
template<typename _id_alphabet >
using id_container = std::basic_string< _id_alphabet >
 The string type for an identifier is std::basic_string.
using quality_alphabet = phred42
 The alphabet for a quality annotation is seqan3::phred42.
template<typename _quality_alphabet >
using quality_container = std::vector< _quality_alphabet >
 The string type for a quality annotation is std::vector.
using ref_sequences = ref_sequences_t
 The type of the reference sequences is deduced on construction.
using ref_ids = ref_ids_t
 The type of the reference identifiers is deduced on construction.

Additional Inherited Members

Detailed Description

template<typename ref_sequences_t = ref_info_not_given, typename ref_ids_t = std::deque<std::string>>
struct seqan3::sam_file_input_default_traits< ref_sequences_t, ref_ids_t >

The default traits for seqan3::sam_file_input.

Template Parameters
ref_sequences_tA range over reference sequences. This type is automatically deduced on construction.
ref_ids_tA range over reference ids. This type is automatically deduced on construction.

If you wish to change a single or a few types from the default, just inherit from this class and "overwrite" the respective type definitions.

This example will make the file read into a smaller alphabet and a compressed container:

// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
#include <sstream>
using sequence_alphabet = seqan3::dna4; // instead of dna5
template <typename alph>
using sequence_container = seqan3::bitpacked_sequence<alph>; // must be defined as a template!
auto sam_file_raw = R"(@HD VN:1.6 SO:coordinate GO:none
@SQ SN:ref LN:45
r001 99 ref 7 30 8M2I4M1D3M = 37 39 TTAGATAAAGGATACTG *
r003 0 ref 29 30 5S6M * 0 0 GCCTAAGCTAA * SA:Z:ref,29,-,6H5M,17,0;
r003 2064 ref 29 17 6H5M * 0 0 TAGGC * SA:Z:ref,9,+,5S6M,30,1;
r001 147 ref 237 30 9M = 7 -39 CAGCGGCAT * NM:i:1
// ... within main you can then use:
int main()
Provides seqan3::bitpacked_sequence.
A space-optimised version of std::vector that compresses multiple letters into a single byte.
Definition bitpacked_sequence.hpp:63
The four letter DNA alphabet of A,C,G,T.
Definition dna4.hpp:50
The five letter DNA alphabet of A,C,G,T and the unknown character N.
Definition dna5.hpp:48
The SAM format (tag).
Definition format_sam.hpp:105
A class for reading SAM files, both SAM and its binary representation BAM are supported.
Definition sam_file/input.hpp:239
Provides seqan3::dna4, container aliases and string literals.
Provides seqan3::sam_file_input and corresponding traits classes.
The default traits for seqan3::sam_file_input.
Definition sam_file/input.hpp:171
Provides seqan3::type_list.

The documentation for this struct was generated from the following file:
Hide me