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

utility class to write out a SAM/BAM/CRAM file to any stream More...

#include <variant_writer.h>

Public Member Functions

 VariantWriter (const std::string &output_fname="-", const bool binary=true)
 Creates a new VariantWriter using the specified output file name. More...
 
 VariantWriter (const VariantHeader &header, const std::string &output_fname="-", const bool binary=true)
 Creates a new VariantWriter with the header extracted from a Variant record and using the specified output file name. More...
 
 ~VariantWriter ()
 takes care of closing the file/stream More...
 
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 SAM/BAM/CRAM file to any stream

Todo:
add serialization option

Constructor & Destructor Documentation

gamgee::VariantWriter::VariantWriter ( const std::string &  output_fname = "-",
const bool  binary = true 
)
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 BAM (true) or SAM format (false)
Note
the header is copied and managed internally
gamgee::VariantWriter::VariantWriter ( const VariantHeader header,
const std::string &  output_fname = "-",
const bool  binary = true 
)
explicit

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

Parameters
headerVariantHeader 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 BAM (true) or SAM format (false)
Note
the header is copied and managed internally
gamgee::VariantWriter::~VariantWriter ( )

takes care of closing the file/stream

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

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