|
btllib
|
#include <seq_writer.hpp>
Public Types | |
| enum | Format { FASTA , FASTQ } |
Public Member Functions | |
| SeqWriter (const std::string &sink_path, Format format=FASTA, bool append=false) | |
| void | close () |
| void | write (const std::string &id, const std::string &comment, const std::string &seq, const std::string &qual="") |
Write FASTA or FASTQ sequences to a file. Capable of writing gzip (.gz), bzip2 (.bz2), xz (.xz), zip (.zip), 7zip (.7z), and lrzip (.lrz) files. Add the appropriate extension to the output filename to automatically compress. Threadsafe.
| btllib::SeqWriter::SeqWriter | ( | const std::string & | sink_path, |
| Format | format = FASTA, |
||
| bool | append = false |
||
| ) |
Construct a SeqWriter to write sequences to a given path.
| source_path | Filepath to write to. Pass "-" to write to stdout. |
| format | Which format to write the output as. |
| append | Whether to append to the target file or write anew. |
| void btllib::SeqWriter::write | ( | const std::string & | id, |
| const std::string & | comment, | ||
| const std::string & | seq, | ||
| const std::string & | qual = "" |
||
| ) |
Write a sequence.
| id | Sequence ID or name. |
| comment | Optional comment after the ID/name. |
| seq | The sequence to write. |
| qual | Optional quality scores, mandatory if format is FASTQ. |