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:163
constexpr derived_type & assign_rank(rank_type const c) noexcept
Assign from a numeric value.
Definition: alphabet_base.hpp:187
The four letter DNA alphabet of A,C,G,T..
Definition: dna4.hpp:53
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:137
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:169
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:40
The SeqAn command line parser.
Definition: argument_parser.hpp:148
constexpr auto translate
A view that translates nucleotide into aminoacid alphabet with 1, 2, 3 or 6 frames.
Definition: translate.hpp:803
auto const complement
A view that converts a range of nucleotides to their complement.
Definition: complement.hpp:67
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:193
- 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()
{
{
}
Provides seqan3::views::chunk.
T current_path(T... args)
seqan::std::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:26
Meta-header for the IO / Sequence File submodule .
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:100
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()
{
{
if (rec1.id() != rec2.id())
}
}
seqan::std::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:27
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:69
The record type of seqan3::sequence_file_input.
Definition: sequence_file/record.hpp:29
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:128
Type that contains multiple types.
Definition: type_list.hpp:29
File conversion
Define a custom scoring scheme
Provides seqan3::aminoacid_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:75
constexpr void set_similarity_matrix(aminoacid_similarity_matrix const matrix_id)
Set the similarity matrix scheme (e.g. blosum62).
Definition: aminoacid_scoring_scheme.hpp:121
A data structure for managing and computing the score of two nucleotides.
Definition: nucleotide_scoring_scheme.hpp:38
@ 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:41
A strong type of underlying type score_type that represents the score two different characters.
Definition: scoring_scheme_base.hpp:66
- 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:122
Sets the minimal score (maximal errors) allowed during an distance computation e.g....
Definition: align_config_min_score.hpp:39
Configures the alignment result to output the score.
Definition: align_config_output.hpp:43
Provides seqan3::dna4, container aliases and string literals.
constexpr configuration edit_scheme
Shortcut for edit distance configuration.
Definition: align_config_edit.hpp:51
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:134
constexpr auto pairwise_combine
A view adaptor that generates all pairwise combinations of the elements of the underlying range.
Definition: pairwise_combine.hpp:651
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:189
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:45
Configuration element that represents the number or rate of deletion errors.
Definition: max_error.hpp:173
Configuration element that represents the number or rate of insertion errors.
Definition: max_error.hpp:127
Configuration element that represents the number or rate of substitution errors.
Definition: max_error.hpp:82
Configuration element that represents the number or rate of total errors.
Definition: max_error.hpp:37
A strong type of underlying type uint8_t that represents the number of errors.
Definition: max_error_common.hpp:32
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{};
for (auto const & char_reference : std::get<0>(alignment))
++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:39
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:84
@ alignment
The (pairwise) alignment stored in an object that models seqan3::detail::pairwise_alignment.
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;
std::span text_view{
std::data(storage.seqs[result.reference_id()]) + start, query.size() + 1};
{
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:171
Configures the alignment result to output the begin positions.
Definition: align_config_output.hpp:131
The SeqAn Bidirectional FM Index.
Definition: bi_fm_index.hpp:61
The seqan3::cigar semialphabet pairs a counter with a seqan3::cigar::operation letter.
Definition: alphabet/cigar/cigar.hpp:60
A class for writing SAM files, both SAM and its binary representation BAM are supported.
Definition: io/sam_file/output.hpp:74
Configuration element to receive all hits with the lowest number of errors within the error bounds.
Definition: hit.hpp:59
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:114
@ 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:68
A strong type representing free_end_gaps_sequence1_trailing of the seqan3::align_cfg::method_global.
Definition: align_config_method.hpp:88
A strong type representing free_end_gaps_sequence2_leading of the seqan3::align_cfg::method_global.
Definition: align_config_method.hpp:78
A strong type representing free_end_gaps_sequence2_trailing of the seqan3::align_cfg::method_global.
Definition: align_config_method.hpp:98
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:239
argument_parser_meta_data info
Aggregates all parser related meta data (see seqan3::argument_parser_meta_data struct).
Definition: argument_parser.hpp:637
A validator that checks if a given path is a valid output file.
Definition: validators.hpp:651
@ standard
The default were no checking or special displaying is happening.
Definition: auxiliary.hpp:249
@ required
Definition: auxiliary.hpp:250
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.info.description.push_back("You can push or pull from a remote repository.");
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:315
void parse()
Initiates the actual command line parsing.
Definition: argument_parser.hpp:405
argument_parser & get_sub_parser()
Returns a reference to the sub-parser instance if subcommand parsing was enabled.
Definition: argument_parser.hpp:439
@ 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";
store(vec, tmp_file);
load(vec2, tmp_file);
return 0;
}
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.
Provides seqan3::phred42 quality scores.
Provides quality alphabet composites.
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:43
constexpr auto complement
Return the complement of a nucleotide object.
Definition: alphabet/nucleotide/concept.hpp:105
constexpr auto alphabet_size
A type trait that holds the size of a (semi-)alphabet.
Definition: alphabet/concept.hpp:849
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;
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:115
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:139
constexpr derived_type complement() const noexcept
Return the complement of the letter.
Definition: nucleotide_base.hpp:112
The four letter RNA alphabet of A,C,G,U..
Definition: rna4.hpp:49
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
SeqAn specific customisations in the standard namespace.
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:81
Provides seqan3::gap_decorator.
constexpr auto slice
A view adaptor that returns a half-open interval on the underlying range.
Definition: slice.hpp:178
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:63
A strong type representing the lower diagonal of the seqan3::align_cfg::band_fixed_size.
Definition: align_config_band.hpp:31
A strong type representing the upper diagonal of the seqan3::align_cfg::band_fixed_size.
Definition: align_config_band.hpp:42
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:75
A strong type of underlying type int32_t that represents the score (usually negative) of any characte...
Definition: align_config_gap_cost_affine.hpp:51
A strong type of underlying type int32_t that represents a score (usually negative) that is incurred ...
Definition: align_config_gap_cost_affine.hpp:34
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:45
int main()
{
auto seq1 = "TCGT"_dna4;
auto seq2 = "ACGA"_dna4;
}
Sets the local alignment method.
Definition: align_config_method.hpp:45
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:54
int main()
{
}
Provides configuration for alignment output.
int main()
{
}
Configures the alignment result to output the end position.
Definition: align_config_output.hpp:87
int main()
{
std::pair p{
"ACGTAGC"_dna4,
"AGTACGACG"_dna4};
for (auto res :
<< res << "\n";
}
int main()
{
}
Configures the alignment result to output the id of the first sequence.
Definition: align_config_output.hpp:211
int main()
{
}
Configures the alignment result to output the id of the second sequence.
Definition: align_config_output.hpp:250
int main()
{
;
}
Provides seqan3::align_cfg::parallel configuration.
seqan3::detail::parallel_mode< std::integral_constant< seqan3::detail::align_config_id, seqan3::detail::align_config_id::parallel > > parallel
Enables the parallel execution of the alignment algorithm if possible for the given configuration.
Definition: align_config_parallel.hpp:38
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:36
int main()
{
}
Provides seqan3::align_cfg::vectorised configuration.
Enables the vectorised alignment computation if possible for the current configuration.
Definition: align_config_vectorised.hpp:42
int main()
{
auto seq1 = "ACGT"_dna4;
auto seq2 = "ACCT"_dna4;
}
class my_matrix : public seqan3::detail::alignment_matrix_column_major_range_base<my_matrix>
{
public:
using base_t = seqan3::detail::alignment_matrix_column_major_range_base<my_matrix>;
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{};
alignment_column_type initialise_column(size_t const column_index) noexcept
{
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.
int main()
{
using seqan3::detail::debug_matrix;
seqan3::detail::row_wise_matrix<int> score_matrix{
seqan3::detail::number_rows{5u},
seqan3::detail::number_cols{9u},
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;
}
Provides the declaration of seqan3::detail::debug_matrix.
@ utf8
Enables use of non-ASCII UTF8 characters in formatted output.
Definition: debug_stream_type.hpp:33
int main()
{
using seqan3::detail::debug_matrix;
using seqan3::operator|;
auto N = seqan3::detail::trace_directions::none;
auto D = seqan3::detail::trace_directions::diagonal;
auto U = seqan3::detail::trace_directions::up;
auto L = seqan3::detail::trace_directions::left;
seqan3::detail::row_wise_matrix<seqan3::detail::trace_directions> trace_matrix{
seqan3::detail::number_rows{5u},
seqan3::detail::number_cols{9u},
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;
}
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 .
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 positionss.
Definition: alignment_result.hpp:148
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;
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;
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:178
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:217
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:524
constexpr auto to_char
Return the char representation of an alphabet object.
Definition: alphabet/concept.hpp:386
constexpr auto assign_rank_to
Assign a rank to an alphabet object.
Definition: alphabet/concept.hpp:293
constexpr auto to_rank
Return the rank representation of a (semi-)alphabet object.
Definition: alphabet/concept.hpp:155
{
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.
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:83
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:83
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:82
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:64
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:46
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:146
This is an empty base class that can be inherited by types that shall model seqan3::aminoacid_alphabe...
Definition: alphabet/aminoacid/concept.hpp:35
int main()
{
char c = '!';
}
The five letter DNA alphabet of A,C,G,T and the unknown character N..
Definition: dna5.hpp:51
constexpr auto assign_char_strictly_to
Assign a character to an alphabet object, throw if the character is not valid.
Definition: alphabet/concept.hpp:734
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:170
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:48
constexpr size_t size
The size of a type pack.
Definition: type_pack/traits.hpp:146
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:415
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:62
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:120
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:48
seqan::std::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:26
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:66
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:89
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:490
iterator insert(const_iterator pos, rng_type &&value)
Inserts value before position in the container.
Definition: concatenated_sequences.hpp:922
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:38
static const mask masked
Member for masked.
Definition: mask.hpp:74
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 const mask unmasked
Member for unmasked.
Definition: mask.hpp:68
Implementation of a masked composite, which extends a given alphabet with a mask..
Definition: masked.hpp:45
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:51
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:51
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:48
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:61
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:49
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:47
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:47
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:40
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:44
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:54
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:62
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:55
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:56
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:182
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:100
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:264
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:459
int main()
{
try
{
}
{
}
}
Provides seqan3::views::char_strictly_to.
An exception typically thrown by seqan3::alphabet::assign_char_strict.
Definition: alphabet/exception.hpp:30
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:126
auto const to_char
A view that calls seqan3::to_char() on each element in the input range.
Definition: to_char.hpp:63
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:66
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:523
@ 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:381
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:129
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:255
{
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:203
auto const enumeration_names
Return a conversion map from std::string_view to option_type.
Definition: auxiliary.hpp:165
A namespace for third party and standard library specialisations of SeqAn customisation points.
Definition: char.hpp:42
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:128
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:935
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:846
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_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";
store(vec, tmp_file);
load(vec2, tmp_file);
return 0;
}
#endif
int main()
{
}
Provides seqan3::pipeable_config_element.
enum struct my_id : int
{
bar_id,
foo_id
};
namespace seqan3::detail
{
template <>
}
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:32
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:183
@ small_int_as_number
Definition: debug_stream_type.hpp:34
int main()
{
}
void set_underlying_stream(std::basic_ostream< char_t > &out)
Change the underlying output stream.
Definition: debug_stream_type.hpp:116
int main()
{
my_stream << "ACGT"_dna5;
}
A "pretty printer" for most SeqAn data structures and related types.
Definition: debug_stream_type.hpp:78
int main()
{
int outer{};
seqan3::detail::copyable_wrapper wrapper{[&outer](int const x)
{
outer += x;
return outer;
}};
auto wrapper_2 = wrapper;
}
Provides seqan3::detail::copyable_wrapper.
namespace seqan3::detail::adl_only
{
template <typename... args_t>
void begin(args_t...) = delete;
struct begin_cpo : public detail::customisation_point_object<begin_cpo, 1>
{
using base_t = detail::customisation_point_object<begin_cpo, 1>;
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:107
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>
class derived : public seqan3::detail::invoke_deferred_crtp_base<deferred_bases_t, derived<deferred_bases_t...>>...
{};
int main()
{
using deferred_base1 = seqan3::detail::deferred_crtp_base_vargs<base1, 10>;
using deferred_base2 = seqan3::detail::deferred_crtp_base<base2, uint8_t, uint32_t>;
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.
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::
lazy_conditional_t<seqan3::detail::is_class_template_declarable_with_v<foo, t>, seqan3::detail::lazy<foo, t>, t>;
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.
using seqan3::operator|;
struct error :
seqan3::detail::strong_type<uint8_t,
error,
seqan3::detail::strong_type_skill::decrement
| seqan3::detail::strong_type_skill::increment>
{
using seqan3::detail::strong_type<uint8_t,
error,
seqan3::detail::strong_type_skill::decrement
| seqan3::detail::strong_type_skill::increment>::strong_type;
};
int main()
{
error e{4u};
--e;
++e;
}
Provides basic data structure for strong types.
struct error : seqan3::detail::strong_type<uint8_t, error>
{
using seqan3::detail::strong_type<uint8_t, error>::strong_type;
};
struct window_size : seqan3::detail::strong_type<uint8_t, window_size>
{
using seqan3::detail::strong_type<uint8_t,
window_size>::strong_type;
};
strong_type for the window_size.
Definition: minimiser_hash.hpp:32
struct error : seqan3::detail::strong_type<unsigned, error>
{
using seqan3::detail::strong_type<unsigned, error>::strong_type;
};
struct window_size : seqan3::detail::strong_type<unsigned, window_size>
{
using seqan3::detail::strong_type<unsigned,
window_size>::strong_type;
};
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>
{
return detail::do_find(rng,
window_size.get(), error.get());
}
int main()
{
return 0;
}
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()
{
using resulting_t = seqan3::detail::transfer_template_args_onto_t<list_to_transfer, std::tuple>;
static_assert(std::same_as<resulting_t, std::tuple<int, char, double>>);
}
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()
{
if constexpr (seqan3::detail::template_specialisation_of<my_type, std::vector>)
{
}
}
#include <seqan3/io/detail/record.hpp>
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>>);
}
int main()
{
auto stream_it = seqan3::detail::fast_ostreambuf_iterator{*ostr.
rdbuf()};
stream_it = '>';
*stream_it = ' ';
stream_it.write_range(id);
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 = ' ';
}
}
Provides seqan3::detail::fast_ostreambuf_iterator.
int main()
{
seqan3::detail::safe_filesystem_entry file_guard{my_file};
file_guard.remove();
}
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:76
@ 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:343
auto & get() &
Uses std::map::operator[] for access and default initializes new keys.
Definition: sam_tag_dictionary.hpp:370
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:181
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:183
auto print_fn = [](auto && arg)
{
{
}
else
{
for (auto const & arg_v : arg)
}
};
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:339
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));
}
}
Provides seqan3::views::elements.
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()
{
}
#if !SEQAN3_WORKAROUND_GCC_96070
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)
}
#endif
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:63
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:366
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:481
int main()
{
auto v = vec | seqan3::detail::take_exactly(3);
auto v2 = vec | seqan3::detail::take_exactly(9);
}
Provides seqan3::views::take_exactly and seqan3::views::take_exactly_or_throw.
int main()
{
std::views::take_while(
[](auto const & l)
{
return (l != '\r') && (l != '\n');
});
}