This document provides example recipes on how to carry out particular tasks using the SeqAn functionalities in C++. Please note that these recipes are not ordered . You can use the links in the table of contents or the search function of your browser to navigate them.
It will take some time, but we hope to expand this document into containing numerous great examples. If you have suggestions for how to improve the Cookbook and/or examples you would like included, please feel free to contact us.
Read sequence files
int main()
{
for (auto & [seq, id , qual] : file_in)
{
}
return 0;
}
Provides seqan3::debug_stream and related types.
debug_stream_type debug_stream
A global instance of seqan3::debug_stream_type.
Definition debug_stream.hpp:37
T temp_directory_path(T... args)
Construction and assignment of alphabet symbols
int main()
{
Meta-header for the alphabet module.
constexpr derived_type & assign_char(char_type const chr) noexcept
Assign from a character, implicitly converts invalid characters.
Definition alphabet_base.hpp:160
constexpr derived_type & assign_rank(rank_type const c) noexcept
Assign from a numeric value.
Definition alphabet_base.hpp:184
The four letter DNA alphabet of A,C,G,T.
Definition dna4.hpp:50
The SeqAn namespace for literals.
constexpr rank_type to_rank() const noexcept
Return the letter's numeric value (rank in the alphabet).
Definition alphabet_base.hpp:134
decltype(seqan3::to_rank(std::declval< semi_alphabet_type >())) alphabet_rank_t
The rank_type of the semi-alphabet; defined as the return type of seqan3::to_rank....
Definition alphabet/concept.hpp:164
Reverse complement and the six-frame translation of a string using views
This recipe creates a small program that
reads a string from the command line (first argument to the program)
"converts" the string to a range of seqan3::dna5 (Bonus: throws an exception if loss of information occurs)
prints the string and its reverse complement
prints the six-frame translation of the string
int main(int argc, char ** argv)
{
myparser.add_positional_option(s, "Please specify the DNA string." );
try
{
myparser.parse();
}
{
return 0;
}
auto s_as_dna = s | seqan3::views::char_to<seqan3::dna5>;
}
Meta-header for the Alphabet / Views submodule .
Meta-header for the Argument Parser module .
Argument parser exception that is thrown whenever there is an error while parsing the command line ar...
Definition exceptions.hpp:37
The SeqAn command line parser.
Definition argument_parser.hpp:145
constexpr auto translate
A view that translates nucleotide into aminoacid alphabet with 1, 2, 3 or 6 frames.
Definition translate.hpp:800
auto const complement
A view that converts a range of nucleotides to their complement.
Definition complement.hpp:64
Reading records
After construction, you can now read the sequence records. Our file object behaves like a range, you can use a range-based for loop to conveniently iterate over the file:
auto input = R"(>TEST1
ACGT
>Test2
AGGCTGA
>Test3
GGAGTATAATATATATATATATAT)";
int main()
{
{
}
}
The class template that file records are based on; behaves like a std::tuple.
Definition record.hpp:190
Attention An input file is a single input range , which means you can only iterate over it once !
Note It is important to write auto &
and not just auto
, otherwise you will copy the record on every iteration.
You can also use structured binding, i.e. for (auto & [seq, id, qual] : fin)
But beware: with structured bindings you do need to get the order of elements correct!
You can also read a file in chunks:
Reading records in chunks
int main()
{
for (
auto && records : fin |
seqan3 ::views::chunk(10))
{
}
Provides seqan3::views::chunk.
T current_path(T... args)
Meta-header for the IO / Sequence File submodule .
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
The example above will iterate over the file by reading 10 records at a time. If no 10 records are available anymore, it will just print the remaining records.
Applying a filter to a file
On some occasions you are only interested in sequence records that fulfill a certain criterion, e.g. having a minimum sequence length or a minimum average quality.
This recipe can be used to filter the sequences in your file by a custom criterion.
int main()
{
auto minimum_quality_filter = std::views::filter(
[](auto const & rec)
{
auto qualities = rec.base_qualities()
| std::views::transform(
[](auto quality)
{
});
return sum / std::ranges::size(qualities) >= 40;
});
for (auto & rec : fin | minimum_quality_filter)
{
}
}
constexpr auto to_phred
The public getter function for the Phred representation of a quality score.
Definition alphabet/quality/concept.hpp:97
Reading paired-end reads
In modern Next Generation Sequencing experiments you often have paired-end read data which is split into two files. The read pairs are identified by their identical name/id and position in the two files.
This recipe can be used to handle one pair of reads at a time.
int main()
{
for (
auto && [rec1, rec2] :
seqan3 ::views::
zip (fin1, fin2))
{
if (rec1.id() != rec2.id())
}
}
seqan::stl::views::zip zip
A view adaptor that takes several views and returns tuple-like values from every i-th element of each...
Definition zip.hpp:24
Provides seqan3::views::zip.
Storing records in a std::vector
This recipe creates a small program that reads in a FASTA file and stores all the records in a std::vector .
int main()
{
using record_type = decltype (fin)::record_type;
{
}
}
T back_inserter(T... args)
Note that you can move the record out of the file if you want to store it somewhere without copying.
int main()
{
using record_type = typename decltype (fin)::record_type;
record_type rec = std::move(*fin.begin());
}
Writing records
The easiest way to write to a sequence file is to use the seqan3::sequence_file_output::push_back() or seqan3::sequence_file_output::emplace_back() member functions. These work similarly to how they work on a std::vector .
int main()
{
for (int i = 0; i < 5; ++i)
{
seqan3::dna5_vector
sequence {
"ACGT" _dna5};
}
}
A class for writing sequence files, e.g. FASTA, FASTQ ...
Definition io/sequence_file/output.hpp:66
The record type of seqan3::sequence_file_input.
Definition sequence_file/record.hpp:26
Provides seqan3::dna5, container aliases and string literals.
The generic concept for a (biological) sequence.
Provides seqan3::sequence_file_output and corresponding traits classes.
Provides seqan3::sequence_record.
A class template that holds a choice of seqan3::field.
Definition record.hpp:125
Type that contains multiple types.
Definition type_list.hpp:26
The class seqan3::sequence_file_output takes an extra parameter allowing to custom select the fields and their order.
int main()
{
for (int i = 0; i < 5; i++)
{
{'A' _dna5, '1' _phred42},
{'C' _dna5, '3' _phred42}};
auto view_on_seq = seqan3::views::elements<0>(seq_qual);
auto view_on_qual = seqan3::views::elements<1>(seq_qual);
fout.emplace_back(id , view_on_seq, view_on_qual);
fout.push_back(
std::tie (
id , view_on_seq, view_on_qual));
}
}
Provides seqan3::views::elements.
Provides seqan3::phred42 quality scores.
Provides quality alphabet composites.
File conversion
Define a custom scoring scheme
Provides seqan3::aminoacid_scoring_scheme.
Provides seqan3::hamming_scoring_scheme.
Provides seqan3::nucleotide_scoring_scheme.
auto sc_nc = nc_scheme.score('A' _dna4, 'C' _dna4);
auto sc_aa = aa_scheme.score('M' _aa27, 'K' _aa27);
A data structure for managing and computing the score of two amino acids.
Definition aminoacid_scoring_scheme.hpp:72
constexpr void set_similarity_matrix(aminoacid_similarity_matrix const matrix_id)
Set the similarity matrix scheme (e.g. blosum62).
Definition aminoacid_scoring_scheme.hpp:118
A data structure for managing and computing the score of two nucleotides.
Definition nucleotide_scoring_scheme.hpp:35
@ blosum30
The blosum30 matrix for very distantly related proteins.
A strong type of underlying type score_type that represents the score of two matching characters.
Definition scoring_scheme_base.hpp:38
A strong type of underlying type score_type that represents the score two different characters.
Definition scoring_scheme_base.hpp:63
Attention SeqAn's alignment algorithm computes the maximal similarity score, thus the match score must be set to a positive value and the scores for mismatch and gap must be negative in order to maximize over the matching letters.
Calculate edit distance for a set of sequences
This recipe can be used to calculate the edit distance for all six pairwise combinations. Here we only allow at most 7 errors and filter all alignments with 6 or fewer errors.
int main()
{
std::vector vec{
"ACGTGACTGACT" _dna4,
"ACGAAGACCGAT" _dna4,
"ACGTGACTGACT" _dna4,
"AGGTACGAGCGACACT" _dna4};
auto filter_v = std::views::filter(
[](auto && res)
{
return res.score() >= -6;
});
for (auto const & result : alignment_results | filter_v)
{
}
}
Provides pairwise alignment function.
Sets the global alignment method.
Definition align_config_method.hpp:119
Sets the minimal score (maximal errors) allowed during an distance computation e.g....
Definition align_config_min_score.hpp:36
Configures the alignment result to output the score.
Definition align_config_output.hpp:40
Provides seqan3::dna4, container aliases and string literals.
constexpr configuration edit_scheme
Shortcut for edit distance configuration.
Definition align_config_edit.hpp:48
constexpr auto align_pairwise(sequence_t &&seq, alignment_config_t const &config)
Computes the pairwise alignment for a pair of sequences or a range over sequence pairs.
Definition align_pairwise.hpp:130
constexpr auto pairwise_combine
A view adaptor that generates all pairwise combinations of the elements of the underlying range.
Definition pairwise_combine.hpp:647
Provides seqan3::views::pairwise_combine.
Searching for matches
This recipe can be used to search for all occurrences of a substring and print the number of hits and the positions in an ascending ordering.
void run_text_single()
{
seqan3::dna4_vector text{
"CGCTGTCTGAAGGATGAGTGTCAGCCAGTGTAACCCGATGAGCTACCCAGTAGTCGAACTGGGCCAGACAACCCGGCGCTAATGCACTCA" _dna4};
<< "The following hits were found:\n" ;
for (
auto && result :
search (
"GCT" _dna4, index))
}
void run_text_collection()
{
"ACCCGATGAGCTACCCAGTAGTCGAACTG" _dna4,
"GGCCAGACAACCCGGCGCTAATGCACTCA" _dna4};
<< "The following hits were found:\n" ;
for (
auto && result :
search (
"GCT" _dna4, index))
}
int main()
{
run_text_single();
run_text_collection();
}
The SeqAn FM Index.
Definition fm_index.hpp:185
Provides the unidirectional seqan3::fm_index.
Provides the public interface for search algorithms.
If you want to allow errors in your query, you need to configure the approximate search with the following search configuration objects:
To search for either 1 insertion or 1 deletion you can use the seqan3::search_cfg::error_count :
std::string text{
"Garfield the fat cat without a hat." };
Collection of elements to configure an algorithm.
Definition configuration.hpp:42
Configuration element that represents the number or rate of deletion errors.
Definition max_error.hpp:170
Configuration element that represents the number or rate of insertion errors.
Definition max_error.hpp:124
Configuration element that represents the number or rate of substitution errors.
Definition max_error.hpp:79
Configuration element that represents the number or rate of total errors.
Definition max_error.hpp:34
A strong type of underlying type uint8_t that represents the number of errors.
Definition max_error_common.hpp:29
Reading the CIGAR information from a SAM file and constructing an alignment
This recipe can be used to:
Read in a FASTA file with the reference and a SAM file with the alignment
Filter the alignment records and only take those with a mapping quality >= 30.
For the resulting alignments, print which read was mapped against with reference id and the number of seqan3::gap 's involved in the alignment (either in aligned reference or in read sequence).
int main()
{
for (
auto &&
record : reference_file)
{
reference_sequences.push_back(std::move(
record .sequence()));
}
auto mapq_filter = std::views::filter(
{
return record .mapping_quality() >= 30;
});
for (
auto &
record : mapping_file | mapq_filter)
{
reference_sequences[
record .reference_id().value()],
record .reference_position().value(),
size_t sum_reference{};
++sum_reference;
<< (reference_id ?
std::to_string (reference_id.value()) :
"unknown reference" ) <<
" with "
<< sum_read << " gaps in the read sequence and " << sum_reference
<< " gaps in the reference sequence.\n" ;
}
}
Provides the function seqan3::alignment_from_cigar.
The alphabet of a gap character '-'.
Definition gap.hpp:36
auto alignment_from_cigar(std::vector< cigar > const &cigar_vector, reference_type const &reference, uint32_t const zero_based_reference_start_position, sequence_type const &query)
Construct an alignment from a CIGAR string and the corresponding sequences.
Definition alignment_from_cigar.hpp:81
@ alignment
The (pairwise) alignment stored in an object that models seqan3::detail::pairwise_alignment.
constexpr auto const & get(configuration< configs_t... > const &config) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition configuration.hpp:412
SeqAn specific customisations in the standard namespace.
Provides the seqan3::record template and the seqan3::field enum.
Map reads and write output to SAM file
For a full recipe on creating your own readmapper, see the very end of the tutorial Implementing your own read mapper with SeqAn .
reference_storage_t & storage,
uint8_t const errors)
{
{
cereal::BinaryInputArchive iarchive{is};
iarchive(index);
}
for (
auto &&
record : query_file_in)
{
auto & query =
record .sequence();
for (
auto && result :
search (query, index, search_config))
{
size_t start = result.reference_begin_position() ? result.reference_begin_position() - 1 : 0;
{
sam_out.emplace_back(query,
storage.ids[result.reference_id()],
ref_offset,
map_qual);
}
}
}
}
Configures the alignment result to output the alignment.
Definition align_config_output.hpp:168
Configures the alignment result to output the begin positions.
Definition align_config_output.hpp:128
The SeqAn Bidirectional FM Index.
Definition bi_fm_index.hpp:58
The seqan3::cigar semialphabet pairs a counter with a seqan3::cigar::operation letter.
Definition alphabet/cigar/cigar.hpp:57
A class for writing SAM files, both SAM and its binary representation BAM are supported.
Definition io/sam_file/output.hpp:71
Configuration element to receive all hits with the lowest number of errors within the error bounds.
Definition hit.hpp:56
auto cigar_from_alignment(alignment_type const &alignment, cigar_clipped_bases const &clipped_bases={}, bool const extended_cigar=false)
Creates a CIGAR string (SAM format) given a seqan3::detail::pairwise_alignment represented by two seq...
Definition cigar_from_alignment.hpp:111
@ ref_offset
Sequence (seqan3::field::ref_seq) relative start position (0-based), unsigned value.
@ cigar
The cigar vector (std::vector<seqan3::cigar>) representing the alignment in SAM/BAM format.
@ mapq
The mapping quality of the seqan3::field::seq alignment, usually a Phred-scaled score.
@ ref_id
The identifier of the (reference) sequence that seqan3::field::seq was aligned to.
@ id
The identifier, usually a string.
@ seq
The "sequence", usually a range of nucleotides or amino acids.
@ qual
The qualities, usually in Phred score notation.
A strong type representing free_end_gaps_sequence1_leading of the seqan3::align_cfg::method_global.
Definition align_config_method.hpp:65
A strong type representing free_end_gaps_sequence1_trailing of the seqan3::align_cfg::method_global.
Definition align_config_method.hpp:85
A strong type representing free_end_gaps_sequence2_leading of the seqan3::align_cfg::method_global.
Definition align_config_method.hpp:75
A strong type representing free_end_gaps_sequence2_trailing of the seqan3::align_cfg::method_global.
Definition align_config_method.hpp:95
Constructing a basic argument parser
{
}
struct cmd_arguments
{
};
{
'r' ,
"reference" ,
"The path to the reference." ,
'o' ,
"output" ,
"The output index file path." ,
}
int main(int argc, char const ** argv)
{
cmd_arguments args{};
initialise_argument_parser(parser, args);
try
{
parser.parse();
}
{
return -1;
}
run_program(args.reference_path, args.index_path);
return 0;
}
void add_option(option_type &value, char const short_id, std::string const &long_id, std::string const &desc, option_spec const spec=option_spec::standard, validator_type option_validator=validator_type{})
Adds an option to the seqan3::argument_parser.
Definition argument_parser.hpp:236
argument_parser_meta_data info
Aggregates all parser related meta data (see seqan3::argument_parser_meta_data struct).
Definition argument_parser.hpp:634
A validator that checks if a given path is a valid output file.
Definition validators.hpp:645
@ standard
The default were no checking or special displaying is happening.
Definition auxiliary.hpp:248
@ required
Definition auxiliary.hpp:249
Constructing a subcommand argument parser
struct pull_arguments
{
bool progress{false };
};
{
pull_arguments args{};
try
{
}
{
return -1;
}
seqan3::debug_stream <<
"Git pull with repository " << args.repository <<
" and branch " << args.branch <<
'\n' ;
return 0;
}
struct push_arguments
{
bool push_all{false };
};
{
push_arguments args{};
parser.
add_positional_option (args.branches,
"The branch names to push (if none are given, push current)." );
try
{
}
{
return -1;
}
seqan3::debug_stream <<
"Git push with repository " << args.repository <<
" and branches " << args.branches <<
'\n' ;
return 0;
}
int main(int argc, char const ** argv)
{
top_level_parser.add_flag(flag, 'f' , "flag" , "some flag" );
try
{
top_level_parser.parse();
}
{
return -1;
}
return run_git_pull(sub_parser);
return run_git_push(sub_parser);
else
return 0;
}
void add_positional_option(option_type &value, std::string const &desc, validator_type option_validator=validator_type{})
Adds a positional option to the seqan3::argument_parser.
Definition argument_parser.hpp:312
void parse()
Initiates the actual command line parsing.
Definition argument_parser.hpp:402
argument_parser & get_sub_parser()
Returns a reference to the sub-parser instance if subcommand parsing was enabled.
Definition argument_parser.hpp:436
@ flag
The alignment flag (bit information), uint16_t value.
@ on
Automatic update notifications should be enabled.
Serialise data structures with cereal
#include <seqan3/test/tmp_directory.hpp>
#include <cereal/archives/binary.hpp>
#include <cereal/types/vector.hpp>
{
cereal::BinaryInputArchive archive(is);
archive(data);
}
{
cereal::BinaryOutputArchive archive(os);
archive(data);
}
int main()
{
seqan3::test::tmp_directory tmp{};
auto tmp_file = tmp.path() / "data.out" ;
return 0;
}
constexpr void store(void *mem_addr, simd_t const &simd_vec)
Store simd_t size bits of integral data into memory.
Definition algorithm.hpp:374
constexpr simd_t load(void const *mem_addr)
Load simd_t size bits of integral data from memory.
Definition algorithm.hpp:333
Converting a range of an alphabet
using seqan3::operator"" _dna4;
using seqan3::operator"" _dna5;
using seqan3::operator"" _phred42;
int main()
{
{'C' _dna4, 'A' _phred42},
{'G' _dna4, '6' _phred42},
{'T' _dna4, '&' _phred42}};
auto view1 = sequence1
| std::views::transform(
[](auto const & in)
{
});
auto view2 = sequence2 | std::views::take(8)
| std::views::transform(
[](auto && in)
{
return static_cast< seqan3::dna4 > (std::forward<decltype(in)>(in));
});
return 0;
}
Provides aliases for qualified.
A custom dna4 alphabet that converts all unknown characters to A
When assigning from char
or converting from a larger nucleotide alphabet to a smaller one, loss of information can occur since obviously some bases are not available. When converting to seqan3::dna5 or seqan3::rna5 , non-canonical bases (letters other than A, C, G, T, U) are converted to 'N'
to preserve ambiguity at that position. For seqan3::dna4 and seqan3::rna4 there is no letter 'N'
to represent ambiguity, so the conversion from char
for IUPAC characters tries to choose the best fitting alternative (see seqan3::dna4 for more details).
If you would like to always convert unknown characters to A
instead, you can create your own alphabet with a respective char conversion table very easily like this:
{
public :
private :
static constexpr char_type rank_to_char(rank_type const rank)
{
return rank_to_char_table[rank];
}
static constexpr rank_type char_to_rank(char_type const chr)
{
return char_to_rank_table[static_cast< index_t> (chr)];
}
static constexpr rank_type rank_complement(rank_type const rank)
{
return rank_complement_table[rank];
}
private :
static constexpr char_type rank_to_char_table[
alphabet_size ]{
'A' ,
'C' ,
'G' ,
'T' };
[]() constexpr
{
conversion_table['C' ] = conversion_table['c' ] = 1;
conversion_table['G' ] = conversion_table['g' ] = 2;
conversion_table['T' ] = conversion_table['t' ] = 3;
conversion_table['U' ] = conversion_table['T' ];
conversion_table['u' ] = conversion_table['t' ];
return conversion_table;
}()};
3,
2,
1,
0
};
};
constexpr my_dna4 operator "" _my_dna4(char const c) noexcept
{
}
int main()
{
my_dna4 my_letter{'C' _my_dna4};
my_letter.assign_char('S' );
}
A CRTP-base that refines seqan3::alphabet_base and is used by the nucleotides.
Definition nucleotide_base.hpp:41
constexpr nucleotide_base() noexcept=default
Defaulted.
constexpr auto complement
Return the complement of a nucleotide object.
Definition alphabet/nucleotide/concept.hpp:102
constexpr auto alphabet_size
A type trait that holds the size of a (semi-)alphabet.
Definition alphabet/concept.hpp:834
Provides seqan3::nucleotide_base.
If you are interested in custom alphabets, also take a look at our tutorial How to write your own alphabet .
Controlling threads of (de-)compression streams
When reading or writing compressed files , parallelisation is automatically applied when using BGZF-compressed files, e.g., BAM files. This will use 4
threads by default and can be adjusted by setting seqan3::contrib::bgzf_thread_count
to the desired value:
int main()
{
seqan3::contrib::bgzf_thread_count = 1u;
return 0;
}
Meta-header for the IO module .
Auto vectorized dna4 complement
Our alphabet seqan3::dna4 cannot be easily auto-vectorized by the compiler.
See this discussion for more details.
You can add your own alphabet that is auto-vectorizable in some use cases. Here is an example for a dna4-like alphabet:
{
private :
friend base_t::base_t;
public :
constexpr simd_dna4() noexcept = default;
constexpr simd_dna4(simd_dna4 const &) noexcept = default;
constexpr simd_dna4(simd_dna4 &&) noexcept = default;
constexpr simd_dna4 & operator=(simd_dna4 const &) noexcept = default;
constexpr simd_dna4 & operator=(simd_dna4 &&) noexcept = default;
~simd_dna4() noexcept = default;
constexpr simd_dna4(t const r) noexcept
{
}
using base_t::assign_rank;
using base_t::base_t;
using base_t::to_rank;
static constexpr uint8_t alphabet_size = 4;
constexpr simd_dna4 &
assign_char (char_type
const c)
noexcept
{
char_type const upper_case_char = c & 0b0101'1111;
rank_type rank = (upper_case_char == 'T' ) * 3 + (upper_case_char == 'G' ) * 2 + (upper_case_char == 'C' );
}
constexpr char_type
to_char () const noexcept
{
switch (rank)
{
case 0u:
return 'A' ;
case 1u:
return 'C' ;
case 2u:
return 'G' ;
default :
return 'T' ;
}
}
{
rank ^= 0b11;
simd_dna4 ret{};
return ret.assign_rank(rank);
}
{
char_type const upper_case_char = c & 0b0101'1111;
return (upper_case_char == 'A' ) || (upper_case_char == 'C' ) || (upper_case_char == 'G' )
|| (upper_case_char == 'T' );
}
};
constexpr char_type to_char() const noexcept
Return the letter as a character of char_type.
Definition alphabet_base.hpp:112
static constexpr bool char_is_valid(char_type const c) noexcept
Validate whether a character value has a one-to-one mapping to an alphabet value.
Definition nucleotide_base.hpp:138
alphabet_base< derived_type, size, char > base_t
Type of the base class.
Definition nucleotide_base.hpp:44
constexpr derived_type complement() const noexcept
Return the complement of the letter.
Definition nucleotide_base.hpp:111
The four letter RNA alphabet of A,C,G,U.
Definition rna4.hpp:46
All SeqAn documentation snippets
The following lists all snippets that appear in our documentation. Search for keywords with Strg + F
.
int main()
{
{1, 'D' _cigar_operation},
{2, 'M' _cigar_operation}};
uint32_t reference_start_position{0};
seqan3::dna5_vector reference = "ACTGATCGAGAGGATCTAGAGGAGATCGTAGGAC" _dna5;
seqan3::dna5_vector query = "ACGA" _dna5;
}
Provides the seqan3::cigar alphabet.
auto sam_file_raw = R"(@HD VN:1.6
@SQ SN:ref LN:34
read1 41 ref 1 61 1S1M1D1M1I ref 10 300 ACGT !##$ AS:i:2 NM:i:7
read2 42 ref 2 62 1H7M1D1M1S2H ref 10 300 AGGCTGNAG !##$&'()* xy:B:S,3,4,5
read3 43 ref 3 63 1S1M1P1M1I1M1I1D1M1S ref 10 300 GGAGTATA !!*+,-./
)";
int main()
{
seqan3::dna5_vector reference = "ACTGATCGAGAGGATCTAGAGGAGATCGTAGGAC" _dna5;
for (auto && rec : fin)
{
alignment_from_cigar (rec.cigar_sequence(), reference, rec.reference_position().value(), rec.sequence());
}
}
Meta-header for the IO / SAM File submodule .
int main()
{
seqan3::dna5_vector reference = "ATGGCGTAGAGCTTCCCCCCCCCCCCCCCCC" _dna5;
seqan3::dna5_vector read = "ATGCCCCGTTGCTT" _dna5;
seqan3::insert_gap(aligned_read, aligned_read.begin() + 11, 2);
seqan3::insert_gap(aligned_reference, aligned_reference.begin() + 4, 2);
}
Includes the aligned_sequence and the related insert_gap and erase_gap functions to enable stl contai...
Provides the function seqan3::cigar_from_alignment and a helper struct seqan3::cigar_clipped_bases.
A gap decorator allows the annotation of sequences with gap symbols while leaving the underlying sequ...
Definition gap_decorator.hpp:78
Provides seqan3::gap_decorator.
constexpr auto slice
A view adaptor that returns a half-open interval on the underlying range.
Definition slice.hpp:137
Provides seqan3::views::slice.
int main()
{
seqan3::dna5_vector reference = "ATGGCGTAGAGCTTCCCCCCCCCCCCCCCCC" _dna5;
seqan3::dna5_vector read = "ATGCCCCGTTGCTT" _dna5;
seqan3::insert_gap(aligned_reference, aligned_reference.begin() + 4, 2);
seqan3::insert_gap(aligned_query, aligned_query.begin() + 11, 2);
auto cigar_sequence =
{.hard_front = 1, .hard_back = 0, .soft_front = 0, .soft_back = 2});
}
int main()
{
}
Provides seqan3::detail::align_config_band.
Configuration element for setting a fixed size band.
Definition align_config_band.hpp:60
A strong type representing the lower diagonal of the seqan3::align_cfg::band_fixed_size.
Definition align_config_band.hpp:28
A strong type representing the upper diagonal of the seqan3::align_cfg::band_fixed_size.
Definition align_config_band.hpp:39
int main()
{
auto cfg_errors =
}
Provides seqan3::align_cfg::edit_scheme.
Provides global and local alignment configurations.
Provides seqan3::align_cfg::min_score configuration.
int main()
{
int open = affine_cfg.open_score;
int extension = affine_cfg.extension_score;
}
Provides seqan3::align_config::gap_cost_affine.
A configuration element for the affine gap cost scheme.
Definition align_config_gap_cost_affine.hpp:72
A strong type of underlying type int32_t that represents the score (usually negative) of any characte...
Definition align_config_gap_cost_affine.hpp:48
A strong type of underlying type int32_t that represents a score (usually negative) that is incurred ...
Definition align_config_gap_cost_affine.hpp:31
int main()
{
auto seq1 = "TCGT" _dna4;
auto seq2 = "ACGA" _dna4;
}
Provides seqan3::align_cfg::scoring_scheme.
Sets the scoring scheme for the alignment algorithm.
Definition align_config_scoring_scheme.hpp:42
int main()
{
auto seq1 = "TCGT" _dna4;
auto seq2 = "ACGA" _dna4;
}
Sets the local alignment method.
Definition align_config_method.hpp:42
int main()
{
auto min_score = std::get<seqan3::align_cfg::min_score>(config);
min_score.score = -5;
}
Provides seqan3::configuration and utility functions.
int main()
{
{
}};
}
Provides seqan3::align_cfg::on_result.
Configuration element to provide a user defined callback function for the alignment.
Definition align_config_on_result.hpp:51
int main()
{
}
Provides configuration for alignment output.
int main()
{
}
Configures the alignment result to output the end position.
Definition align_config_output.hpp:84
int main()
{
std::pair p{
"ACGTAGC" _dna4,
"AGTACGACG" _dna4};
for (auto res :
<< res << "\n" ;
}
@ output_score
ID for the score output option.
@ output_alignment
ID for the alignment output option.
int main()
{
}
Configures the alignment result to output the id of the first sequence.
Definition align_config_output.hpp:208
int main()
{
}
Configures the alignment result to output the id of the second sequence.
Definition align_config_output.hpp:247
int main()
{
;
}
Provides seqan3::align_cfg::parallel configuration.
A global configuration type used to enable parallel execution of algorithms.
Definition configuration_element_parallel_mode.hpp:29
T hardware_concurrency(T... args)
int main()
{
}
Provides alignment configuration seqan3::align_cfg::score_type.
A configuration element to set the score type used in the alignment algorithm.
Definition align_config_score_type.hpp:33
int main()
{
}
Provides seqan3::align_cfg::vectorised configuration.
Enables the vectorised alignment computation if possible for the current configuration.
Definition align_config_vectorised.hpp:39
int main()
{
auto seq1 = "ACGT" _dna4;
auto seq2 = "ACCT" _dna4;
}
{
public :
friend base_t;
using typename base_t::alignment_column_type;
using value_type = int;
using reference = int &;
my_matrix() = default ;
my_matrix(my_matrix const &) = default ;
my_matrix(my_matrix &&) = default ;
my_matrix &
operator= (my_matrix
const &) =
default ;
my_matrix &
operator= (my_matrix &&) =
default ;
~my_matrix() = default ;
my_matrix(size_t const num_rows, size_t const num_cols) : num_rows{num_rows}, num_cols{num_cols}
{
data.resize(num_rows * num_cols);
}
protected :
size_t num_rows{};
size_t num_cols{};
{
return alignment_column_type{*this ,
column_data_view_type{
std::addressof (data[num_rows * column_index]), num_rows}};
}
template <std::random_access_iterator iter_t>
constexpr reference
make_proxy (iter_t iter)
noexcept
{
return *iter;
}
};
int main()
{
my_matrix matrix{3, 5};
int val = 0;
for (auto col : matrix)
for (auto & cell : col)
cell = val++;
for (auto col : matrix)
}
Provides seqan3::detail::alignment_matrix_column_major_range_base.
Provides a range interface for alignment matrices.
Definition alignment_matrix_column_major_range_base.hpp:60
constexpr alignment_matrix_column_major_range_base & operator=(alignment_matrix_column_major_range_base const &)=default
Defaulted.
alignment_column_type initialise_column(size_t column_index)
Returns the current alignment-column at the given column_index.
Definition alignment_matrix_column_major_range_base.hpp:447
value_type make_proxy(iter_t host_iter) noexcept
Creates the proxy value returned when dereferencing the alignment-column-iterator.
Definition alignment_matrix_column_major_range_base.hpp:433
int main()
{
std::vector {-0, -1, -2, -3, -4, -5, -6, -7, -8, -1, -0, -1, -2, -3, -4, -5, -6, -7, -2, -1, -1, -1, -2,
-3, -4, -5, -6, -3, -2, -2, -2, -2, -2, -3, -4, -5, -4, -3, -3, -3, -3, -3, -3, -3, -4}};
seqan3::debug_stream <<
"score_matrix: " << score_matrix.cols() <<
" columns and " << score_matrix.rows()
<< " rows\n" ;
return 0;
}
A debug matrix to wrap alignment matrices and sequences and make them printable together.
Definition debug_matrix.hpp:60
A two dimensional matrix used inside of alignment algorithms.
Definition two_dimensional_matrix.hpp:62
Provides the declaration of seqan3::detail::debug_matrix.
@ utf8
Enables use of non-ASCII UTF8 characters in formatted output.
Strong type for setting the column dimension of a matrix.
Definition two_dimensional_matrix.hpp:29
Strong type for setting the row dimension of a matrix.
Definition two_dimensional_matrix.hpp:37
int main()
{
using seqan3::operator|;
std::vector {N, L, L, L, L, L, L, L, L, U, D, D | L, L, L, L,
L, L, L, U, U, D, D, D | L, L, L, L, L, U, U, D | U,
D | U, D, D, D | L, L, L, U, U, D | U, D | U, D | U, D | U, D, D, D | L}};
seqan3::debug_stream <<
"trace_matrix: " << trace_matrix.cols() <<
" columns and " << trace_matrix.rows()
<< " rows\n" ;
return 0;
}
@ up
Trace comes from the above entry.
@ left
Trace comes from the left entry.
@ diagonal
Trace comes from the diagonal entry.
Provides seqan3::views::to_char.
int main()
{
{
std::pair p{
"ACGTAGC" _dna4,
"AGTACGACG" _dna4};
}
{
}
std::pair {
"AGTAGACTACG" _dna4,
"ACGTACGACACG" _dna4},
std::pair {
"AGTTACGAC" _dna4,
"AGTAGCGATCG" _dna4}};
}
int main()
{
std::vector data1{
"AGTGCTACG" _dna4,
"AGTAGACTACG" _dna4,
"AGTTACGAC" _dna4};
std::vector data2{
"ACGTGCGACTAG" _dna4,
"ACGTACGACACG" _dna4,
"AGTAGCGATCG" _dna4};
auto config =
}
Meta-header for the Alignment / Configuration submodule .
A scoring scheme that assigns a score of 0 to matching letters and -1 to mismatching letters.
Definition hamming_scoring_scheme.hpp:33
int main()
{
using first_seq_t = std::tuple_element_t<0, std::ranges::range_value_t<sequences_t>>;
using second_seq_t = std::tuple_element_t<1, std::ranges::range_value_t<sequences_t>>;
using result_t =
config_t>::type>;
using function_wrapper_t =
std::function <result_t(first_seq_t &, second_seq_t &)>;
static_assert (seqan3::detail::is_type_specialisation_of_v<function_wrapper_t, std::function>);
}
Provides seqan3::detail::alignment_selector.
Stores the alignment results and gives access to score, alignment and the front and end positions.
Definition alignment_result.hpp:147
int main()
{
auto const alignment_config =
auto const alignment_config_with_callback =
alignment_config
{
}};
}
int main()
{
seqan3::debug_stream <<
"blosum62 score for T and S: " << (int)scheme.score(
'T' _aa27,
'S' _aa27) <<
"\n" ;
seqan3::debug_stream <<
"blosum80 score for 'T'_aa27 and 'S'_aa20: " << (int)scheme.score(
'T' _aa27,
'S' _aa20)
<< "\n" ;
scheme.set_hamming_distance();
seqan3::debug_stream <<
"Hamming distance between T and S: " << (int)scheme.score(
'T' _aa27,
'S' _aa20)
<< "\n" ;
seqan3::debug_stream <<
"Hamming distance between T and T: " << (int)scheme.score(
'T' _aa27,
'T' _aa20)
<< "\n" ;
seqan3::debug_stream <<
"blosum80 score between T and S: " << (int)scheme2.score(
'T' _aa27,
'S' _aa27)
<< "\n" ;
auto & cell = scheme2.score('T' _aa27, 'S' _aa27);
cell = 3;
seqan3::debug_stream <<
"New score after editing entry: " << (int)scheme2.score(
'T' _aa27,
'S' _aa27) <<
"\n" ;
int score = 0;
for (
auto pair :
seqan3 ::views::
zip (one, two))
score += scheme3.score(
std ::
get <0>(pair),
std ::
get <1>(pair));
}
Provides seqan3::aa27, container aliases and string literals.
Meta-header for the Alphabet / Aminoacid submodule .
@ blosum80
The blosum80 matrix for closely related proteins.
@ blosum62
The blosum62 matrix recommended for most use-cases.
int main()
{
<< "\n" ;
<< "\n" ;
<< "\n" ;
scheme2.
score (
'A' _dna15,
'G' _dna15) = 3;
int score = 0;
for (
auto pair :
seqan3 ::views::
zip (one, two))
score += scheme3.score(
std ::
get <0>(pair),
std ::
get <1>(pair));
}
constexpr void set_simple_scheme(match_score< score_arg_t > const ms, mismatch_score< score_arg_t > const mms)
Set the simple scheme (everything is either match or mismatch).
Definition scoring_scheme_base.hpp:175
constexpr score_t & score(alph1_t const alph1, alph2_t const alph2) noexcept
Score two letters (either two nucleotids or two amino acids).
Definition scoring_scheme_base.hpp:214
Provides seqan3::rna15, container aliases and string literals.
int main()
{
seqan3::dna4_vector
sequence =
"ACGT" _dna4;
}
int main()
{
}
constexpr auto assign_char_to
Assign a character to an alphabet object.
Definition alphabet/concept.hpp:517
constexpr auto to_char
Return the char representation of an alphabet object.
Definition alphabet/concept.hpp:381
constexpr auto assign_rank_to
Assign a rank to an alphabet object.
Definition alphabet/concept.hpp:288
constexpr auto to_rank
Return the rank representation of a (semi-)alphabet object.
Definition alphabet/concept.hpp:152
{
private :
static constexpr char_type rank_to_char(rank_type const rank)
{
return rank_to_char_table[
rank ];
return rank == 1 ? 'B' : 'A' ;
}
static constexpr rank_type char_to_rank(char_type const chr)
{
return char_to_rank_table[static_cast< index_t> (chr)];
}
private :
[]()
{
ret['b' ] = 1;
ret['B' ] = 1;
return ret;
}()};
};
Core alphabet concept and free function/type trait wrappers.
Provides seqan3::alphabet_base.
rank_type rank
The value of the alphabet letter is stored as the rank.
Definition alphabet_base.hpp:258
The generic alphabet concept that covers most data types used in ranges.
Refines seqan3::alphabet and adds assignability.
constexpr char_type to_lower(char_type const c) noexcept
Converts 'A'-'Z' to 'a'-'z' respectively; other characters are returned as is.
Definition transform.hpp:74
int main()
{
auto sigma_char = seqan3::alphabet_size<char>;
static_assert (std::same_as<decltype (sigma_char), uint16_t>);
auto sigma_dna5 = seqan3::alphabet_size<seqan3::dna5>;
static_assert (std::same_as<decltype (sigma_dna5), uint8_t>);
std::cout << static_cast<uint16_t>(sigma_dna5) << '\n' ;
}
Provides alphabet adaptations for standard char types.
int main()
{
letter.assign_char('?' );
}
Provides seqan3::aa10li, container aliases and string literals.
The reduced Li amino acid alphabet.
Definition aa10li.hpp:80
int main()
{
auto letter2 = 'A' _aa10li;
}
int main()
{
seqan3::aa10li_vector sequence1{"ACGTTA" _aa10li};
seqan3::aa10li_vector sequence2 = "ACGTTA" _aa10li;
auto sequence3 = "ACGTTA" _aa10li;
}
int main()
{
letter.assign_char('?' );
}
Provides seqan3::aa10murphy, container aliases and string literals.
The reduced Murphy amino acid alphabet.
Definition aa10murphy.hpp:79
int main()
{
auto letter2 = 'A' _aa10murphy;
}
int main()
{
seqan3::aa10murphy_vector sequence1{"ACGTTA" _aa10murphy};
seqan3::aa10murphy_vector sequence2 = "ACGTTA" _aa10murphy;
auto sequence3 = "ACGTTA" _aa10murphy;
}
int main()
{
letter.assign_char('?' );
}
Provides seqan3::aa20, container aliases and string literals.
The canonical amino acid alphabet.
Definition aa20.hpp:61
int main()
{
auto letter2 = 'A' _aa20;
}
int main()
{
seqan3::aa20_vector sequence1{"ACGTTA" _aa20};
seqan3::aa20_vector sequence2 = "ACGTTA" _aa20;
auto sequence3 = "ACGTTA" _aa20;
}
int main()
{
letter.assign_char('?' );
}
The twenty-seven letter amino acid alphabet.
Definition aa27.hpp:43
int main()
{
auto letter2 = 'A' _aa27;
}
int main()
{
seqan3::aa27_vector sequence1{"ACGTTA" _aa27};
seqan3::aa27_vector sequence2 = "ACGTTA" _aa27;
auto sequence3 = "ACGTTA" _aa27;
}
namespace your_namespace
{
{
};
}
static_assert (seqan3::enable_aminoacid<your_namespace::your_aa> == true );
namespace your_namespace2
{
struct your_aa
{
};
{
return true ;
}
}
static_assert (seqan3::enable_aminoacid<your_namespace2::your_aa> == true );
Provides seqan3::aminoacid_alphabet.
constexpr bool enable_aminoacid
A trait that indicates whether a type shall model seqan3::aminoacid_alphabet.
Definition alphabet/aminoacid/concept.hpp:143
This is an empty base class that can be inherited by types that shall model seqan3::aminoacid_alphabe...
Definition alphabet/aminoacid/concept.hpp:32
int main()
{
char c = '!' ;
}
The five letter DNA alphabet of A,C,G,T and the unknown character N.
Definition dna5.hpp:48
constexpr auto assign_char_strictly_to
Assign a character to an alphabet object, throw if the character is not valid.
Definition alphabet/concept.hpp:721
int main()
{
char c = '!' ;
}
int main()
{
char c = '!' ;
}
int main()
{
std::cout << std::boolalpha << seqan3::char_is_valid_for<char>('A' ) << '\n' ;
std::cout << std::boolalpha << seqan3::char_is_valid_for<seqan3::dna5>('A' ) << '\n' ;
std::cout << std::boolalpha << seqan3::char_is_valid_for<seqan3::dna5>('a' ) << '\n' ;
}
int main()
{
letter.assign_string("20Z" );
}
cigar & assign_string(std::string_view const input) noexcept
Assign from a std::string_view.
Definition alphabet/cigar/cigar.hpp:167
int main()
{
letter1.assign_string( {cigar_str.data(), 2});
letter2.assign_string( {cigar_str.data() + 2, 4});
letter2.assign_string("40S" );
letter2.assign_string(letter1.to_string());
}
int main()
{
uint32_t size{get<0>(letter)};
}
The actual implementation of seqan3::cigar::operation for documentation purposes only.
Definition cigar_operation.hpp:45
constexpr size_t size
The size of a type pack.
Definition type_pack/traits.hpp:143
int main()
{
uint32_t size{get<uint32_t>(letter)};
}
int main()
{
letter.assign_char('Z' );
}
int main()
{
auto letter2 = 'M' _cigar_operation;
}
int main()
{
letter = 'D' _cigar_operation;
letter = 20;
}
int main()
{
letter1 = 'C' _rna4;
}
Meta-header for the Alphabet / Nucleotide submodule .
Joins an arbitrary alphabet with a quality alphabet.
Definition qualified.hpp:59
int main()
{
if (letter1 == letter2)
}
int main()
{
letter1 = 'C' _dna4;
letter1 = '#' _phred42;
}
int main()
{
if (letter1 == letter2)
}
int main()
{
'U' _rna5};
letter2.assign_char('-' );
letter2.assign_char('K' );
letter2 = 'U' _rna5;
}
Provides seqan3::alphabet_variant.
A combined alphabet that can hold values of either of its alternatives..
Definition alphabet_variant.hpp:127
int main()
{
var = 'A' _dna5;
}
#include <gtest/gtest.h>
int main()
{
static_assert (variant_t::is_alternative<seqan3::dna5>(), "dna5 is an alternative of variant_t" );
static_assert (!variant_t::is_alternative<seqan3::dna4>(), "dna4 is not an alternative of variant_t" );
static_assert (variant_t::is_alternative<seqan3::gap>(), "gap is an alternative of variant_t" );
}
int main()
{
letter1 = 'C' _rna4;
}
template <typename rng_t>
void print(rng_t && r)
{
}
{
for (auto & v : r)
if (is_murphy)
print(r
| std::views::transform(
[](auto const & in)
{
}));
else
print(r
| std::views::transform(
[](auto const & in)
{
}));
}
void algo_pre(seqan3::aa10li_vector const & v)
{
| std::views::transform(
[](auto const & in)
{
})
algorithm(tmp, false );
}
void algo_pre(seqan3::aa10murphy_vector const & v)
{
| std::views::transform(
[](auto const & in)
{
})
algorithm(tmp, true );
}
int main()
{
seqan3::aa10li_vector v1{"AVRSTXOUB" _aa10li};
algo_pre(v1);
seqan3::aa10murphy_vector v2{"AVRSTXOUB" _aa10murphy};
algo_pre(v2);
}
A semi-alphabet that type erases all other semi-alphabets of the same size.
Definition semialphabet_any.hpp:45
seqan::stl::ranges::to to
Converts a range to a container. <dl class="no-api">This entity is not part of the SeqAn API....
Definition to.hpp:23
Provides seqan3::semialphabet_any.
Provides seqan3::ranges::to.
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:62
int main()
{
concat1 = concat2;
concat2[0] = "ATTA" _dna4;
concat1[0][1] = 'T' _dna4;
concat1.concat_reserve(10 * vector_of_length10.size());
while (concat1.size() < 10)
{
concat1.push_back(vector_of_length10);
}
}
Container that stores sequences concatenated internally.
Definition concatenated_sequences.hpp:86
Provides seqan3::concatenated_sequences.
int main()
{
}
iterator end() noexcept
Returns an iterator to the element following the last element of the container.
Definition concatenated_sequences.hpp:487
iterator insert(const_iterator pos, rng_type &&value)
Inserts value before position in the container.
Definition concatenated_sequences.hpp:921
int main()
{
if (my_gap.
to_char () == another_gap.to_char())
}
int main()
{
if (my_mask.
to_rank () == another_mask.to_rank())
}
Implementation of a masked alphabet to be used for tuple composites.
Definition mask.hpp:35
static mask const masked
Member for masked.
Definition mask.hpp:71
Create a mask composite which can be applied with another alphabet.
int main()
{
if (dna4_masked.to_char() != dna4_another_masked.to_char())
{
seqan3::debug_stream << dna4_masked.to_char() <<
" is not the same as " << dna4_another_masked.to_char()
<< "\n" ;
}
}
static mask const unmasked
Member for unmasked.
Definition mask.hpp:65
Implementation of a masked composite, which extends a given alphabet with a mask.
Definition masked.hpp:42
Extends a given alphabet with the mask alphabet.
int main()
{
auto r1 = 'A' _rna5.complement();
}
Provides seqan3::nucleotide_alphabet.
Provides seqan3::rna5, container aliases and string literals.
int main()
{
letter.assign_char('F' );
}
The 15 letter DNA alphabet, containing all IUPAC smybols minus the gap.
Definition dna15.hpp:48
Provides seqan3::dna15, container aliases and string literals.
int main()
{
auto letter2 = 'A' _dna15;
}
int main()
{
letter2 = 'C' _rna15;
}
{
};
{};
int main()
{
}
The 15 letter RNA alphabet, containing all IUPAC smybols minus the gap.
Definition rna15.hpp:48
Checks whether from can be implicityly converted to to.
Provides concepts that do not have equivalents in C++20.
int main()
{
seqan3::dna15_vector vector{'A' _rna15, 'C' _rna15, 'G' _rna15};
seqan3::rna15_vector rna15_vector = "ACGT" _rna15;
seqan3::dna15_vector dna15_vector{rna15_vector.begin(), rna15_vector.end()};
}
int main()
{
seqan3::dna15_vector vector = "ACG" _dna15;
auto rna15_view = vector | seqan3::views::convert<seqan3::rna15>;
for (auto && chr : rna15_view)
{
}
}
Provides seqan3::views::convert.
int main()
{
seqan3::dna15_vector sequence1{"ACGTTA" _dna15};
seqan3::dna15_vector sequence2 = "ACGTTA" _dna15;
auto sequence3 = "ACGTTA" _dna15;
}
int main()
{
letter.assign_char('F' );
}
A 16 letter DNA alphabet, containing all IUPAC symbols minus the gap and plus an equality sign ('=').
Definition dna16sam.hpp:45
Provides seqan3::dna16sam.
int main()
{
auto letter2 = 'A' _dna16sam;
}
int main()
{
seqan3::dna16sam_vector sequence1{"ACGTTA" _dna16sam};
seqan3::dna16sam_vector sequence2 = "ACGTTA" _dna16sam;
auto sequence3 = "ACGTTA" _dna16sam;
}
int main()
{
letter.assign_char('F' );
}
The three letter reduced DNA alphabet for bisulfite sequencing mode (A,G,T(=C)).
Definition dna3bs.hpp:58
Provides seqan3::dna3bs, container aliases and string literals.
int main()
{
auto letter2 = 'A' _dna3bs;
}
int main()
{
seqan3::dna3bs_vector sequence1{"ACGTTA" _dna3bs};
seqan3::dna3bs_vector sequence2 = "ACGTTA" _dna3bs;
auto sequence3 = "ACGTTA" _dna3bs;
}
int main()
{
letter.assign_char('a' );
}
int main()
{
auto letter2 = 'A' _dna4;
}
int main()
{
letter2 = 'C' _rna4;
}
Provides seqan3::rna4, container aliases and string literals.
int main()
{
seqan3::dna4_vector vector{'A' _rna4, 'C' _rna4, 'G' _rna4};
seqan3::rna4_vector rna4_vector = "ACGT" _rna4;
seqan3::dna4_vector dna4_vector{rna4_vector.begin(), rna4_vector.end()};
}
int main()
{
seqan3::dna4_vector vector = "ACG" _dna4;
auto rna4_view = vector | seqan3::views::convert<seqan3::rna4>;
for (auto && chr : rna4_view)
{
static_assert (std::same_as<
decltype (chr),
seqan3::rna4 &&>);
}
}
int main()
{
seqan3::dna4_vector sequence1{"ACGTTA" _dna4};
seqan3::dna4_vector sequence2 = "ACGTTA" _dna4;
auto sequence3 = "ACGTTA" _dna4;
}
int main()
{
letter.assign_char('F' );
}
int main()
{
auto letter2 = 'A' _dna5;
}
int main()
{
letter2 = 'C' _rna5;
}
{
};
{};
int main()
{
}
The five letter RNA alphabet of A,C,G,U and the unknown character N.
Definition rna5.hpp:46
int main()
{
seqan3::dna5_vector vector{'A' _rna5, 'C' _rna5, 'G' _rna5};
seqan3::rna5_vector rna5_vector = "ACGT" _rna5;
seqan3::dna5_vector dna5_vector{rna5_vector.begin(), rna5_vector.end()};
}
int main()
{
seqan3::dna5_vector vector = "ACG" _dna5;
auto rna5_view = vector | seqan3::views::convert<seqan3::rna5>;
for (auto && chr : rna5_view)
{
static_assert (std::same_as<
decltype (chr),
seqan3::rna5 &&>);
}
}
int main()
{
seqan3::dna5_vector sequence1{"ACGTTA" _dna5};
seqan3::dna5_vector sequence2 = "ACGTTA" _dna5;
auto sequence3 = "ACGTTA" _dna5;
}
int main()
{
letter.assign_char('F' );
}
int main()
{
auto letter2 = 'A' _rna15;
}
int main()
{
letter2 = 'C' _dna15;
}
int main()
{
seqan3::rna15_vector vector{'A' _dna15, 'C' _dna15, 'G' _dna15};
seqan3::dna15_vector dna15_vector = "ACGT" _dna15;
seqan3::rna15_vector rna15_vector{dna15_vector.begin(), dna15_vector.end()};
}
int main()
{
seqan3::rna15_vector vector = "ACG" _rna15;
auto dna15_view = vector | seqan3::views::convert<seqan3::dna15>;
for (auto && chr : dna15_view)
{
}
}
int main()
{
seqan3::rna15_vector sequence1{"ACGTTA" _rna15};
seqan3::rna15_vector sequence2 = "ACGTTA" _rna15;
auto sequence3 = "ACGTTA" _rna15;
}
int main()
{
letter.assign_char('F' );
}
int main()
{
auto letter2 = 'A' _rna4;
}
int main()
{
letter2 = 'C' _dna4;
}
int main()
{
seqan3::rna4_vector vector{'A' _dna4, 'C' _dna4, 'G' _dna4};
seqan3::dna4_vector dna4_vector = "ACGT" _dna4;
seqan3::rna4_vector rna4_vector{dna4_vector.begin(), dna4_vector.end()};
}
int main()
{
seqan3::rna4_vector vector = "ACG" _rna4;
auto dna4_view = vector | seqan3::views::convert<seqan3::dna4>;
for (auto && chr : dna4_view)
{
static_assert (std::same_as<
decltype (chr),
seqan3::dna4 &&>);
}
}
int main()
{
seqan3::rna4_vector sequence1{"ACGTTA" _rna4};
seqan3::rna4_vector sequence2 = "ACGTTA" _rna4;
auto sequence3 = "ACGTTA" _rna4;
}
int main()
{
letter.assign_char('F' );
}
int main()
{
auto letter2 = 'A' _rna5;
}
int main()
{
letter2 = 'C' _dna5;
}
int main()
{
seqan3::rna5_vector vector{'A' _dna5, 'C' _dna5, 'G' _dna5};
seqan3::dna5_vector dna5_vector = "ACGT" _dna5;
seqan3::rna5_vector rna5_vector{dna5_vector.begin(), dna5_vector.end()};
}
int main()
{
seqan3::rna5_vector vector = "ACG" _rna5;
auto dna5_view = vector | seqan3::views::convert<seqan3::dna5>;
for (auto && chr : dna5_view)
{
static_assert (std::same_as<
decltype (chr),
seqan3::dna5 &&>);
}
}
int main()
{
seqan3::rna5_vector sequence1{"ACGTTA" _rna5};
seqan3::rna5_vector sequence2 = "ACGTTA" _rna5;
auto sequence3 = "ACGTTA" _rna5;
}
int main()
{
letter.assign_phred(49);
}
Quality type for traditional Sanger and modern Illumina Phred scores.
Definition phred42.hpp:44
int main()
{
auto letter2 = '!' _phred42;
}
int main()
{
auto sequence3 = "##!!##" _phred42;
}
int main()
{
letter.assign_phred(72);
}
Quality type for traditional Sanger and modern Illumina Phred scores.
Definition phred63.hpp:44
Provides seqan3::phred63 quality scores.
int main()
{
auto letter2 = '!' _phred63;
}
int main()
{
auto sequence3 = "##!!##" _phred63;
}
int main()
{
letter.assign_phred(72);
}
Quality type for Solexa and deprecated Illumina formats.
Definition phred68solexa.hpp:37
Provides seqan3::phred68solexa quality scores.
int main()
{
auto letter2 = '!' _phred68solexa;
}
int main()
{
auto sequence3 = "##!!##" _phred68solexa;
}
int main()
{
letter.assign_phred(99);
}
Quality type for PacBio Phred scores of HiFi reads.
Definition phred94.hpp:41
Provides seqan3::phred94 quality scores.
int main()
{
auto letter2 = '!' _phred94;
}
int main()
{
auto sequence3 = "##!!##" _phred94;
}
int main()
{
get<0>(letter) = 'G' _dna4;
}
int main()
{
letter.assign_char('F' );
}
The three letter RNA structure alphabet of the characters ".()".
Definition dot_bracket3.hpp:51
Provides the dot bracket format for RNA structure.
int main()
{
auto letter2 = '(' _db3;
}
int main()
{
auto sequence3 = ".(..)." _db3;
}
int main()
{
letter.assign_char('F' );
}
The protein structure alphabet of the characters "HGIEBTSCX".
Definition dssp9.hpp:59
Provides the dssp format for protein structure.
int main()
{
auto letter2 = '(' _dssp9;
}
int main()
{
auto sequence3 = "EHHHHT" _dssp9;
}
int main()
{
get<0>(letter) = 'V' _aa27;
}
A seqan3::alphabet_tuple_base that joins an aminoacid alphabet with a protein structure alphabet.
Definition structured_aa.hpp:52
Provides the composite of aminoacid with structure alphabets.
int main()
{
get<0>(letter) = 'U' _rna4;
}
A seqan3::alphabet_tuple_base that joins a nucleotide alphabet with an RNA structure alphabet.
Definition structured_rna.hpp:53
Provides the composite of nucleotide with structure alphabets.
int main()
{
seqan3::wuss51 letter{':' _wuss51};
letter.assign_char('~' );
letter.assign_char('#' );
}
Provides the WUSS format for RNA structure.
int main()
{
seqan3::wuss51 letter1{'(' _wuss51};
auto letter2 = '(' _wuss51;
}
int main()
{
bool is_closing_char_member = '}' _wuss51.is_pair_close();
}
constexpr auto is_pair_close
Check whether the given character represents a leftward interaction in an RNA structure.
Definition alphabet/structure/concept.hpp:179
int main()
{
bool is_opening_char_member = '{' _wuss51.is_pair_open();
}
constexpr auto is_pair_open
Check whether the given character represents a rightward interaction in an RNA structure.
Definition alphabet/structure/concept.hpp:97
int main()
{
bool is_unpaired_char_member = '.' _wuss51.is_unpaired();
}
constexpr auto is_unpaired
Check whether the given character represents an unpaired nucleotide in an RNA structure.
Definition alphabet/structure/concept.hpp:261
int main()
{
auto sequence3 = ".<..>." _wuss51;
}
int main()
{
uint8_t max_depth_member = seqan3::wuss51::max_pseudoknot_depth;
uint8_t max_depth_meta = seqan3::max_pseudoknot_depth<seqan3::wuss51>;
std::cout << static_cast<uint16_t>(max_depth_member) << '\n' ;
std::cout << static_cast<uint16_t>(max_depth_meta) << '\n' ;
}
int main()
{
auto pk_opt = '.' _wuss51.pseudoknot_id();
if (pk_opt)
}
constexpr auto pseudoknot_id
Retrieve an id for the level of a pseudoknotted interaction (also known as 'page number').
Definition alphabet/structure/concept.hpp:454
int main()
{
try
{
}
{
}
}
Provides seqan3::views::char_strictly_to.
An exception typically thrown by seqan3::alphabet::assign_char_strict.
Definition alphabet/exception.hpp:27
int main()
{
}
Provides seqan3::views::char_to.
int main()
{
seqan3::dna5_vector foo{"ACGTA" _dna5};
}
Provides seqan3::views::complement.
int main()
{
seqan3::dna4_vector vec = "ACTTTGATA" _dna4;
{'A' _dna4, '(' _phred42},
{'G' _dna4, '&' _phred42},
{'T' _dna4, '$' _phred42},
{'G' _dna4, '(' _phred42},
{'A' _dna4, '%' _phred42},
{'C' _dna4, '?' _phred42},
{'T' _dna4, '1' _phred42},
{'A' _dna4, '8' _phred42}};
}
constexpr derived_type & assign_phred(phred_type const p) noexcept
Assign from the numeric Phred score value.
Definition phred_base.hpp:123
auto const to_char
A view that calls seqan3::to_char() on each element in the input range.
Definition to_char.hpp:60
int main()
{
seqan3::dna4_vector vec = "ACTTTGATA" _dna4;
{'A' _dna4, '(' _phred42},
{'G' _dna4, '&' _phred42},
{'T' _dna4, '$' _phred42},
{'G' _dna4, '(' _phred42},
{'A' _dna4, '%' _phred42},
{'C' _dna4, '?' _phred42},
{'T' _dna4, '1' _phred42},
{'A' _dna4, '8' _phred42}};
}
auto const to_rank
A view that calls seqan3::to_rank() on each element in the input range.
Definition to_rank.hpp:63
Provides seqan3::views::to_rank.
int main()
{
}
Provides seqan3::views::rank_to.
int main()
{
static_assert (std::same_as<decltype (char_to_rank), uint8_t>);
std::cout << static_cast<uint16_t>(char_to_rank) << '\n' ;
static_assert (std::same_as<decltype (dna5_to_rank), uint8_t>);
std::cout << static_cast<uint16_t>(dna5_to_rank) << '\n' ;
}
int main()
{
seqan3::dna5_vector vec{"ACGTACGTACGTA" _dna5};
auto v9 =
}
constexpr auto translate_single
A view that translates nucleotide into aminoacid alphabet for one of the six frames.
Definition translate.hpp:520
@ forward_frame2
The third forward frame starting at position 2.
@ forward_frame0
The first forward frame starting at position 0.
@ reverse_frame0
The first reverse frame starting at position 0.
@ reverse_frame2
The third reverse frame starting at position 2.
@ forward_frame1
The second forward frame starting at position 1.
@ reverse_frame1
The second reverse frame starting at position 1.
Provides seqan3::views::translate and seqan3::views::translate_single.
int main()
{
auto third_frame_second_seq = v1[1 * 6 + 2];
return 0;
}
constexpr auto translate_join
A view that translates nucleotide into aminoacid alphabet with 1, 2, 3 or 6 frames....
Definition translate_join.hpp:378
Provides seqan3::views::translate_join.
int main()
{
seqan3::dna5_vector vec{"ACGTACGTACGTA" _dna5};
}
@ forward_frames
All forward frames.
@ forward_reverse0
The first forward and first reverse frame.
int main()
{
{'G' _dna5, 'I' _phred42},
{'G' _dna5, '?' _phred42},
{'A' _dna5, '5' _phred42},
{'T' _dna5, '+' _phred42}};
}
constexpr auto trim_quality
A view that does quality-threshold trimming on a range of seqan3::quality_alphabet.
Definition trim_quality.hpp:126
Provides seqan3::views::trim_quality.
int main()
{
try
{
}
{
}
}
Provides seqan3::views::validate_char_for.
int main(int argc, char ** argv)
{
bool bonus{false };
myparser.add_option(name, 'n' , "name" , "Please specify your name." );
myparser.add_flag(bonus, 'b' , "bonus" , "Please specify if you got the bonus." );
myparser.add_positional_option(grades, "Please specify your grades." );
try
{
myparser.parse();
}
{
return -1;
}
if (bonus)
grades.push_back(1.0);
double avg{0};
for (auto g : grades)
avg += g;
avg = avg / grades.size();
return 0;
}
int main(int argc, char ** argv)
{
int age{30};
myparser.
add_option (age,
'a' ,
"user-age" ,
"Please specify your age." );
try
{
myparser.parse();
}
{
std::cerr <<
"The-Age-App - [PARSER ERROR] " << ext.
what () <<
'\n' ;
return -1;
}
return 0;
}
int main(int argc, char ** argv)
{
myparser.info.date = "12.01.2017" ;
myparser.info.short_description = "Organize your penguin parade" ;
myparser.info.description.
push_back (
"First Paragraph." );
myparser.info.description.push_back("Second Paragraph." );
myparser.info.examples.push_back("./penguin_parade Skipper Kowalski Rico Private -d 10 -m 02 -y 2017" );
int d{01};
int m{01};
int y{2050};
myparser.add_option(d, 'd' , "day" , "Please specify your preferred day." );
myparser.add_option(m, 'm' , "month" , "Please specify your preferred month." );
myparser.add_option(y, 'y' , "year" , "Please specify your preferred year." );
myparser.add_positional_option(penguin_names, "Specify the names of the penguins." );
try
{
myparser.parse();
}
{
return -1;
}
return 0;
}
int main(int argc, char const ** argv)
{
}
@ advanced
Definition auxiliary.hpp:254
{
template <>
struct argument_parsing<
std ::errc>
{
{"timed_out" , std::errc::timed_out},
{"invalid_argument" , std::errc::invalid_argument},
{"io_error" , std::errc::io_error}};
};
}
int main(int argc, char const * argv[])
{
'e' ,
"errc" ,
"Give me a std::errc value." ,
try
{
}
{
return -1;
}
return 0;
}
A validator that checks whether a value is inside a list of valid values.
Definition validators.hpp:197
auto const enumeration_names
Return a conversion map from std::string_view to option_type.
Definition auxiliary.hpp:160
A namespace for third party and standard library specialisations of SeqAn customisation points.
Definition char.hpp:40
namespace foo
{
enum class bar
{
one,
two,
three
};
auto enumeration_names(bar)
{
}
}
int main(int argc, char const * argv[])
{
foo::bar value{};
'f' ,
"foo" ,
"Give me a foo value." ,
try
{
}
{
return -1;
}
}
int main(int argc, char ** argv)
{
int a{3};
myparser.
add_option (a,
'a' ,
"awesome-parameter" ,
"Please specify an integer." );
try
{
myparser.parse();
}
{
return -1;
}
if (myparser.is_option_set('a' ))
if (myparser.is_option_set("awesome-parameter" ))
return 0;
}
int main(int argc, char const ** argv)
{
int myint;
try
{
myparser.parse();
}
{
return -1;
}
return 0;
}
A validator that checks whether a number is inside a given range.
Definition validators.hpp:122
int main(int argc, char const ** argv)
{
int myint;
try
{
myparser.parse();
}
{
return -1;
}
return 0;
}
int main(int argc, char const ** argv)
{
myparser.add_option(myfile,
'f' ,
"file" ,
"Give me a filename." ,
try
{
myparser.parse();
}
{
return -1;
}
return 0;
}
int main(int argc, char const ** argv)
{
try
{
myparser.parse();
}
{
return -1;
}
return 0;
}
A validator that checks if a matches a regular expression pattern.
Definition validators.hpp:929
int main(int argc, char const ** argv)
{
myparser.add_option(file_name,
'f' ,
"file" ,
"Give me a file name with an absolute path." ,
absolute_path_validator | my_file_ext_validator);
try
{
myparser.parse();
}
{
return -1;
}
std::cout <<
"filename given by user passed validation: " << file_name <<
"\n" ;
return 0;
}
int main(int argc, char const ** argv)
{
myparser.add_option(mydir,
'd' ,
"dir" ,
"The directory containing the input files." ,
try
{
myparser.parse();
}
{
return -1;
}
return 0;
}
int main(int argc, char const ** argv)
{
myparser.add_option(myfile,
'f' ,
"file" ,
"The input file containing the sequences." ,
try
{
myparser.parse();
}
{
return -1;
}
return 0;
}
int main()
{
return 0;
}
Provides some standard validators for (positional) options.
int main(int argc, char const ** argv)
{
myparser.add_option(mydir,
'd' ,
"dir" ,
"The output directory for storing the files." ,
try
{
myparser.parse();
}
{
return -1;
}
return 0;
}
A validator that checks if a given path is a valid output directory.
Definition validators.hpp:840
int main(int argc, char const ** argv)
{
myparser.add_option(
myfile,
'f' ,
"file" ,
"Output file containing the processed sequences." ,
myparser.add_option(myfile,
'g' ,
"file2" ,
"Output file containing the processed sequences." ,
try
{
myparser.parse();
}
{
return -1;
}
return 0;
}
@ create_new
Forbid overwriting the output file.
@ open_or_create
Allow to overwrite the output file.
enum class my_enum
{
VAL1 = 1,
VAL2 = 2,
COMB = 3
};
template <>
constexpr bool seqan3::add_enum_bitwise_operators<my_enum> = true ;
int main()
{
using seqan3::operator|;
my_enum e = my_enum::VAL1;
my_enum e2 = e | my_enum::VAL2;
}
Provides seqan3::add_enum_bitwise_operators.
#if SEQAN3_HAS_CEREAL
# include <seqan3/test/tmp_directory.hpp>
# include <cereal/archives/binary.hpp>
# include <cereal/types/vector.hpp>
{
cereal::BinaryInputArchive archive(is);
archive(data);
}
{
cereal::BinaryOutputArchive archive(os);
archive(data);
}
int main()
{
seqan3::test::tmp_directory tmp{};
auto tmp_file = tmp.path() / "data.out" ;
return 0;
}
#endif
int main()
{
}
Provides seqan3::pipeable_config_element.
enum struct my_id : int
{
bar_id,
foo_id
};
{
template <>
}
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
int main()
{
seqan3::debug_stream << get<1>(my_cfg).lower_diagonal << '\n' ;
seqan3::debug_stream << get<seqan3::align_cfg::band_fixed_size>(my_cfg).upper_diagonal << '\n' ;
seqan3::debug_stream << get<seqan3::align_cfg::gap_cost_affine>(my_cfg).extension_score << '\n' ;
}
enum struct my_id : int
{
bar_id,
foo_id
};
{
public :
float value{};
bar() = default ;
bar(bar const &) = default ;
bar(bar &&) = default ;
bar & operator=(bar const &) = default ;
bar & operator=(bar &&) = default ;
~bar() = default ;
bar(float v) : value{v}
{}
static constexpr my_id id {my_id::bar_id};
};
template <typename t>
{
public :
t value{};
foo() = default ;
foo(foo const &) = default ;
foo(foo &&) = default ;
foo & operator=(foo const &) = default ;
foo & operator=(foo &&) = default ;
~foo() = default ;
{}
static constexpr my_id id {my_id::foo_id};
};
template <typename t>
foo(t) -> foo<t>;
int main()
{
}
Adds pipe interface to configuration elements.
Definition pipeable_config_element.hpp:29
enum struct my_id : int
{
bar_id,
foo_id
};
{
public :
bar() = default ;
bar(bar const &) = default ;
bar(bar &&) = default ;
bar & operator=(bar const &) = default ;
bar & operator=(bar &&) = default ;
~bar() = default ;
static constexpr my_id id {my_id::bar_id};
};
template <typename t>
{
public :
foo() = default ;
foo(foo const &) = default ;
foo(foo &&) = default ;
foo & operator=(foo const &) = default ;
foo & operator=(foo &&) = default ;
~foo() = default ;
static constexpr my_id id {my_id::foo_id};
};
template <typename t>
foo(t) -> foo<t>;
int main()
{
uint8_t i = 71;
}
void unsetf(fmtflags const flag)
Unset the format flag(s) on the stream.
Definition debug_stream_type.hpp:190
int main()
{
}
void set_underlying_stream(std::basic_ostream< char_t > &out)
Change the underlying output stream.
Definition debug_stream_type.hpp:117
int main()
{
my_stream << "ACGT" _dna5;
}
A "pretty printer" for most SeqAn data structures and related types.
Definition debug_stream_type.hpp:79
namespace seqan3::detail::adl_only
{
template <typename ... args_t>
void begin(args_t...) = delete ;
{
using base_t::base_t;
template <typename range_t>
requires true
std::forward<range_t>(range).begin()
);
template <typename range_t>
begin(std::forward<range_t>(range))
);
};
}
{
inline constexpr auto begin = detail::adl_only::begin_cpo{};
}
namespace other_library
{
struct foo
{
friend int begin (foo
const &)
{
return 0;
}
};
}
static_assert (std::same_as<decltype (seqan3::begin(vec)), decltype (vec.begin())>);
static_assert (noexcept (vec.begin()));
static_assert (noexcept (seqan3::begin(vec)) == noexcept (vec.begin()));
other_library::foo foo{};
static_assert (std::same_as<
decltype (seqan3::begin(foo)),
decltype (
begin (foo))>);
static_assert (!
noexcept (
begin (foo)));
static_assert (
noexcept (seqan3::begin(foo)) ==
noexcept (
begin (foo)));
auto cpo_is_sfinae_friendly(...) -> void;
template <typename range_t>
auto cpo_is_sfinae_friendly(range_t && range) -> decltype (seqan3::begin(range));
static_assert (std::same_as<decltype (cpo_is_sfinae_friendly(0)), void >);
static_assert (std::same_as<decltype (cpo_is_sfinae_friendly(vec)), decltype (vec.begin())>);
Helper utilities for defining customisation point objects (CPOs).
#define SEQAN3_CPO_OVERLOAD(...)
A macro that helps to define a seqan3::detail::customisation_point_object.
Definition customisation_point.hpp:106
A CRTP base-class that defines a customisation_point_object (CPO).
Definition customisation_point.hpp:140
A tag that allows controlled overload resolution via implicit base conversion rules.
Definition customisation_point.hpp:31
template <typename derived_t, int value>
class base1
{
public :
int func1() const
{
return value;
}
};
template <typename derived_t, typename value_t, typename parameter_t>
class base2
{
public :
value_t func2(parameter_t const p) const
{
return static_cast< value_t> (p);
}
};
template <typename ... deferred_bases_t>
{};
int main()
{
derived<deferred_base1, deferred_base2> d{};
static_assert (
std::is_same_v <
decltype (d.func1()),
int >,
"Return type must be int" );
static_assert (
std::is_same_v <
decltype (d.func2(10u)), uint8_t>,
"Return type must be uint8_t" );
}
Provides seqan3::detail::deferred_crtp_base.
typename deferred_crtp_base_t::template invoke< derived_t > invoke_deferred_crtp_base
Template alias to instantiate the deferred crtp base with the derived class.
Definition deferred_crtp_base.hpp:94
An invocable wrapper that defers the instantiation of a crtp_base class.
Definition deferred_crtp_base.hpp:73
An invocable wrapper that defers the instantiation of a crtp_base class.
Definition deferred_crtp_base.hpp:40
template <typename t>
requires std::is_integral_v<t>
struct foo
{
t value;
};
static_assert (seqan3::detail::is_class_template_declarable_with_v<foo, int>);
static_assert (!seqan3::detail::is_class_template_declarable_with_v<foo, double>);
template <typename t, typename = std::enable_if_t<std::is_same_v<t, int >>>
struct bar
{
t value;
};
static_assert (seqan3::detail::is_class_template_declarable_with_v<bar, int>);
static_assert (!seqan3::detail::is_class_template_declarable_with_v<bar, double>);
template <typename t>
using maybe_foo_t = seqan3::detail::
int main()
{
foo<int> a = maybe_foo_t<int>{10};
float b = maybe_foo_t<float>{0.4f};
return 0;
}
Provides a type trait for verifying valid template declarations.
An empty type whose only purpose is to hold an uninstantiated template plus its arguments.
Definition lazy_conditional.hpp:30
using seqan3::operator|;
struct error :
error,
seqan3::detail::strong_type_skill::decrement
| seqan3::detail::strong_type_skill::increment>
{
error,
seqan3::detail::strong_type_skill::decrement
};
int main()
{
error e{4u};
--e;
++e;
}
CRTP base class to declare a strong typedef for a regular type to avoid ambiguous parameter settings ...
Definition strong_type.hpp:171
constexpr strong_type() noexcept=default
Defaulted.
Provides basic data structure for strong types.
{
};
{
};
strong_type for the window_size.
Definition minimiser_hash.hpp:29
{
};
{
};
namespace detail
{
template <std::ranges::forward_range fwd_rng_type>
bool do_find(fwd_rng_type const &, uint8_t const , uint8_t const )
{
return true ;
}
}
template <std::ranges::forward_range fwd_rng_type>
{
}
int main()
{
return 0;
}
constexpr value_t & get() &noexcept
Returns the underlying value.
Definition strong_type.hpp:198
namespace detail
{
template <std::ranges::forward_range fwd_rng_type>
bool do_find(fwd_rng_type const &, uint8_t const , uint8_t const )
{
return true ;
}
}
template <std::ranges::forward_range fwd_rng_type>
bool search (fwd_rng_type
const & rng, uint8_t
const window_size , uint8_t
const error)
{
}
int main()
{
return 0;
}
int main()
{
static_assert (std::same_as<resulting_t, std::tuple<int, char, double>>);
}
typename transfer_template_args_onto< source_type, target_template >::type transfer_template_args_onto_t
Shortcut for seqan3::detail::transfer_template_args_onto (transformation_trait shortcut).
Definition template_inspection.hpp:70
Provides type traits for working with templates.
Provides seqan3::type_list.
int main()
{
if constexpr (seqan3::detail::is_type_specialisation_of_v<my_type, std::vector>)
{
}
}
int main()
{
{
}
}
Provides concept seqan3::template_specialisation_of<mytype, [...]> for checking the type specialisati...
int main()
{
using selected_types = seqan3::detail::select_types_with_ids_t<types, types_as_ids, selected_ids>;
static_assert (std::same_as<selected_types, seqan3::type_list<std::vector<seqan3::phred42>,
std::string >>);
}
Provides auxiliary data structures and functions for seqan3::record and seqan3::fields.
int main()
{
stream_it = '>' ;
*stream_it = ' ' ;
while (it != std::ranges::end(
sequence ))
{
auto current_end = it;
size_t steps = std::ranges::advance(current_end, 10u, std::ranges::end(
sequence ));
using subrange_t =
std::ranges::subrange<decltype (it), decltype (current_end), std::ranges::subrange_kind::sized>;
it = stream_it.write_range(subrange_t{it, current_end, 10u - steps});
stream_it = ' ' ;
}
}
Functionally the same as std::ostreambuf_iterator, but offers writing a range more efficiently.
Definition fast_ostreambuf_iterator.hpp:38
auto write_range(range_type &&rng)
Writes a range to the associated output.
Definition fast_ostreambuf_iterator.hpp:142
Provides seqan3::detail::fast_ostreambuf_iterator.
int main()
{
file_guard.remove();
}
A safe guard to manage a filesystem entry, e.g. a file or a directory.
Definition safe_filesystem_entry.hpp:35
Provides seqan3::detail::safe_filesystem_entry.
auto input = R"(> TEST1
ACGT
> Test2
AGGCTGA
> Test3
GGAGTATAATATATATATATATAT)";
int main()
{
}
int main()
{
record_type my_record{};
std::get<1>(my_record) = "the most important sequence in the database" ;
std::get<std::string>(my_record) = "the least important sequence in the database" ;
}
int main()
{
auto stream_it = fout.begin();
}
Provides seqan3::sam_file_output and corresponding traits classes.
int main()
{
unsigned mapping_pos{1300};
fout.emplace_back(mapping_pos, flag);
fout.push_back(
std::tie (mapping_pos, flag));
}
sam_flag
An enum flag that describes the properties of an aligned read (given as a SAM record).
Definition sam_flag.hpp:73
@ none
None of the flags below are set.
int main()
{
fout.push_back(r);
}
int main()
{
using alignment_type =
alignment_type dummy_alignment{};
record_type rec{read,
ref_id , dummy_alignment};
fout.push_back(rec);
fout.push_back(record_type{read,
ref_id , dummy_alignment});
}
int main()
{
unsigned mapping_pos{1300};
fout.emplace_back(mapping_pos, flag);
fout.push_back(
std::tie (mapping_pos, flag));
}
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
)";
int main()
{
auto it = fin.begin();
auto & rec0 = *it;
auto & rec1 = fin.front();
}
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
)";
int main()
{
tmp_stream << sam_file_raw;
}
auto input = R"(@HD VN:1.6 SO:coordinate
r001 99 ref 7 30 8M2I4M1D3M = 37 39 TTAGATAAAGGATACTG *)";
int main()
{
}
auto input = R"(@HD VN:1.6 SO:coordinate
r001 99 ref 7 30 8M2I4M1D3M = 37 39 TTAGATAAAGGATACTG *)";
int main()
{
default_fields,
}
@ mate
The mate pair information given as a std::tuple of reference name, offset and template length.
@ header_ptr
A pointer to the seqan3::sam_file_header object storing header information.
@ tags
The optional tags in the SAM format, stored in a dictionary.
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
)";
int main()
{
auto rec = std::move(fin.front());
}
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
)";
int main()
{
}
{
template <typename alph>
};
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
)";
int main()
{
}
A more refined container concept than seqan3::container.
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
)";
int main()
{
for (auto & rec : fin)
{
}
}
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
)";
int main()
{
auto minimum_length10_filter = std::views::filter(
[](auto const & rec)
{
return std::ranges::size(rec.sequence()) >= 10;
});
for (auto & rec : fin | minimum_length10_filter)
}
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
)";
int main()
{
using record_type = typename decltype (fin)::record_type;
for (auto & rec : fin)
}
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
)";
int main()
{
for (auto & rec : fin)
{
}
}
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
)";
int main()
{
for (auto & [flag, mapq] : fin)
{
}
}
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
)";
int main()
{
for (auto & r : fin)
fout.push_back(r);
}
auto sam_file_raw = R"(First 0 * 0 0 * * 0 0 ACGT *
2nd 0 * 0 0 * * 0 0 NATA *
Third 0 * 0 0 * * 0 0 GATA *
)";
int main()
{
fout = fin;
}
auto sam_file_raw = R"(@HD VN:1.6 SO:coordinate GO:none
@SQ SN:ref LN:45
r001 99 ref 7 30 * = 37 39 TTAGATAAAGGATACTG *
r003 0 ref 29 30 * * 0 0 GCCTAAGCTAA * SA:Z:ref,29,-,6H5M,17,0;
r003 2064 ref 29 17 * * 0 0 TAGGC * SA:Z:ref,9,+,5S6M,30,1;
r001 147 ref 237 30 * = 7 -39 CAGCGGCAT * NM:i:1
)";
int main()
{
input_file | std::views::take(3)
}
int main()
{
fout.header().comments.push_back("This is a comment" );
}
int main()
{
{"NATA" _dna5, "2nd" },
{"GATA" _dna5, "Third" }};
fout = range;
range | fout;
}
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 4 * 29 17 * * 0 0 TAGGC @@@@@ SA:Z:ref,9,+,5S6M,30,1;
r001 147 ref 237 30 9M = 7 -39 CAGCGGCAT !!!!!!!!! NM:i:1
)";
int main()
{
for (auto & rec : fin)
{
std::cout <<
"Read " << rec.id() <<
" is unmapped\n" ;
{
}
rec.flag() &=
~seqan3 ::sam_flag::duplicate;
}
}
@ failed_filter
The read alignment failed a filter, e.g. quality controls.
@ unmapped
The read is not mapped to a reference (unaligned).
int main()
{
dict.
get <
"NM" _tag>() = 3;
dict.get<"CO" _tag>() = "comment" ;
auto nm = dict.get<"NM" _tag>();
auto co = dict.get<"CO" _tag>();
}
The SAM tag dictionary class that stores all optional SAM fields.
Definition sam_tag_dictionary.hpp:327
auto & get() &
Uses std::map::operator[] for access and default initializes new keys.
Definition sam_tag_dictionary.hpp:354
Provides the seqan3::sam_tag_dictionary class and auxiliaries.
template <>
{
};
uint16_t tag_id = "NM" _tag;
using nm_tag_type = seqan3::sam_tag_type_t<"NM" _tag>;
The generic base class.
Definition sam_tag_dictionary.hpp:165
detail::sam_tag_variant type
The type for all unknown tags with no extra overload defaults to a std::variant.
Definition sam_tag_dictionary.hpp:167
auto print_fn = [](auto && arg)
{
{
}
else
{
for (auto const & arg_v : arg)
seqan3 ::debug_stream << arg_v <<
"," ;
}
};
int main()
{
dict["XZ" _tag] = 3;
auto xz = dict["XZ" _tag];
}
The (most general) container concept as defined by the standard library.
Adaptations of concepts from the standard library.
auto input = R"(>TEST1
ACGT
>Test2
AGGCTGA
>Test3
GGAGTATAATATATATATATATAT)";
int main()
{
}
auto input = R"(>TEST1
ACGT
>Test2
AGGCTGA
>Test3
GGAGTATAATATATATATATATAT)";
int main()
{
using record_type = typename decltype (fin)::record_type;
for (auto & rec : fin)
}
auto input = R"(>TEST1
ACGT
>Test2
AGGCTGA
>Test3
GGAGTATAATATATATATATATAT)";
int main()
{
for (auto & [id , seq, qual] : fin)
{
}
}
auto input = R"(>TEST1
ACGT
>Test2
AGGCTGA
>Test3
GGAGTATAATATATATATATATAT)";
int main()
{
for (
auto & [
sequence ,
id , quality] : fin)
{
}
}
auto input = R"(>TEST1
ACGT
>Test2
AGGCTGA
>Test3
GGAGTATAATATATATATATATAT)";
int main()
{
auto minimum_length5_filter = std::views::filter(
[](auto const & rec)
{
return std::ranges::size(rec.sequence()) >= 5;
});
for (auto & rec : fin | minimum_length5_filter)
{
}
}
auto input = R"(>TEST1
ACGT
>Test2
AGGCTGA
>Test3
GGAGTATAATATATATATATATAT)";
int main()
{
}
auto input = R"(>TEST1
ACGT
>Test2
AGGCTGA
>Test3
GGAGTATAATATATATATATATAT)";
int main()
{
{
}
}
auto input = R"(>TEST1
ACGT
>Test2
AGGCTGA
>Test3
GGAGTATAATATATATATATATAT)";
int main()
{
auto rec0 = std::move(fin.front());
}
auto input = R"(>TEST1
ACGT
>Test2
AGGCTGA
>Test3
GGAGTATAATATATATATATATAT)";
int main()
{
auto & rec0 = *it;
auto & rec1 = fin.front();
}
#include <seqan3/test/snippet/create_temporary_snippet_file.hpp>
seqan3::test::create_temporary_snippet_file my_fasta{"my.fasta" , "" };
int main()
{
{
fout.emplace_back("AGGCTGA" _dna4, "Test2" );
fout.emplace_back("GGAGTATAATATATATATATATAT" _dna4, "Test3" );
}
}
void emplace_back(arg_t &&arg, arg_types &&... args)
Write a record to the file by passing individual fields.
Definition io/sequence_file/output.hpp:336
auto input = R"(>TEST1
FQTWE
>Test2
KYRTW
>Test3
EEYQTWEEFARAAEKLYLTDPMKV)";
int main()
{
using sequence_file_input_type =
}
auto input = R"(>TEST1
ACGT
>Test2
AGGCTGA
>Test3
GGAGTATAATATATATATATATAT)";
{
template <typename alph>
};
int main()
{
}
int main()
{
{"NATA" _dna5, "2nd" },
{"GATA" _dna5, "Third" }};
fout = range;
range | fout;
}
struct data_storage_t
{
};
int main()
{
data_storage_t data_storage{};
}
auto input = R"(@TEST1
ACGT
+
##!#
@Test2
AGGCTGA
+
##!#!!!
@Test3
GGAGTATAATATATATATATATAT
+
##!###!###!###!###!###!#)";
int main()
{
fout = fin;
}
int main()
{
for (int i = 0; i < 5; ++i)
{
seqan3::dna5_vector
seq {
"ACGT" _dna5};
fout.emplace_back(seq, id );
}
}
int main()
{
for (int i = 0; i < 5; i++)
{
{'A' _dna5, '1' _phred42},
{'C' _dna5, '3' _phred42}};
auto view_on_seq = seqan3::views::elements<0>(seq_qual);
auto view_on_qual = seqan3::views::elements<1>(seq_qual);
fout.emplace_back(id , view_on_seq, view_on_qual);
fout.push_back(
std::tie (
id , view_on_seq, view_on_qual));
}
}
auto input = R"(@TEST1
ACGT
+
##!#
@Test2
AGGCTGA
+
##!#!!!
@Test3
GGAGTATAATATATATATATATAT
+
##!###!###!###!###!###!#)";
int main()
{
for (auto & r : fin)
{
if (true )
fout.push_back(r);
}
}
int main()
{
for (int i = 0; i < 5; ++i)
{
r{"ACGT" _dna5, "ID1" };
fout.push_back(r);
}
}
int main()
{
for (int i = 0; i < 5; ++i)
{
seqan3::dna5_vector
seq {
"ACGT" _dna5};
}
}
int main()
{
auto it = fout.begin();
for (int i = 0; i < 5; ++i)
{
seqan3::dna5_vector
seq {
"ACGT" _dna5};
}
}
int main()
{
for (int i = 0; i < 5; ++i)
{
seqan3::dna5_vector
seq {
"ACGT" _dna5};
fout.emplace_back(seq, id );
}
}
#include <seqan3/test/snippet/create_temporary_snippet_file.hpp>
seqan3::test::create_temporary_snippet_file my_fasta{"my.fasta" , "" };
int main()
{
}
auto input = R"(@TEST1
ACGT
+
##!#
@Test2
AGGCTGA
+
##!#!!!
@Test3
GGAGTATAATATATATATATATAT
+
##!###!###!###!###!###!#)";
int main()
{
auto minimum_sequence_length_filter = std::views::filter(
[](auto rec)
{
return std::ranges::distance(rec.sequence()) >= 50;
});
auto minimum_average_quality_filter = std::views::filter(
{
double qual_sum{0};
for (
auto chr :
record .base_qualities())
return qual_sum / (std::ranges::distance(
record .base_qualities())) >= 20;
});
input_file | minimum_average_quality_filter | minimum_sequence_length_filter | std::views::take(3)
}
auto input = R"(> S.cerevisiae_tRNA-PHE M10740/1-73
GCGGAUUUAGCUCAGUUGGGAGAGCGCCAGACUGAAGAUUUGGAGGUCCUGUGUUCGAUCCACAGAAUUCGCA
(((((((..((((........)))).((((.........)))).....(((((.......)))))))))))). (-17.50)
> example
UUGGAGUACACAACCUGUACACUCUUUC
..(((((..(((...)))..)))))... (-3.71))";
int main()
{
}
auto input = R"(> S.cerevisiae_tRNA-PHE M10740/1-73
GCGGAUUUAGCUCAGUUGGGAGAGCGCCAGACUGAAGAUUUGGAGGUCCUGUGUUCGAUCCACAGAAUUCGCA
(((((((..((((........)))).((((.........)))).....(((((.......)))))))))))). (-17.50)
> example
UUGGAGUACACAACCUGUACACUCUUUC
..(((((..(((...)))..)))))... (-3.71))";
int main()
{
{
fout.
emplace_back (
"GCGGAUUUAGCUCAGUUGGGAGAGCGCCAGACUGAAGAUUUGGAGGUCCUGUGUUCGAUCCACAGAAUUCGCA" _rna4,
"S.cerevisiae_tRNA-PHE M10740/1-73" ,
"(((((((..((((........)))).((((.........)))).....(((((.......))))))))))))." _wuss51);
fout.emplace_back("UUGGAGUACACAACCUGUACACUCUUUC" _rna4, "example" , "..(((((..(((...)))..)))))..." _wuss51);
}
}
A class for writing structured sequence files, e.g. Stockholm, Connect, Vienna, ViennaRNA bpp matrix ...
Definition io/structure_file/output.hpp:60
void emplace_back(arg_t &&arg, arg_types &&... args)
Write a record to the file by passing individual fields.
Definition io/structure_file/output.hpp:363
Provides seqan3::structure_file_output and corresponding traits classes.
auto input = R"(> S.cerevisiae_tRNA-PHE M10740/1-73
GCGGAUUUAGCUCAGUUGGGAGAGCGCCAGACUGAAGAUUUGGAGGUCCUGUGUUCGAUCCACAGAAUUCGCA
(((((((..((((........)))).((((.........)))).....(((((.......)))))))))))). (-17.50)
> example
UUGGAGUACACAACCUGUACACUCUUUC
..(((((..(((...)))..)))))... (-3.71))";
int main()
{
using record_type = typename decltype (fin)::record_type;
for (auto & rec : fin)
}
auto input = R"(> S.cerevisiae_tRNA-PHE M10740/1-73
GCGGAUUUAGCUCAGUUGGGAGAGCGCCAGACUGAAGAUUUGGAGGUCCUGUGUUCGAUCCACAGAAUUCGCA
(((((((..((((........)))).((((.........)))).....(((((.......)))))))))))). (-17.50)
> example
UUGGAGUACACAACCUGUACACUCUUUC
..(((((..(((...)))..)))))... (-3.71))";
int main()
{
auto minimum_length5_filter = std::views::filter(
[](auto const & rec)
{
return std::ranges::size(rec.sequence()) >= 5;
});
for (auto & rec : fin | minimum_length5_filter)
}
{
};
auto input = R"(> S.cerevisiae_tRNA-PHE M10740/1-73
GCGGAUUUAGCUCAGUUGGGAGAGCGCCAGACUGAAGAUUUGGAGGUCCUGUGUUCGAUCCACAGAAUUCGCA
(((((((..((((........)))).((((.........)))).....(((((.......)))))))))))). (-17.50)
> example
UUGGAGUACACAACCUGUACACUCUUUC
..(((((..(((...)))..)))))... (-3.71))";
int main()
{
}
auto input = R"(> S.cerevisiae_tRNA-PHE M10740/1-73
GCGGAUUUAGCUCAGUUGGGAGAGCGCCAGACUGAAGAUUUGGAGGUCCUGUGUUCGAUCCACAGAAUUCGCA
(((((((..((((........)))).((((.........)))).....(((((.......)))))))))))). (-17.50)
> example
UUGGAGUACACAACCUGUACACUCUUUC
..(((((..(((...)))..)))))... (-3.71))";
int main()
{
auto rec0 = std::move(fin.front());
}
auto input = R"(> S.cerevisiae_tRNA-PHE M10740/1-73
ACEWACEW
HGEBHHHH
> example
ACEWACEWACEWACEW
HGEBHHHHHGEBHHHH)";
int main()
{
using structure_file_input_t =
for (auto & rec : fin)
{
}
}
auto input = R"(> S.cerevisiae_tRNA-PHE M10740/1-73
GCGGAUUUAGCUCAGUUGGGAGAGCGCCAGACUGAAGAUUUGGAGGUCCUGUGUUCGAUCCACAGAAUUCGCA
(((((((..((((........)))).((((.........)))).....(((((.......)))))))))))). (-17.50)
> example
UUGGAGUACACAACCUGUACACUCUUUC
..(((((..(((...)))..)))))... (-3.71))";
int main()
{
auto & rec0 = *it;
auto & rec1 = fin.front();
}
auto input = R"(> S.cerevisiae_tRNA-PHE M10740/1-73
GCGGAUUUAGCUCAGUUGGGAGAGCGCCAGACUGAAGAUUUGGAGGUCCUGUGUUCGAUCCACAGAAUUCGCA
(((((((..((((........)))).((((.........)))).....(((((.......)))))))))))). (-17.50)
> example
UUGGAGUACACAACCUGUACACUCUUUC
..(((((..(((...)))..)))))... (-3.71))";
int main()
{
for (auto & [id , struc_seq] : fin)
{
<< '\n' ;
}
}
auto input = R"(> S.cerevisiae_tRNA-PHE M10740/1-73
ACEWACEW
HGEBHHHH
> example
ACEWACEWACEWACEW
HGEBHHHHHGEBHHHH)";
int main()
{
using structure_file_input_t =
for (auto & [seq, id , structure] : fin)
{
}
}
@ structure
Fixed interactions, usually a string of structure alphabet characters.
auto input = R"(> S.cerevisiae_tRNA-PHE M10740/1-73
ACEWACEW
HGEBHHHH
> example
ACEWACEWACEWACEW
HGEBHHHHHGEBHHHH)";
int main()
{
}
struct data_storage_t
{
};
int main()
{
data_storage_t data_storage{};
fout =
seqan3::views::zip (data_storage.sequences, data_storage.ids, data_storage.structures);
}
int main()
{
for (int i = 0; i < 10; i++)
{
seqan3::rna5_vector
seq {
"AGGGUU" _rna5};
fout.emplace_back(seq, id , structure);
}
}
int main()
{
{"ACGT" _rna5, "First" , "...." _wuss51},
{"NATA" _rna5, "2nd" , "...." _wuss51},
{"GATA" _rna5, "Third" , "...." _wuss51}};
fout = range;
}
int main()
{
for (int i = 0; i < 10; i++)
{
seqan3::rna5_vector
seq {
"ACGU" _rna5};
fout.emplace_back(seq, id , structure);
fout.push_back(
std::tie (seq,
id , structure));
}
}
int main()
{
{"ACGT" _rna5, "First" , "...." _wuss51},
{"NATA" _rna5, "2nd" , "...." _wuss51},
{"GATA" _rna5, "Third" , "...." _wuss51}};
fout = range;
}
auto input = R"(> S.cerevisiae_tRNA-PHE M10740/1-73
GCGGAUUUAGCUCAGUUGGGAGAGCGCCAGACUGAAGAUUUGGAGGUCCUGUGUUCGAUCCACAGAAUUCGCA
(((((((..((((........)))).((((.........)))).....(((((.......)))))))))))). (-17.50)
> example
UUGGAGUACACAACCUGUACACUCUUUC
..(((((..(((...)))..)))))... (-3.71))";
int main()
{
bool criteria = true ;
for (auto & r : fin)
{
if (criteria)
fout.push_back(r);
}
}
int main()
{
{"ACGT" _rna5, "First" , "...." _wuss51},
{"NATA" _rna5, "2nd" , "...." _wuss51},
{"GATA" _rna5, "Third" , "...." _wuss51}};
range | fout;
fout = range;
}
auto input = R"(> S.cerevisiae_tRNA-PHE M10740/1-73
GCGGAUUUAGCUCAGUUGGGAGAGCGCCAGACUGAAGAUUUGGAGGUCCUGUGUUCGAUCCACAGAAUUCGCA
(((((((..((((........)))).((((.........)))).....(((((.......)))))))))))). (-17.50)
> example
UUGGAGUACACAACCUGUACACUCUUUC
..(((((..(((...)))..)))))... (-3.71))";
int main()
{
}
int main()
{
auto it = fout.begin();
for (int i = 0; i < 10; i++)
{
seqan3::rna5_vector
seq {
"AGGGUU" _rna5};
fout.push_back(
std::tie (seq,
id , structure));
}
}
int main()
{
for (int i = 0; i < 10; i++)
{
seqan3::rna5_vector
seq {
"AGGGUU" _rna5};
fout.push_back(
std::tie (seq,
id , structure));
}
}
int main()
{
for (int i = 0; i < 10; i++)
{
fout.push_back(
std::tie (
id , structured_sequence));
}
}
T emplace_back(T... args)
int main()
{
fout.emplace_back("AACGUU" _rna4, "example_id" , ".(())." _wuss51);
}
R"(> seq1
ACGACTACGACGATCATCGATCGATCGATCGATCGATCGATCGATCGTACTACGATCGATCG
> seq2
ACGACTACGACGATCATCGATCGATCGATCGATCGATCGATCGATCGTACTACGATCGATCG
> seq3
ACGACTACGACGATCATCGATCGATCGATCGATCGATCGATCGATCGTACTACGATCGATCG
> seq4
ACGACTACGACGATCATCGATCGATCGATCGATCGATCGATCGATCGTACTACGATCGATCG
> seq5
ACGACTACGACGATCATCGATCGATCGATCGATCGATCGATCGATCGTACTACGATCGATCG
> seq6
ACGACTACGACGATCATCGATCGATCGATCGATCGATCGATCGATCGTACTACGATCGATCG
> seq7
ACGACTACGACGATCATCGATCGATCGATCGATCGATCGATCGATCGTACTACGATCGATCG
> seq8
ACGACTACGACGATCATCGATCGATCGATCGATCGATCGATCGATCGTACTACGATCGATCG
> seq9
ACGACTACGACGATCATCGATCGATCGATCGATCGATCGATCGATCGTACTACGATCGATCG
> seq10
ACGACTACGACGATCATCGATCGATCGATCGATCGATCGATCGATCGTACTACGATCGATCG
> seq11
ACGACTACGACGATCATCGATCGATCGATCGATCGATCGATCGATCGTACTACGATCGATCG
> seq12
ACGACTACGACGATCATCGATCGATCGATCGATCGATCGATCGATCGTACTACGATCGATCG
)";
int main()
{
auto worker = [&v]()
{
{
<< '\n' ;
}
};
}
constexpr auto async_input_buffer
A view adapter that returns a concurrent-queue-like view over the underlying range.
Definition async_input_buffer.hpp:478
int main()
{
}
constexpr auto take_exactly
A view adaptor that returns the first size elements from the underlying range (or less if the underly...
Definition take_exactly_view.hpp:573
Provides seqan3::views::take_exactly and seqan3::views::take_exactly_or_throw.
int main()
{
auto v = std::views::take_while(
[](auto const & l)
{
return (l != '\r' ) && (l != '\n' );
});
}
int main()
{
}
constexpr auto take_line
A view adaptor that returns a single line from the underlying range or the full range if there is no ...
Definition take_line_view.hpp:70
Provides seqan3::detail::take_line and seqan3::detail::take_line_or_throw.
int main()
{
}
constexpr auto single_pass_input
A view adapter that decays most of the range properties and adds single pass behavior.
Definition single_pass_input.hpp:345
int main()
{
}
constexpr auto take_until
A view adaptor that returns elements from the underlying range until the functor evaluates to true (o...
Definition take_until_view.hpp:560
constexpr auto take_until_and_consume
A view adaptor that returns elements from the underlying range until the functor evaluates to true (o...
Definition take_until_view.hpp:588
constexpr auto is_blank
Checks whether c is a blank character.
Definition predicate.hpp:139
constexpr auto is_char
Checks whether a given letter is the same as the template non-type argument.
Definition predicate.hpp:60
Provides character predicates for tokenisation.
Provides seqan3::views::take_until and seqan3::views::take_until_or_throw.
template <typename range_type>
class my_random_access_iterator :
{
};
int main()
{}
A CRTP base template for creating random access iterators.
Definition random_access_iterator.hpp:39
Provides the seqan3::detail::random_access_iterator class.
int main()
{
seqan3::dna4_vector vec{"ACGGTC" _dna4};
auto vec_view3 = vec | std::views::reverse;
}
int main()
{
seqan3::dna4_vector vec{"ACGGTC" _dna4};
}
int main()
{
seqan3::dna4_vector vec{"ACGGTC" _dna4};
assert(complemented == "TGCCAG" _dna4);
assert(reversed == "CTGGCA" _dna4);
}
int main()
{
seqan3::dna5_vector
sequence {
"ACGTACGTACGTA" _dna5};
}
int main()
{
}
#include <seqan3/test/snippet/create_temporary_snippet_file.hpp>
seqan3::test::create_temporary_snippet_file input_fastq{"input.fastq" , "\n" };
seqan3::test::create_temporary_snippet_file output_fasta{"output.fasta" , "" };
int main()
{
for (auto & [seq, id , qual] : fin)
{
}
}
#include <seqan3/test/snippet/create_temporary_snippet_file.hpp>
seqan3::test::create_temporary_snippet_file my_fastq{"my.fasta" , "\n" };
int main()
{
using seqan3::operator"" _dna4;
auto sequence1{"ACCA" _dna4};
auto sequence2{"ATTA" _dna4};
std ::cout <<
"Score: " << res.score() <<
'\n' ;
}
Meta-header for the Alignment / Pairwise submodule .
int main()
{
using seqan3::operator"" _dna4;
"ACCCGATGAGCTACCCAGTAGTCGAACTG" _dna4,
"GGCCAGACAACCCGGCGCTAATGCACTCA" _dna4};
seqan3::dna4_vector query{"GCT" _dna4};
for (
auto && hit :
search (query, index, search_config))
for (
auto && hit :
search (query, index, search_config))
}
Configuration element to receive all hits with the best number of errors plus the given stratum....
Definition hit.hpp:107
A dynamic configuration element to configure the hit strategy at runtime.
Definition hit.hpp:140
@ hit
Identifier for the hit configuration (all, all_best, single_best, strata).
Provides the configuration to define the hit strategies "hit_strata", "hit_all", "hit_all_best",...
Provides the configuration for maximum number of errors for all error types.
int main()
{
using seqan3::operator"" _dna4;
"ACCCGATGAGCTACCCAGTAGTCGAACTG" _dna4,
"GGCCAGACAACCCGGCGCTAATGCACTCA" _dna4};
seqan3::dna4_vector query{"GCT" _dna4};
for (
auto && hit :
search (query, index_collection, search_config))
for (
auto && hit :
search (query, index_single, search_config))
}
int main()
{
using seqan3::operator"" _dna4;
auto const alignment_config =
{
}};
}
int main()
{
{
}
}
#include <seqan3/test/snippet/create_temporary_snippet_file.hpp>
seqan3::test::create_temporary_snippet_file input_fastq{"my.fastq" , "\n" };
int main()
{
cur.extend_left("AA" _dna4);
for (auto && pos : cur.locate())
return 0;
}
bool extend_right() noexcept
Tries to extend the query by the smallest possible character to the right such that the query is foun...
Definition bi_fm_index_cursor.hpp:327
cursor_type cursor() const noexcept
Returns a seqan3::bi_fm_index_cursor on the index that can be used for searching. Cursor is pointing...
Definition bi_fm_index.hpp:253
Meta-header for the Search / FM Index submodule .
int main()
{
"TAGCTGAAGCCATTGGCATCTGATCGGACT" _dna4,
"ACTGAGCTCGTC" _dna4,
"TGCATGCACCCATCGACTGACTG" _dna4,
"GTACGTACGTTACG" _dna4};
cur.extend_left("CT" _dna4);
for (auto && pos : cur.locate())
return 0;
}
int main()
{
seqan3::dna4_vector genome{"GAATTAATGAAC" _dna4};
cur.cycle_back();
cur.extend_left('G' _dna4);
cur.cycle_front();
cur.cycle_front();
}
Provides the bidirectional seqan3::bi_fm_index.
int main()
{
seqan3::dna4_vector genome{"GAATTAATGAAC" _dna4};
cur.extend_left("ATG" _dna4);
}
int main()
{
seqan3::dna4_vector genome{"GAATTAACGAAC" _dna4};
auto uni_it = cur.to_fwd_cursor();
uni_it.extend_right('G' _dna4);
uni_it.cycle_back();
}
bool extend_left() noexcept
Tries to extend the query by the smallest possible character to the left such that the query is found...
Definition bi_fm_index_cursor.hpp:380
int main()
{
return 0;
}
Configuration element to receive all hits within the error bounds.
Definition hit.hpp:31
Include the query_id in the seqan3::search_result returned by a call to seqan3::search.
Definition search/configuration/output.hpp:28
Include the reference_begin_position in the seqan3::search_result returned by a call to seqan3::searc...
Definition search/configuration/output.hpp:78
Include the reference_id in the seqan3::search_result returned by a call to seqan3::search.
Definition search/configuration/output.hpp:53
Provides the configuration for the content of the search result.
int main()
{
return 0;
}
A strong type of underlying type double that represents the rate of errors.
Definition max_error_common.hpp:43
int main()
{
{
}};
return 0;
}
Configuration element to provide a user defined callback function for the search.
Definition on_result.hpp:52
Provides seqan3::search_cfg::on_result.
int main()
{
return 0;
}
Include the index_cursor in the seqan3::search_result returned by a call to seqan3::search.
Definition search/configuration/output.hpp:104
int main()
{
return 0;
}
std::optional< uint32_t > thread_count
The maximum number of threads the algorithm can use.
Definition configuration_element_parallel_mode.hpp:49
Provides seqan3::search_cfg::parallel configuration.
int main()
{
auto const sequence1 = "ACTGACTGACTGATC" _dna4;
auto const sequence2 = "GTGACTGACTGACTCG" _dna4;
auto const sequence3 = "AAAAAAACGATCGACA" _dna4;
for (auto && value : sequence1 | hash_adaptor)
for (auto && value : sequence2 | hash_adaptor)
for (auto && value : sequence3 | hash_adaptor)
auto agent = ibf.counting_agent();
auto agent2 = ibf.counting_agent<uint8_t>();
}
The IBF binning directory. A data structure that efficiently answers set-membership queries for multi...
Definition interleaved_bloom_filter.hpp:130
constexpr auto kmer_hash
Computes hash values for each position of a range via a given shape.
Definition kmer_hash.hpp:766
Provides seqan3::interleaved_bloom_filter.
Provides seqan3::views::kmer_hash.
A strong type that represents the number of bins for the seqan3::interleaved_bloom_filter.
Definition interleaved_bloom_filter.hpp:32
A strong type that represents the bin index for the seqan3::interleaved_bloom_filter.
Definition interleaved_bloom_filter.hpp:53
A strong type that represents the number of bits for each bin in the seqan3::interleaved_bloom_filter...
Definition interleaved_bloom_filter.hpp:39
A strong type that represents the number of hash functions for the seqan3::interleaved_bloom_filter.
Definition interleaved_bloom_filter.hpp:46
A strong type of underlying type uint8_t that represents the ungapped shape size.
Definition shape.hpp:22
int main()
{
auto agent = ibf.counting_agent();
agent = ibf.counting_agent();
}
int main()
{
auto agent = ibf.membership_agent();
counts += agent.bulk_contains(712);
counts += agent.bulk_contains(237);
counts += agent.bulk_contains(126);
counts += counts;
}
A data structure that behaves like a std::vector and can be used to consolidate the results of multip...
Definition interleaved_bloom_filter.hpp:809
int main()
{
auto genome = "TTTTTTTTTTAAAAAAAAAATTTTTTTTTTGGGGGGGGGG" _dna4;
size_t bucket_idx{0};
for (auto bucket : genome_buckets)
{
++bucket_idx;
}
auto ibf_agent = ibf.counting_agent();
auto query = "TTT" _dna4;
}
seqan::stl::views::chunk chunk
A view adaptor that divides a range into chunks. <dl class="no-api">This entity is not part of the Se...
Definition chunk.hpp:23
int main()
{
auto const sequence1 = "ACTGACTGACTGATC" _dna4;
auto const sequence2 = "GTGACTGACTGACTCG" _dna4;
auto const sequence3 = "AAAAAAACGATCGACA" _dna4;
for (auto && value : sequence1 | hash_adaptor)
for (auto && value : sequence2 | hash_adaptor)
for (auto && value : sequence3 | hash_adaptor)
auto agent = ibf.counting_agent();
}
int main()
{
auto agent = ibf.membership_agent();
}
int main()
{
auto agent = ibf.membership_agent();
auto & result = agent.bulk_contains(712);
agent = ibf.membership_agent();
}
int main()
{
auto agent = ibf.membership_agent();
agent = ibf.membership_agent();
}
int main()
{
if (true )
else
return 0;
}
Configuration element to receive a single best hit with the lowest number of errors within the error ...
Definition hit.hpp:81
Meta-header for the search configuration module .
int main()
{
for (auto && pos : cur.locate())
return 0;
}
int main()
{
"TAGCTGAAGCCATTGGCATCTGATCGGACT" _dna4,
"ACTGAGCTCGTC" _dna4,
"TGCATGCACCCATCGACTGACTG" _dna4,
"GTACGTACGTTACG" _dna4};
for (auto && pos : cur.locate())
return 0;
}
int main()
{
auto [left_bound, right_bound] = cur.suffix_array_interval();
cur.cycle_back();
auto interval = cur.suffix_array_interval();
cur.cycle_back();
auto && [lb, rb] = cur.suffix_array_interval();
}
int main()
{
}
A class that defines which positions of a pattern to hash.
Definition shape.hpp:57
A strong type of underlying type uint64_t that represents the shape in binary representation.
Definition shape.hpp:31
int main()
{
"ACCCGATGAGCTACCCAGTAGTCGAACTG" _dna4,
"GGCCAGACAACCCGGCGCTAATGCACTCA" _dna4};
for (auto && result : results)
}
auto search(queries_t &&queries, index_t const &index, configuration_t const &cfg=search_cfg::default_configuration)
Search a query or a range of queries in an index.
Definition search.hpp:104
int main()
{
"ACCCGATGAGCTACCCAGTAGTCGAACTG" _dna4,
"GGCCAGACAACCCGGCGCTAATGCACTCA" _dna4};
{
}};
}
int main()
{
{
auto text1 = "AGAAAATA" _dna4;
auto text2 = "AAAAATA" _dna4;
}
}
int main()
{
}
The type returned by seqan3::views::minimiser.
Definition minimiser.hpp:47
constexpr auto minimiser
Computes minimisers for a range of comparable values. A minimiser is the smallest value in a window.
Definition minimiser.hpp:584
Provides seqan3::views::minimiser.
int main()
{
auto minimisers =
text
}
constexpr auto minimiser_hash
Computes minimisers for a range with a given shape, window size and seed.
Definition minimiser_hash.hpp:190
Provides seqan3::views::minimiser_hash.
strong_type for seed.
Definition minimiser_hash.hpp:22
int main()
{
seqan3::dna4_vector s{"ACTTTGATAA" _dna4};
using iterator = seqan3::dna4_vector::iterator;
auto v1 = std::ranges::subrange<iterator, iterator>{
std::ranges::begin (s) + 2, std::ranges::end(s)}
}
#include <gtest/gtest.h>
#include <seqan3/test/simd_utility.hpp>
TEST(simd, simd_eq)
{
int16x8_t a{4, 3, 2, 1, 0, -1, -2, -3};
SIMD_EQ(a, int16x8_t{4, 3, 2, 1, 0, -1, -2, -3});
}
typename simd_type< scalar_t, length, simd_backend >::type simd_type_t
Helper type of seqan3::simd::simd_type.
Definition simd.hpp:56
Meta-header for the Utility / SIMD submodule .
#include <gtest/gtest.h>
#include <seqan3/test/tmp_directory.hpp>
TEST(snippet_tmp_directory, tmp_directory_)
{
seqan3::test::tmp_directory tmp{};
{
ofs << "Hello World!" ;
ofs.close();
}
EXPECT_TRUE(tmp.
empty ());
}
int main()
{
}
Provides seqan3::bloom_filter.
The Bloom Filter. A data structure that efficiently answers set-membership queries.
Definition bloom_filter.hpp:82
int main()
{
bf.emplace(126);
bf.emplace(712);
bf.emplace(237);
bool result = bf.contains(712);
}
int main()
{
auto const sequence1 = "ACTGACTGACTGATC" _dna4;
auto const sequence2 = "GTGACTGACTGACTCG" _dna4;
auto const sequence3 = "AAAAAAACGATCGACA" _dna4;
for (auto && value : sequence1 | kmers)
bf.emplace(value);
for (auto && value : sequence3 | kmers)
bf.emplace(value);
}
int main()
{
bf.emplace(126);
bf.emplace(712);
bf.emplace(237);
}
int main()
{
auto const sequence1 = "ACTGACTGACTGATC" _dna4;
auto const sequence2 = "GTGACTGACTGACTCG" _dna4;
auto const sequence3 = "AAAAAAACGATCGACA" _dna4;
for (auto && value : sequence1 | kmers)
bf.emplace(value);
for (auto && value : sequence3 | kmers)
bf.emplace(value);
bf.reset();
}
int main()
{
}
constexpr auto is_alnum
Checks whether c is a alphanumeric character.
Definition predicate.hpp:194
constexpr auto is_graph
Checks whether c is a graphic character.
Definition predicate.hpp:159
constexpr auto is_eof
Checks whether a given letter is equal to the EOF constant defined in <cstdio>.
Definition predicate.hpp:72
constexpr auto is_punct
Checks whether c is a punctuation character.
Definition predicate.hpp:175
constexpr auto is_digit
Checks whether c is a digital character.
Definition predicate.hpp:259
constexpr auto is_alpha
Checks whether c is a alphabetical character.
Definition predicate.hpp:211
constexpr auto is_print
Checks whether c is a printable character.
Definition predicate.hpp:101
constexpr auto is_space
Checks whether c is a space character.
Definition predicate.hpp:122
constexpr auto is_xdigit
Checks whether c is a hexadecimal character.
Definition predicate.hpp:277
constexpr auto is_upper
Checks whether c is a upper case character.
Definition predicate.hpp:227
constexpr auto is_cntrl
Checks whether c is a control character.
Definition predicate.hpp:87
constexpr auto is_lower
Checks whether c is a lower case character.
Definition predicate.hpp:243
int main()
{
seqan3::is_char<'C'>('C' );
my_check('c' );
}
int main()
{
seqan3::is_in_interval<'A', 'G'>('C' );
my_check('H' );
}
constexpr auto is_in_interval
Checks whether a given letter is in the specified interval.
Definition predicate.hpp:44
int main()
{
char chr{'1' };
bool is_percent = my_cond(chr);
}
size_t memory_alignment(void * value, size_t alignment)
{
return (reinterpret_cast< size_t > (value) & (alignment - 1));
}
int main()
{
for (auto && x : vec128)
std ::cout <<
"Item: " << x <<
" (" << &x <<
", 128-byte aligned offset: " << memory_alignment(&x, 128u)
<< ")\n" ;
for (auto && x : vec_unaligned)
std ::cout <<
"Item: " << x <<
" (" << &x <<
", unaligned start: " << memory_alignment(&x, 128u) <<
")\n" ;
for (auto && x : vec256)
std ::cout <<
"Item: " << x <<
" (" << &x <<
", 256-byte aligned offset: " << memory_alignment(&x, 256u)
<< ")\n" ;
}
Provides seqan3::aligned_allocator.
int main()
{
for (auto it = t1.begin(); it != t1.end(); ++it)
}
A constexpr bitset implementation with dynamic size at compile time.
Definition dynamic_bitset.hpp:52
A constexpr bitset implementation with dynamic size at compile time.
int main()
{
}
constexpr dynamic_bitset & flip() noexcept
Flips all bits (binary NOT).
Definition dynamic_bitset.hpp:963
int main()
{
}
constexpr dynamic_bitset & reset() noexcept
Sets all bits to 0.
Definition dynamic_bitset.hpp:911
int main()
{
t1.resize(5);
t1.resize(10, true );
}
constexpr void resize(size_type const count, value_type const value=false) noexcept
Resizes the container to contain count elements.
Definition dynamic_bitset.hpp:1587
int main()
{
}
constexpr dynamic_bitset & set() noexcept
Sets all bits to 1.
Definition dynamic_bitset.hpp:855
int main()
{
for (size_t i = 0; i < t1.size(); ++i)
}
int main()
{
static_assert (sm[0] == 'h' );
char const * sm_cstr{sm.
c_str ()};
}
Implements a small string that can be used for compile time computations.
Definition small_string.hpp:43
A constexpr string implementation to manipulate string literals at compile time.
int main()
{
return 0;
}
constexpr unsigned_t ceil_log2(unsigned_t const n) noexcept
Computes the ceil of the logarithm to the base of two for unsigned integers.
Definition math.hpp:86
Provides math related functionality.
int main()
{
return 0;
}
constexpr unsigned_t floor_log2(unsigned_t const n) noexcept
Computes the floor of the logarithm to the base of two for unsigned integers.
Definition math.hpp:52
int main()
{
seqan3::debug_stream << static_cast<uint64_t>(
std::pow (5u, 25u)) <<
'\n' ;
}
base_t pow(base_t base, exp_t exp)
Computes the value of base raised to the power exp.
Definition math.hpp:120
Provides seqan3::detail::builtin_simd, seqan3::detail::is_builtin_simd and seqan3::simd::simd_traits<...
A class that holds the type of a simd implementation called [vector extension] (https://gcc....
Definition builtin_simd.hpp:50
int main()
{
constexpr auto max_length = seqan3::detail::default_simd_max_length<seqan3::detail::default_simd_backend>;
uint8_simd_t a = seqan3::fill<uint8_simd_t>(4);
uint8_simd_t b = seqan3::fill<uint8_simd_t>(5);
uint8_simd_t c = a + b;
return 0;
}
Provides seqan3::debug_stream overload for seqan3::simd::simd_type.
This class inherits from std::true_type, iff seqan3::detail::builtin_simd<scalar_t,...
Definition builtin_simd.hpp:113
int main()
{
uint16x8_t a = seqan3::fill<uint16x8_t>(4);
uint16x8_t b = seqan3::simd::fill<uint16x8_t>(4);
return 0;
}
int main()
{
uint16x8_t a = seqan3::iota<uint16x8_t>(1);
uint16x8_t b = seqan3::simd::iota<uint16x8_t>(1);
return 0;
}
int main()
{
uint16x8_t a = seqan3::fill<uint16x8_t>(4);
uint16x8_t b = seqan3::simd::fill<uint16x8_t>(5);
uint16x8_t c = a + b;
return 0;
}
int main()
{
int16x8_t a{0, -1, 2, -3, 4, -5, 6, -7};
int16x8_t b = seqan3::detail::extract_half<1>(a);
int16x8_t c = seqan3::detail::extract_quarter<1>(a);
int16x8_t d = seqan3::detail::extract_eighth<7>(a);
return 0;
}
int main()
{
uint16x8_t a = seqan3::simd::load<uint16x8_t>(memory.data());
return 0;
}
int main()
{
uint16x8_t a = seqan3::simd::iota<uint16x8_t>(0);
return 0;
}
seqan3::simd::simd_traits is the trait class that provides uniform interface to the properties of sim...
Definition simd_traits.hpp:38
static_assert (std::is_same_v<seqan3::simd::simd_traits<uint16x8_t>::scalar_type, uint16_t>);
int main()
{
{uint8x4_t{0, 1, 2, 3}, uint8x4_t{0, 1, 2, 3}, uint8x4_t{0, 1, 2, 3}, uint8x4_t{0, 1, 2, 3}}};
return 0;
}
constexpr void transpose(std::array< simd_t, simd_traits< simd_t >::length > &matrix)
Transposes the given simd vector matrix.
Definition algorithm.hpp:420
int main()
{
int16x8_t a{0, -1, 2, -3, 4, -5, 6, -7};
int32x4_t b = seqan3::simd::upcast<int32x4_t>(a);
return 0;
}
int main()
{
for (
auto && simd_id :
seqan3 ::views::iota_simd<uint16x8_t>(0, 10))
seqan3 ::debug_stream << simd_id <<
'\n' ;
return 0;
}
int main()
{
auto simd_iota_view = std::views::iota(0, 10)
| std::views::transform(
[](uint16_t const idx)
{
return seqan3::simd::fill<uint16x8_t>(idx);
});
for (auto && simd_id : simd_iota_view)
seqan3 ::debug_stream << simd_id <<
'\n' ;
return 0;
}
int main()
{
batch.
push_back (
"AGTGAGCTACGGACTAGCTACGACT" _dna4);
batch.
push_back (
"GACTAGCACGAGCGAGATCG" _dna4);
batch.
push_back (
"ACGTACGACGGACGTACGAGCGAGCTACGAGC" _dna4);
batch.
push_back (
"GTACGGATGGTAAACCGCACAT" _dna4);
auto to_soa = batch | seqan3::views::to_simd<uint16x8_t>(8);
size_t chunk_count = 0;
for (auto && chunk : to_soa)
{
for (auto & vec : chunk)
seqan3 ::debug_stream << vec <<
'\n' ;
}
return 0;
}
int main()
{
static_assert (std::is_standard_layout_v<seqan3::pod_tuple<int, float>>);
seqan3::debug_stream << std::get<int>(tuple1) << '\n' ;
seqan3::debug_stream << std::get<0>(tuple2) << '\n' ;
auto [i, f, l] = tuple2;
}
A type that satisfies seqan3::trivially_copyable and seqan3::trivially_destructible.
Provides seqan3::pod_tuple.
Definition pod_tuple.hpp:27
int main()
{
auto [left, right] = seqan3::tuple_split<2>(t);
auto [left1, right1] = seqan3::tuple_split<0>(t);
auto [left2, right2] = seqan3::tuple_split<4>(t);
static_assert (std::same_as<
decltype (right2),
std::tuple<> >);
}
Provides seqan3::tuple_split.
namespace incomplete
{
struct type;
}
auto fn = [](auto id)
{
using id_t = decltype (id);
using type = typename id_t::type;
static_assert (std::is_same_v<id_t, std::type_identity<type>>, "id is of type std::type_identity<type>" );
if constexpr (std::is_same_v<type, bool>)
return true ;
else if constexpr (std::is_same_v<type, int>)
return true ;
else if constexpr (std::is_same_v<type, float>)
return true ;
else if constexpr (std::is_same_v<type, incomplete::type>)
return false ;
};
static_assert (seqan3::detail::all_of<seqan3::type_list<int, float, bool>>(fn));
static_assert (!seqan3::detail::all_of<seqan3::type_list<int, float, bool, incomplete::type>>(fn));
Provides algorithms for meta programming, parameter packs and seqan3::type_list.
namespace incomplete
{
struct type;
}
int main()
{
auto fn = [](auto id)
{
using id_t = decltype (id);
using type = typename id_t::type;
static_assert (std::is_same_v<id_t, std::type_identity<type>>, "id is of type std::type_identity<type>" );
if constexpr (std::is_same_v<type, bool>)
else if constexpr (std::is_same_v<type, int>)
else if constexpr (std::is_same_v<type, float>)
else if constexpr (std::is_same_v<type, incomplete::type>)
};
seqan3::detail::for_each<types>(fn);
return 0;
}
int main()
{
static_assert (std::same_as<float, seqan3::list_traits::at<1, list_t>>);
}
typename decltype(detail::at< idx >(list_t{}))::type at
Return the type at given index from the type list.
Definition type_list/traits.hpp:276
Provides traits for seqan3::type_list.
int main()
{
static_assert (std::same_as<float, seqan3::list_traits::back<list_t>>);
}
int main()
{
static_assert (std::same_as<seqan3::list_traits::concat<list_t, list_t2, list_t3>,
}
int main()
{
static_assert (seqan3::list_traits::contains<double, list_t> == false );
static_assert (seqan3::list_traits::contains<float, list_t> == true );
}
int main()
{
static_assert (seqan3::list_traits::count<int, list_t> == 2);
}
int main()
{
}
typename decltype(detail::split_after< i >(list_t{}))::second_type drop
Return a seqan3::type_list of the types in the input type list, except the first n.
Definition type_list/traits.hpp:392
int main()
{
}
decltype(detail::drop_front(list_t{})) drop_front
Return a seqan3::type_list of all the types in the type list, except the first.
Definition type_list/traits.hpp:356
int main()
{
}
take< size< list_t > - i, list_t > drop_last
Return a seqan3::type_list of the types the input type list, except the last n.
Definition type_list/traits.hpp:428
int main()
{
static_assert (seqan3::list_traits::find<double, list_t> == -1);
static_assert (seqan3::list_traits::find<bool, list_t> == 2);
}
int main()
{
static_assert (seqan3::list_traits::find_if<std::is_pointer, list_t> == -1);
static_assert (seqan3::list_traits::find_if<std::is_integral, list_t> == 0);
}
int main()
{
static_assert (std::same_as<int, seqan3::list_traits::front<list_t>>);
}
int main()
{
static_assert (
}
decltype(detail::replace_at< replace_t, i >(list_t{})) replace_at
Replace the type at the given index with the given type.
Definition type_list/traits.hpp:486
int main()
{
static_assert (seqan3::list_traits::size<list_t> == 4);
}
int main()
{
static_assert (std::same_as<seqan3::type_list<int, float, bool>, split_t::first_type>);
static_assert (std::same_as<seqan3::type_list<double, char, int>, split_t::second_type>);
}
decltype(detail::split_after< i >(list_t{})) split_after
Split a seqan3::type_list into two parts returned as a pair of seqan3::type_list.
Definition type_list/traits.hpp:446
int main()
{
}
typename decltype(detail::split_after< i >(list_t{}))::first_type take
Return a seqan3::type_list of the first n types in the input type list.
Definition type_list/traits.hpp:374
int main()
{
}
drop< size< list_t > - i, list_t > take_last
Return a seqan3::type_list of the last n types in the input type list.
Definition type_list/traits.hpp:410
int main()
{
static_assert (std::same_as<seqan3::list_traits::transform<std::ranges::range_reference_t, list_t>,
}
Provides various transformation traits used by the range module.
auto fn = [](auto value)
{
using value_t = decltype (value);
if constexpr (std::is_same_v<value_t, bool>)
return value == false ;
else if constexpr (std::is_same_v<value_t, int>)
return value == 3;
else if constexpr (std::is_same_v<value_t, double>)
return value - 1.2 < 0.00001;
else
return false ;
};
constexpr bool all_of(unary_predicate_t &&fn)
Tests whether a given predicate evaluates to true for each type in a seqan3::type_list.
Definition type_list_algorithm.hpp:107
Provides algorithms for meta programming, parameter packs and seqan3::type_list.
int main()
{
auto fn = [](auto && a)
{
};
fn(0);
fn(", " );
fn(1.0);
fn(", " );
fn('\n' );
return 0;
}
constexpr void for_each(unary_function_t &&fn)
Applies a function element wise to all types of a type list.
Definition type_list_algorithm.hpp:157
int main()
{
static_assert (std::same_as<float, seqan3::pack_traits::at<1, int, float, bool, double>>);
}
typename decltype(detail::at< idx, pack_t... >())::type at
Return the type at given index from the type pack.
Definition type_pack/traits.hpp:245
Provides various traits for template packs.
int main()
{
static_assert (std::same_as<float, seqan3::pack_traits::back<int, float, bool, int, float>>);
}
int main()
{
static_assert (seqan3::pack_traits::count<int, int, float, bool, int> == 2);
}
int main()
{
}
typename decltype(detail::split_after< i, pack_t... >(type_list<>{}))::second_type drop
Return a seqan3::type_list of the types in the type pack, except the first n.
Definition type_pack/traits.hpp:367
int main()
{
static_assert (
}
typename decltype(detail::drop_front< pack_t... >())::type drop_front
Return a seqan3::type_list of all the types in the type pack, except the first.
Definition type_pack/traits.hpp:305
int main()
{
static_assert (
}
take< size< pack_t... > - i, pack_t... > drop_last
Return a seqan3::type_list of the types the type pack, except the last n.
Definition type_pack/traits.hpp:403
int main()
{
static_assert (seqan3::pack_traits::find<double, int, float, bool> == -1);
static_assert (seqan3::pack_traits::find<bool, int, float, bool> == 2);
}
int main()
{
static_assert (seqan3::pack_traits::find_if<std::is_pointer, int, float, double> == -1);
static_assert (seqan3::pack_traits::find_if<std::is_integral, int, float, double> == 0);
}
int main()
{
static_assert (std::same_as<int, seqan3::pack_traits::front<int, float, bool, int, float>>);
}
int main()
{
static_assert (std::same_as<seqan3::type_list<int, int, bool, double>,
}
decltype(detail::replace_at< replace_t, i, pack_t... >(std::make_index_sequence< size< pack_t... > >{})) replace_at
Replace the type at the given index with the given type.
Definition type_pack/traits.hpp:440
int main()
{
static_assert (seqan3::pack_traits::size<int, float, bool, int> == 4);
}
int main()
{
static_assert (std::same_as<seqan3::type_list<int, float, bool>, split_t::first_type>);
static_assert (std::same_as<seqan3::type_list<double, char, int>, split_t::second_type>);
}
decltype(detail::split_after< i, pack_t... >(type_list<>{})) split_after
Split a type pack into two parts returned as a pair of seqan3::type_list.
Definition type_pack/traits.hpp:421
int main()
{
}
typename decltype(detail::split_after< i, pack_t... >(type_list<>{}))::first_type take
Return a seqan3::type_list of the first n types in the type pack.
Definition type_pack/traits.hpp:349
int main()
{
}
drop< size< pack_t... > - i, pack_t... > take_last
Return a seqan3::type_list of the last n types in the type pack.
Definition type_pack/traits.hpp:385
int main()
{
static_assert (std::same_as<
seqan3::pack_traits::
}
{
};
using my_function_t = decltype (my_caller);
static_assert (std::same_as<seqan3::function_traits<my_function_t>::result_type, char >);
static_assert (seqan3::function_traits<my_function_t>::argument_count == 2);
static_assert (std::same_as<seqan3::function_traits<my_function_t>::argument_type_at<0>, size_t >);
static_assert (std::same_as<seqan3::function_traits<my_function_t>::argument_type_at<1>,
std::string &>);
Provides various type traits for use on functions.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
template <std::ranges::input_range rng_t>
void foobar(rng_t && range)
{
#if 0
std::ranges::range_size_t<rng_t>,
void >;
#endif
using size_type = seqan3::detail::lazy_conditional_t<std::ranges::sized_range<rng_t>,
void >;
}
int main()
{
}
#pragma GCC diagnostic pop
Provides lazy template instantiation traits.
template <typename T>
struct A;
template <>
struct A<int>
{
using type = int;
};
static_assert (std::is_same_v<void, seqan3::detail::transformation_trait_or_t<A<unsigned>, void >>);
static_assert (std::is_same_v<int, seqan3::detail::transformation_trait_or_t<A<int>, void >>);
int main()
{
for (auto && val : input_view)
seqan3 ::debug_stream <<
"first value in subrange: " << *val.begin() <<
'\n' ;
}
int main()
{
seqan3::dna15_vector vec2{"ACYGTN" _dna15};
}
namespace my
{
}
int main()
{
}
A wrapper type around an existing view adaptor that enables "deep view" behaviour for that view.
Definition deep.hpp:101
Provides seqan3::views::deep.
namespace my
{
}
int main()
{
int i = 3;
}
namespace my
{
}
int main()
{
}
namespace my
{
}
int main()
{
}
int main()
{
{'C' _dna4, '1' _phred42},
{'G' _dna4, '2' _phred42},
{'T' _dna4, '3' _phred42}};
}
int main()
{
auto seq = "ACGTACGACT" _dna4;
static_assert (std::ranges::bidirectional_range<decltype (aligned_seq)>);
static_assert (!std::ranges::random_access_range<decltype (aligned_seq)>);
std::ranges::advance(it, 3);
static_assert (std::ranges::random_access_range<decltype (aligned_seq_ra)>);
std::ranges::advance(it_ra, 3);
}
Provides seqan3::views::enforce_random_access.
constexpr auto enforce_random_access
A view adaptor that converts a pseudo random access range to a std::ranges::random_access_range.
Definition enforce_random_access.hpp:351
int main()
{
size_t s = 3;
}
constexpr auto interleave
A view that interleaves a given range into another range at regular intervals.
Definition interleave.hpp:374
Provides seqan3::views::interleave.
int main()
{
for (
auto res : vec |
seqan3 ::views::pairwise_combine)
{
}
}
int main()
{
v[1345] = 'C' ;
}
constexpr detail::repeat_fn repeat
A view factory that repeats a given value infinitely.
Definition repeat.hpp:344
Provides the seqan3::views::repeat.
int main()
{
}
constexpr auto repeat_n
A view factory that repeats a given value n times.
Definition repeat_n.hpp:88
Provides seqan3::views::repeat_n.
int main()
{
}
constexpr auto type_reduce
A view adaptor that behaves like std::views::all, but type erases certain ranges.
Definition type_reduce.hpp:147
Provides seqan3::views::type_reduce.