Gamgee
You miserable little maggot. I'll stove your head in!
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
variant_writer.h
Go to the documentation of this file.
1 #ifndef __gamgee_variant_writer__
2 #define __gamgee_variant_writer__
3 
4 #include <string>
5 
6 #include "variant.h"
7 #include "variant_header.h"
8 #include "htslib/vcf.h"
9 
10 namespace gamgee {
11 
17 
18  public:
19 
26  explicit VariantWriter(const std::string& output_fname = "-", const bool binary = true);
27 
35  explicit VariantWriter(const VariantHeader& header, const std::string& output_fname = "-", const bool binary = true);
36 
41 
46  void add_record(const Variant& body);
47 
53  void add_header(const VariantHeader& header);
54 
55  private:
56  htsFile* m_out_file;
57  VariantHeader m_header;
58 
59  static htsFile* open_file(const std::string& output_fname, const std::string& binary);
60  void write_header() const;
61 
62 };
63 
64 }
65 #endif
void add_header(const VariantHeader &header)
Adds a header to the file stream.
Definition: variant_writer.cpp:21
VariantWriter(const std::string &output_fname="-", const bool binary=true)
Creates a new VariantWriter using the specified output file name.
Definition: variant_writer.cpp:5
utility class to write out a SAM/BAM/CRAM file to any stream
Definition: variant_writer.h:16
void add_record(const Variant &body)
Adds a record to the file stream.
Definition: variant_writer.cpp:26
Utility class to manipulate a Variant record.
Definition: variant.h:16
Utility class to hold a variant header.
Definition: variant_header.h:18
~VariantWriter()
takes care of closing the file/stream
Definition: variant_writer.cpp:17