btllib: include/btllib/seq_writer.hpp Source File

btllib

Loading...
Searching...
No Matches
seq_writer.hpp
1#ifndef BTLLIB_SEQ_WRITER_HPP
2#define BTLLIB_SEQ_WRITER_HPP
3
4#include "btllib/data_stream.hpp"
5#include "btllib/seq.hpp"
6
7#include <cstdio>
8#include <mutex>
9#include <string>
10
11namespace btllib {
12
22 class SeqWriter
23{
24
25public:
26 enum Format
27 {
28 FASTA,
29 FASTQ
30 };
31
39 SeqWriter(const std::string& sink_path,
40 Format format = FASTA,
41 bool append = false);
42
43 void close();
44
53 void write(const std::string& id,
54 const std::string& comment,
55 const std::string& seq,
56 const std::string& qual = "");
57
58private:
59 const std::string sink_path;
60 DataSink sink;
61 bool closed;
62 Format format;
63 char headerchar;
64 std::mutex mutex;
65};
66
67} // namespace btllib
68
69#endif
btllib::SeqWriter
Definition seq_writer.hpp:23
btllib::SeqWriter::SeqWriter
SeqWriter(const std::string &sink_path, Format format=FASTA, bool append=false)
btllib::SeqWriter::write
void write(const std::string &id, const std::string &comment, const std::string &seq, const std::string &qual="")
btllib
Definition aahash.hpp:12