vg
tools for working with variation graphs
Public Member Functions | Public Attributes | Protected Attributes | List of all members
vg::AugmentedGraph Struct Reference

#include <genotypekit.hpp>

Inheritance diagram for vg::AugmentedGraph:
vg::SupportAugmentedGraph

Public Member Functions

pair< const Edge *, bool > base_edge (const Edge *augmented_edge)
 
bool is_novel_node (const Node *augmented_node)
 
bool is_novel_edge (const Edge *augmented_edge)
 
bool has_base_graph () const
 
vector< const Alignment * > get_alignments (id_t node_id) const
 
vector< const Alignment * > get_alignments (pair< NodeSide, NodeSide >) const
 
vector< const Alignment * > get_alignments () const
 Get all the embedded alignments. More...
 
virtual Support get_support (id_t node)
 
virtual Support get_support (edge_t edge)
 
virtual bool has_supports () const
 
virtual void clear ()
 
void augment_from_alignment_edits (vector< Alignment > &alignments, bool unique_names=true, bool leave_edits=false)
 
void load_translations (istream &in_file)
 
void write_translations (ostream &out_file)
 

Public Attributes

VG graph
 This holds all the new nodes and edges. More...
 
VGbase_graph = nullptr
 This holds the base graph (only required for mapping edges) More...
 
Translator translator
 Translations back to the base graph. More...
 

Protected Attributes

vector< Alignmentembedded_alignments
 
unordered_map< id_t, vector< Alignment * > > alignments_by_node
 
pair_hash_map< pair< NodeSide, NodeSide >, vector< Alignment * > > alignments_by_edge
 

Detailed Description

General interface for an augmented graph. This is a graph that was constructed by adding some read information to an original ("base") graph. We preserve mappings back to the base graph via translations. Augmented graphs can be made using edit (such as in vg mod -i) or pileup. Todo : further abstract to handle graph interface

Member Function Documentation

◆ augment_from_alignment_edits()

void vg::AugmentedGraph::augment_from_alignment_edits ( vector< Alignment > &  alignments,
bool  unique_names = true,
bool  leave_edits = false 
)

Construct an augmented graph using edit() on a set of alignments. Modifies the passed-in vector of alignments arbitrarily (in particular, it may be empty after the call returns).

Stores a modified version of the reads in the AugmentedGraph. Read alignments that touch a node in the augmented graph can be retrieved with get_alignments(). Reads will have softclips removed.

Must only be called ONCE, because all modifications to the graph have to be processed together to update the embedded alignment indexes.

If unique_names is set, makes sure all the alignments have unique names.

If leave_edits is set, the alignment's paths are not modified after trimming softclips. The alignments' paths will be the paths they were originally aligned to, although the graph will be modified to describe the edits that the alignments found.

◆ base_edge()

pair< const Edge *, bool > vg::AugmentedGraph::base_edge ( const Edge augmented_edge)

◆ clear()

void vg::AugmentedGraph::clear ( )
virtual

Clear the contents.

Reimplemented in vg::SupportAugmentedGraph.

◆ get_alignments() [1/3]

vector< const Alignment * > vg::AugmentedGraph::get_alignments ( ) const

Get all the embedded alignments.

◆ get_alignments() [2/3]

vector< const Alignment * > vg::AugmentedGraph::get_alignments ( id_t  node_id) const

Get the alignments, if any, embedded in the graph that touch the given node ID.

◆ get_alignments() [3/3]

vector< const Alignment * > vg::AugmentedGraph::get_alignments ( pair< NodeSide, NodeSide edge) const

◆ get_support() [1/2]

Support vg::AugmentedGraph::get_support ( edge_t  edge)
virtual

Get the Support for a given Edge, or 0 if it has no recorded support. (only forward strand)

Reimplemented in vg::SupportAugmentedGraph.

◆ get_support() [2/2]

Support vg::AugmentedGraph::get_support ( id_t  node)
virtual

Get the Support for a given Node, or 0 if it has no recorded support. (only forward strand)

Reimplemented in vg::SupportAugmentedGraph.

◆ has_base_graph()

bool vg::AugmentedGraph::has_base_graph ( ) const
inline

◆ has_supports()

bool vg::AugmentedGraph::has_supports ( ) const
virtual

Reimplemented in vg::SupportAugmentedGraph.

◆ is_novel_edge()

bool vg::AugmentedGraph::is_novel_edge ( const Edge augmented_edge)
inline

◆ is_novel_node()

bool vg::AugmentedGraph::is_novel_node ( const Node augmented_node)
inline

◆ load_translations()

void vg::AugmentedGraph::load_translations ( istream &  in_file)

Load the translations from a file

◆ write_translations()

void vg::AugmentedGraph::write_translations ( ostream &  out_file)

Write the translations to a file

Member Data Documentation

◆ alignments_by_edge

pair_hash_map<pair<NodeSide, NodeSide>, vector<Alignment*> > vg::AugmentedGraph::alignments_by_edge
protected

◆ alignments_by_node

unordered_map<id_t, vector<Alignment*> > vg::AugmentedGraph::alignments_by_node
protected

◆ base_graph

VG* vg::AugmentedGraph::base_graph = nullptr

This holds the base graph (only required for mapping edges)

◆ embedded_alignments

vector<Alignment> vg::AugmentedGraph::embedded_alignments
protected

Holds all of the alignments that have been embedded in the graph. They aren't in the graph's paths object, but they are fully embedded without any edits relative to the graph's sequence.

◆ graph

VG vg::AugmentedGraph::graph

This holds all the new nodes and edges.

◆ translator

Translator vg::AugmentedGraph::translator

Translations back to the base graph.


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