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

#include <alignment_emitter.hpp>

Inheritance diagram for vg::io::GafAlignmentEmitter:
vg::io::AlignmentEmitter

Public Member Functions

 GafAlignmentEmitter (const string &filename, const string &format, const HandleGraph &_graph, size_t max_threads, const handlegraph::NamedNodeBackTranslation *translate_through=nullptr)
 Create a GafAlignmentEmitter writing to the given file (or "-") More...
 
 ~GafAlignmentEmitter ()
 Finish and drstroy a VGAlignmentEmitter. 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 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
 This holds a StreamMultiplexer on the output stream, for sharing it between threads. More...
 
const HandleGraphgraph
 Graph that alignments were aligned against. More...
 
const handlegraph::NamedNodeBackTranslationtranslate_through
 Translation we should use to report in named segment coordinates, if any. More...
 

Detailed Description

Emit Alignments to a stream in GAF format Thread safe.

Constructor & Destructor Documentation

◆ GafAlignmentEmitter()

vg::io::GafAlignmentEmitter::GafAlignmentEmitter ( const string &  filename,
const string &  format,
const HandleGraph _graph,
size_t  max_threads,
const handlegraph::NamedNodeBackTranslation translate_through = nullptr 
)

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

◆ ~GafAlignmentEmitter()

vg::io::GafAlignmentEmitter::~GafAlignmentEmitter ( )

Finish and drstroy a VGAlignmentEmitter.

Member Function Documentation

◆ emit_mapped_pairs()

void vg::io::GafAlignmentEmitter::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::GafAlignmentEmitter::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::GafAlignmentEmitter::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::GafAlignmentEmitter::emit_singles ( vector< Alignment > &&  aln_batch)
virtual

Emit a batch of Alignments.

Implements vg::io::AlignmentEmitter.

Member Data Documentation

◆ graph

const HandleGraph& vg::io::GafAlignmentEmitter::graph
private

Graph that alignments were aligned against.

◆ multiplexer

vg::io::StreamMultiplexer vg::io::GafAlignmentEmitter::multiplexer
private

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

◆ out_file

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

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

◆ translate_through

const handlegraph::NamedNodeBackTranslation* vg::io::GafAlignmentEmitter::translate_through
private

Translation we should use to report in named segment coordinates, if any.


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