Loading...
Searching...
No Matches
seqan3::sequence_file_input_default_traits_dna Struct Reference
IO » Sequence File

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

`#include <seqan3/io/sequence_file/input.hpp>`

Inheritance diagram for seqan3::sequence_file_input_default_traits_dna:
[legend]

## Public Types

Member types
Definitions to satisfy seqan3::sequence_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 type of a DNA sequence is std::vector.
using | id_alphabet = char
| The alphabet for an identifier string is char.
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.

## Additional Inherited Members

Related Symbols inherited from sequence_file_input_traits
using | sequence_alphabet
| Alphabet of the characters for the seqan3::field::seq; must satisfy seqan3::alphabet.
using | sequence_legal_alphabet
| Intermediate alphabet for seqan3::field::seq; must satisfy seqan3::alphabet and be either convertible to sequence_alphabet or a character type.
using | sequence_container
| Type template of the seqan3::field::seq, a container template over sequence_alphabet; must satisfy seqan3::sequence_container.
using | id_alphabet
| Alphabet of the characters for the seqan3::field::id; must satisfy seqan3::alphabet.
using | id_container
| Type template of the seqan3::field::id, a container template over id_alphabet; must satisfy seqan3::sequence_container.
using | quality_alphabet
| Alphabet of the characters for the seqan3::field::qual; must satisfy seqan3::writable_quality_alphabet.
using | quality_container
| Type template of the seqan3::field::qual, a container template over quality_alphabet; must satisfy seqan3::sequence_container.

## Detailed Description

The default traits for seqan3::sequence_file_input.

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-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
#include <sstream>
#include <seqan3/alphabet/container/bitpacked_sequence.hpp>
#include <seqan3/alphabet/nucleotide/dna4.hpp>
#include <seqan3/io/sequence_file/input.hpp>
auto input = R"(>TEST1
ACGT
>Test2
AGGCTGA
>Test3
GGAGTATAATATATATATATATAT)";
struct my_traits : seqan3::sequence_file_input_default_traits_dna
{
using sequence_alphabet = seqan3::dna4; // instead of dna5
template <typename alph>
using sequence_container = seqan3::bitpacked_sequence<alph>; // must be defined as a template!
};
int main()
{
seqan3::sequence_file_input<my_traits> fin{std::istringstream{input}, seqan3::format_fasta{}};
}
std::istringstream
bitpacked_sequence.hpp
Provides seqan3::bitpacked_sequence.
seqan3::bitpacked_sequence
A space-optimised version of std::vector that compresses multiple letters into a single byte.
Definition bitpacked_sequence.hpp:62
seqan3::dna4
The four letter DNA alphabet of A,C,G,T.
Definition dna4.hpp:50
seqan3::format_fasta
The FASTA format.
Definition format_fasta.hpp:77
seqan3::sequence_file_input
A class for reading sequence files, e.g. FASTA, FASTQ ...
Definition sequence_file/input.hpp:206
dna4.hpp
Provides seqan3::dna4, container aliases and string literals.
input.hpp
Provides seqan3::sequence_file_input and corresponding traits classes.
sstream
seqan3::sequence_file_input_default_traits_dna
The default traits for seqan3::sequence_file_input.
Definition sequence_file/input.hpp:130
seqan3::sequence_file_input_default_traits_dna::sequence_alphabet
dna5 sequence_alphabet
The sequence alphabet is seqan3::dna5.
Definition sequence_file/input.hpp:137
seqan3::sequence_file_input_default_traits_dna::sequence_container
std::vector< _sequence_alphabet > sequence_container
The type of a DNA sequence is std::vector.
Definition sequence_file/input.hpp:144

Remarks
  For a complete overview, take a look at Sequence File

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

- sequence_file/input.hpp

Hide me