vg
tools for working with variation graphs
|
#include <gfa_to_handle.hpp>
Public Member Functions | |
void | invert_translation () |
std::vector< oriented_node_range_t > | translate_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 |
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.
|
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.
void vg::algorithms::GFAIDMapInfo::invert_translation | ( | ) |
Prepare the backing data structures for get_back_graph_node_name(). Call after name_to_id is complete.
|
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.
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.
nid_t vg::algorithms::GFAIDMapInfo::max_id = 0 |
This holds the max node ID yet used.
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.
bool vg::algorithms::GFAIDMapInfo::numeric_mode = true |
If true, GFA string IDs are just graph numerical IDs.