vg
tools for working with variation graphs
Public Member Functions | Private Member Functions | Private Attributes | List of all members
vg::io::TSVAlignmentEmitter Class Reference

#include <alignment_emitter.hpp>

Inheritance diagram for vg::io::TSVAlignmentEmitter:
vg::io::AlignmentEmitter

Public Member Functions

 TSVAlignmentEmitter (const string &filename, size_t max_threads)
 Create a TSVAlignmentEmitter writing to the given file (or "-") More...
 
 ~TSVAlignmentEmitter ()=default
 The default destructor should clean up the open file, if any. More...
 
virtual void emit_singles (vector< Alignment > &&aln_batch)
 Emit a batch of Alignments. More...
 
virtual void emit_mapped_singles (vector< vector< Alignment >> &&alns_batch)
 
virtual void emit_pairs (vector< Alignment > &&aln1_batch, vector< Alignment > &&aln2_batch, vector< int64_t > &&tlen_limit_batch)
 Emit a batch of pairs of Alignments. More...
 
virtual void emit_mapped_pairs (vector< vector< Alignment >> &&alns1_batch, vector< vector< Alignment >> &&alns2_batch, vector< int64_t > &&tlen_limit_batch)
 
- Public Member Functions inherited from vg::io::AlignmentEmitter
virtual void emit_extra_message (const std::string &tag, std::string &&data)
 Emit some extra type-tagged data, if the backing format supports it. More...
 
virtual void emit_single (Alignment &&aln)
 Emit a single Alignment. More...
 
virtual void emit_mapped_single (vector< Alignment > &&alns)
 Emit a single Alignment with secondaries. All secondaries must have is_secondary set already. More...
 
virtual void emit_pair (Alignment &&aln1, Alignment &&aln2, int64_t tlen_limit=0)
 
virtual void emit_mapped_pair (vector< Alignment > &&alns1, vector< Alignment > &&alns2, int64_t tlen_limit=0)
 
virtual ~AlignmentEmitter ()=default
 Allow destruction through base class pointer. More...
 

Private Member Functions

void emit (Alignment &&aln_batch)
 

Private Attributes

unique_ptr< ofstream > out_file
 If we are doing output to a file, this will hold the open file. Otherwise (for stdout) it will be empty. More...
 
vg::io::StreamMultiplexer multiplexer
 

Detailed Description

Emit a TSV table describing alignments.

Constructor & Destructor Documentation

◆ TSVAlignmentEmitter()

vg::io::TSVAlignmentEmitter::TSVAlignmentEmitter ( const string &  filename,
size_t  max_threads 
)

Create a TSVAlignmentEmitter writing to the given file (or "-")

◆ ~TSVAlignmentEmitter()

vg::io::TSVAlignmentEmitter::~TSVAlignmentEmitter ( )
default

The default destructor should clean up the open file, if any.

Member Function Documentation

◆ emit()

void vg::io::TSVAlignmentEmitter::emit ( Alignment &&  aln_batch)
private

Emit single alignment as TSV. This is all we use; we don't do anything for pairing.

◆ emit_mapped_pairs()

void vg::io::TSVAlignmentEmitter::emit_mapped_pairs ( vector< vector< Alignment >> &&  alns1_batch,
vector< vector< Alignment >> &&  alns2_batch,
vector< int64_t > &&  tlen_limit_batch 
)
virtual

Emit the mappings of a batch of pairs of Alignments. All secondaries must have is_secondary set already.

Implements vg::io::AlignmentEmitter.

◆ emit_mapped_singles()

void vg::io::TSVAlignmentEmitter::emit_mapped_singles ( vector< vector< Alignment >> &&  alns_batch)
virtual

Emit a batch of Alignments with secondaries. All secondaries must have is_secondary set already.

Implements vg::io::AlignmentEmitter.

◆ emit_pairs()

void vg::io::TSVAlignmentEmitter::emit_pairs ( vector< Alignment > &&  aln1_batch,
vector< Alignment > &&  aln2_batch,
vector< int64_t > &&  tlen_limit_batch 
)
virtual

Emit a batch of pairs of Alignments.

Implements vg::io::AlignmentEmitter.

◆ emit_singles()

void vg::io::TSVAlignmentEmitter::emit_singles ( vector< Alignment > &&  aln_batch)
virtual

Emit a batch of Alignments.

Implements vg::io::AlignmentEmitter.

Member Data Documentation

◆ multiplexer

vg::io::StreamMultiplexer vg::io::TSVAlignmentEmitter::multiplexer
private

This holds a StreamMultiplexer on the output stream, for sharing it between threads.

◆ out_file

unique_ptr<ofstream> vg::io::TSVAlignmentEmitter::out_file
private

If we are doing output to a file, this will hold the open file. Otherwise (for stdout) it will be empty.


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