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

#include <gfa_to_handle.hpp>

Inheritance diagram for vg::algorithms::GFAIDMapInfo:
handlegraph::NamedNodeBackTranslation

Public Member Functions

void invert_translation ()
 
std::vector< oriented_node_range_ttranslate_back (const oriented_node_range_t &range) const
 
std::string get_back_graph_node_name (const nid_t &back_node_id) const
 
- Public Member Functions inherited from handlegraph::NamedNodeBackTranslation
virtual ~NamedNodeBackTranslation ()=default
 

Public Attributes

bool numeric_mode = true
 If true, GFA string IDs are just graph numerical IDs. More...
 
nid_t max_id = 0
 This holds the max node ID yet used. More...
 
unique_ptr< unordered_map< string, nid_t > > name_to_id = std::make_unique<unordered_map<string, nid_t>>()
 
unique_ptr< unordered_map< nid_t, const std::string * > > id_to_name
 

Detailed Description

Stores ID information for a graph imported from a GFA. Either all IDs are numerically equivalent to their GFA string IDs, or they are stored in the name_to_id map.

Member Function Documentation

◆ get_back_graph_node_name()

std::string vg::algorithms::GFAIDMapInfo::get_back_graph_node_name ( const nid_t back_node_id) const
virtual

Get the GFA sequence name of a node, given its ID. Assumes this will never be called until after name_to_id is fully populated.

Implements handlegraph::NamedNodeBackTranslation.

◆ invert_translation()

void vg::algorithms::GFAIDMapInfo::invert_translation ( )

Prepare the backing data structures for get_back_graph_node_name(). Call after name_to_id is complete.

◆ translate_back()

std::vector< oriented_node_range_t > vg::algorithms::GFAIDMapInfo::translate_back ( const oriented_node_range_t range) const
virtual

Back-translation of node ranges. Is a no-op for imported GFA graphs that haven't been modified, since the GFA graph is itself the backing graph.

Implements handlegraph::NamedNodeBackTranslation.

Member Data Documentation

◆ id_to_name

unique_ptr<unordered_map<nid_t, const std::string*> > vg::algorithms::GFAIDMapInfo::id_to_name

This inverts the name to ID map, and is populated when invert_translation is called, so it can be accessed thread-safely.

◆ max_id

nid_t vg::algorithms::GFAIDMapInfo::max_id = 0

This holds the max node ID yet used.

◆ name_to_id

unique_ptr<unordered_map<string, nid_t> > vg::algorithms::GFAIDMapInfo::name_to_id = std::make_unique<unordered_map<string, nid_t>>()

This maps from GFA string ID to graph numerical ID. This is behind a unique_ptr so it can be safely pointed into.

◆ numeric_mode

bool vg::algorithms::GFAIDMapInfo::numeric_mode = true

If true, GFA string IDs are just graph numerical IDs.


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