NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Methods | Static Public Methods | Proteced Methods | Protected Members | List of all members
nvbio::io::OutputFile Struct Reference

Detailed description

The output file interface.

This class is the base class for all file output classes. By itself, it implements a "null" output, which discards all data sent into it. Other classes derive from this to implement various file output formats.

After each alignment pass in the pipeline, the aligner should call OutputFile::process. This call takes a handle to the alignment buffers in GPU memory (a DeviceOutputBatchSE structure). The implementation ensures that any data required is copied out before the call returns, allowing the caller to invalidate the GPU memory immediately.

Sequence alignment is generally done in batches of reads; for each batch multiple OutputFile::process calls can be made. Two extra enum parameters serve to identify which alignment pass we're handling at each call. Each batch should be preceded by a OutputFile::start_batch call; at the end of each batch, OutputFile::end_batch should be called. In most cases, data is only written to disk after OutputFile::end_batch is called.

The factory method OutputFile::open is used to create OutputFile objects. It parses the file name extension to determine the file format for the output.

Definition at line 71 of file output_file.h.

#include <output_file.h>

Inheritance diagram for nvbio::io::OutputFile:
nvbio::io::BamOutput nvbio::io::DebugOutput nvbio::io::SamOutput

Public Methods

virtual ~OutputFile ()
 
void set_program (const char *_pg_id, const char *_pg_name, const char *_pg_version, const char *_pg_args)
 
void set_rg (const char *_rg_id, const char *_rg_string)
 
virtual void header ()
 
virtual void configure_mapq_evaluator (int mapq_filter)
 
virtual void process (struct HostOutputBatchSE &batch)
 
virtual void process (struct HostOutputBatchPE &batch)
 
virtual void close (void)
 Flush and close the output file. More...
 
virtual IOStatsget_aggregate_statistics (void)
 Returns aggregate I/O statistics for this object. More...
 

Static Public Methods

static OutputFileopen (const char *file_name, AlignmentType aln_type, BNT bnt)
 

Proteced Methods

 OutputFile (const char *file_name, AlignmentType alignment_type, BNT bnt)
 

Protected Members

const char * file_name
 Name of the file we're writing. More...
 
AlignmentType alignment_type
 The type of alignment we're running (single or paired-end) More...
 
BNT bnt
 Reference genome data handle. More...
 
int mapq_filter
 The current mapping quality filter: reads with a mapq below this value will be marked as not aligned. More...
 
IOStats iostats
 I/O statistics. More...
 
std::string pg_id
 
std::string pg_name
 
std::string pg_version
 
std::string pg_args
 
std::string rg_id
 
std::string rg_string
 

Constructor & Destructor Documentation

nvbio::io::OutputFile::OutputFile ( const char *  file_name,
AlignmentType  alignment_type,
BNT  bnt 
)
protected

Definition at line 36 of file output_file.cpp.

nvbio::io::OutputFile::~OutputFile ( )
virtual

Definition at line 44 of file output_file.cpp.

Member Function Documentation

void nvbio::io::OutputFile::close ( void  )
virtual

Flush and close the output file.

Reimplemented in nvbio::io::SamOutput, nvbio::io::DebugOutput, and nvbio::io::BamOutput.

Definition at line 53 of file output_file.cpp.

void nvbio::io::OutputFile::configure_mapq_evaluator ( int  mapq_filter)
virtual

Configure the MapQ evaluator. Must be called prior to any batch processing.

Definition at line 48 of file output_file.cpp.

IOStats & nvbio::io::OutputFile::get_aggregate_statistics ( void  )
virtual

Returns aggregate I/O statistics for this object.

Definition at line 57 of file output_file.cpp.

virtual void nvbio::io::OutputFile::header ( )
inlinevirtual

write the header out

Reimplemented in nvbio::io::SamOutput, and nvbio::io::BamOutput.

Definition at line 102 of file output_file.h.

OutputFile * nvbio::io::OutputFile::open ( const char *  file_name,
AlignmentType  aln_type,
BNT  bnt 
)
static

Factory method to create OutputFile objects

Parameters
[in]file_nameThe name of the file to create (will be silently overwritten if it already exists). This method parses out the extension from the file name to determine what kind of file format to write.
[in]aln_typeThe type of alignment (single or paired-end)
[in]bntA handle to the reference genome
Returns
A pointer to an OutputFile object, or NULL if an error occurs.

Definition at line 62 of file output_file.cpp.

virtual void nvbio::io::OutputFile::process ( struct HostOutputBatchSE batch)
inlinevirtual

Process a set of alignment results for the current batch.

Parameters
batchHandle to the buffers containing the alignment results

Reimplemented in nvbio::io::SamOutput, nvbio::io::DebugOutput, and nvbio::io::BamOutput.

Definition at line 112 of file output_file.h.

virtual void nvbio::io::OutputFile::process ( struct HostOutputBatchPE batch)
inlinevirtual

Process a set of alignment results for the current batch.

Parameters
batchHandle to the buffers containing the alignment results

Reimplemented in nvbio::io::SamOutput, nvbio::io::DebugOutput, and nvbio::io::BamOutput.

Definition at line 118 of file output_file.h.

void nvbio::io::OutputFile::set_program ( const char *  _pg_id,
const char *  _pg_name,
const char *  _pg_version,
const char *  _pg_args 
)
inline

Definition at line 80 of file output_file.h.

void nvbio::io::OutputFile::set_rg ( const char *  _rg_id,
const char *  _rg_string 
)
inline

Definition at line 92 of file output_file.h.

Member Data Documentation

AlignmentType nvbio::io::OutputFile::alignment_type
protected

The type of alignment we're running (single or paired-end)

Definition at line 130 of file output_file.h.

BNT nvbio::io::OutputFile::bnt
protected

Reference genome data handle.

Definition at line 132 of file output_file.h.

const char* nvbio::io::OutputFile::file_name
protected

Name of the file we're writing.

Definition at line 128 of file output_file.h.

IOStats nvbio::io::OutputFile::iostats
protected

I/O statistics.

Definition at line 138 of file output_file.h.

int nvbio::io::OutputFile::mapq_filter
protected

The current mapping quality filter: reads with a mapq below this value will be marked as not aligned.

Definition at line 135 of file output_file.h.

std::string nvbio::io::OutputFile::pg_args
protected

Definition at line 143 of file output_file.h.

std::string nvbio::io::OutputFile::pg_id
protected

Definition at line 140 of file output_file.h.

std::string nvbio::io::OutputFile::pg_name
protected

Definition at line 141 of file output_file.h.

std::string nvbio::io::OutputFile::pg_version
protected

Definition at line 142 of file output_file.h.

std::string nvbio::io::OutputFile::rg_id
protected

Definition at line 145 of file output_file.h.

std::string nvbio::io::OutputFile::rg_string
protected

Definition at line 146 of file output_file.h.


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