Gamgee
You miserable little maggot. I'll stove your head in!
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
gamgee::VariantWriter Class Reference

utility class to write out a VCF/BCF file to any stream More...

#include <variant_writer.h>

Public Member Functions

 VariantWriter (const std::string &output_fname="-", const bool binary=true, const int compression_level=Z_DEFAULT_COMPRESSION)
 Creates a new VariantWriter using the specified output file name. More...
 
 VariantWriter (const VariantHeader &header, const std::string &output_fname="-", const bool binary=true, const int compression_level=Z_DEFAULT_COMPRESSION)
 Creates a new VariantWriter with the header extracted from a Variant record and using the specified output file name. More...
 
 VariantWriter (const VariantWriter &other)=delete
 a VariantWriter cannot be copied safely, as it is iterating over a stream. More...
 
VariantWriteroperator= (const VariantWriter &other)=delete
 
 VariantWriter (VariantWriter &&other)=default
 a VariantWriter can be moved More...
 
VariantWriteroperator= (VariantWriter &&other)=default
 
void add_record (const Variant &body)
 Adds a record to the file stream. More...
 
void add_header (const VariantHeader &header)
 Adds a header to the file stream. More...
 

Detailed Description

utility class to write out a VCF/BCF file to any stream

Todo:
add serialization option

Constructor & Destructor Documentation

gamgee::VariantWriter::VariantWriter ( const std::string &  output_fname = "-",
const bool  binary = true,
const int  compression_level = Z_DEFAULT_COMPRESSION 
)
explicit

Creates a new VariantWriter using the specified output file name.

Parameters
output_fnamefile to write to. The default is stdout (as defined by htslib)
binarywhether the output should be in BCF (true) or VCF format (false)
compression_leveloptional zlib compression level. 0 for none, 1 for best speed, 9 for best compression
Note
the header is copied and managed internally
gamgee::VariantWriter::VariantWriter ( const VariantHeader header,
const std::string &  output_fname = "-",
const bool  binary = true,
const int  compression_level = Z_DEFAULT_COMPRESSION 
)
explicit

Creates a new VariantWriter with the header extracted from a Variant record and using the specified output file name.

Parameters
headera VariantHeader object to make a copy from
output_fnamefile to write to. The default is stdout (as defined by htslib)
binarywhether the output should be in BCF (true) or VCF format (false)
compression_leveloptional zlib compression level. 0 for none, 1 for best speed, 9 for best compression
Note
the header is copied and managed internally
gamgee::VariantWriter::VariantWriter ( const VariantWriter other)
delete

a VariantWriter cannot be copied safely, as it is iterating over a stream.

gamgee::VariantWriter::VariantWriter ( VariantWriter &&  other)
default

a VariantWriter can be moved

Member Function Documentation

void gamgee::VariantWriter::add_header ( const VariantHeader header)

Adds a header to the file stream.

Parameters
headerthe header
Note
the header is a requirement to add records
void gamgee::VariantWriter::add_record ( const Variant body)

Adds a record to the file stream.

Parameters
bodythe record
VariantWriter& gamgee::VariantWriter::operator= ( const VariantWriter other)
delete
VariantWriter& gamgee::VariantWriter::operator= ( VariantWriter &&  other)
default

The documentation for this class was generated from the following files: