-
Notifications
You must be signed in to change notification settings - Fork 83
Module: IO Sequence
io/seq.hpp // meta-header
io/seq/seq_file_in.hpp // seq_file_in, seq_file_in_traits_concept, seq_file_default_traits
io/seq/seq_file_in_format.hpp // seq_file_in_formats_concept
io/seq/seq_file_in_format_fasta.hpp // seq_file_in_formats_fasta
io/seq/seq_file_in_format_fastq.hpp // seq_file_in_formats_fastq
io/seq/seq_file_in_format_embl.hpp // seq_file_in_formats_embl
io/seq/seq_file_in_format_genbank.hpp // seq_file_in_formats_genbank
io/seq/seq_file_in_format_raw.hpp // seq_file_in_formats_raw
io/seq/seq_file_in_format_sam.hpp // seq_file_in_formats_sam
io/seq/seq_file_in_format_bam.hpp // seq_file_in_formats_bam
+ the whole thing for seq_file_out
The seq_file_in
is data structure that regular users interact with. They instantiate an object of this type with a path to a file and internally the correct format is selected from the file's extension (this is done via std::variant
).
They can then call the .write(seq, id, qual)
member of the seq_file_in
to read either a single record or multiple records (in the case that they provide container-of-container) in to the provided out-parameters. The write-call is forwarded to the actual implementation in the selected format via tag-dispatching through std::visit
.
The user may change the input stream type by providing their own traits type that must satisfy the seq_file_in_traits_concept
. The traits type also contains the list of valid formats. In case the user wants to restrict the allowed formats that can just reduce the definition of the variant accordingly.
If the user (or a library developer) wants to add a new format that just need to make sure that the format satisfies the seq_file_in_formats_concept
and add it to the abovementioned variant.
Output accordingly.