vg
tools for working with variation graphs
|
#include <genotypekit.hpp>
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... | |
VG * | base_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< Alignment > | embedded_alignments |
unordered_map< id_t, vector< Alignment * > > | alignments_by_node |
pair_hash_map< pair< NodeSide, NodeSide >, vector< Alignment * > > | alignments_by_edge |
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
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.
|
virtual |
Clear the contents.
Reimplemented in vg::SupportAugmentedGraph.
vector< const Alignment * > vg::AugmentedGraph::get_alignments | ( | ) | const |
Get all the embedded alignments.
Get the alignments, if any, embedded in the graph that touch the given node ID.
vector< const Alignment * > vg::AugmentedGraph::get_alignments | ( | pair< NodeSide, NodeSide > | edge | ) | const |
Get the Support for a given Edge, or 0 if it has no recorded support. (only forward strand)
Reimplemented in vg::SupportAugmentedGraph.
Get the Support for a given Node, or 0 if it has no recorded support. (only forward strand)
Reimplemented in vg::SupportAugmentedGraph.
|
inline |
|
virtual |
Reimplemented in vg::SupportAugmentedGraph.
|
inline |
|
inline |
void vg::AugmentedGraph::load_translations | ( | istream & | in_file | ) |
Load the translations from a file
void vg::AugmentedGraph::write_translations | ( | ostream & | out_file | ) |
Write the translations to a file
|
protected |
VG* vg::AugmentedGraph::base_graph = nullptr |
This holds the base graph (only required for mapping edges)
|
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.
VG vg::AugmentedGraph::graph |
This holds all the new nodes and edges.
Translator vg::AugmentedGraph::translator |
Translations back to the base graph.