vg
tools for working with variation graphs
Namespaces | Functions
path.cpp File Reference
#include "path.hpp"
#include <vg/io/stream.hpp>
#include "region.hpp"
#include <sstream>

Namespaces

 vg
 

Functions

ostream & vg::operator<< (ostream &out, mapping_t mapping)
 Allow a mapping_t to be printed, for debugging purposes. More...
 
Pathvg::append_path (Path &a, const Path &b)
 
int vg::path_to_length (const Path &path)
 
int vg::path_from_length (const Path &path)
 
int vg::mapping_to_length (const Mapping &m)
 
int vg::mapping_from_length (const Mapping &m)
 
int vg::softclip_start (const Mapping &mapping)
 
int vg::softclip_end (const Mapping &mapping)
 
Position vg::first_path_position (const Path &path)
 
Position vg::last_path_position (const Path &path)
 
int vg::to_length (const Mapping &m)
 
int vg::from_length (const Mapping &m)
 
Pathvg::extend_path (Path &path1, const Path &path2)
 
Path vg::concat_paths (const Path &path1, const Path &path2)
 
Path vg::simplify (const Path &p, bool trim_internal_deletions)
 
Mapping vg::concat_mappings (const Mapping &m, const Mapping &n, bool trim_internal_deletions)
 
Mapping vg::simplify (const Mapping &m, bool trim_internal_deletions)
 
bool vg::edits_are_compatible (const Edit &e, const Edit &f)
 Return true if two edits could be combined into one (assuming adjacency). More...
 
void vg::merge_edits_in_place (Edit &e, const Edit &f)
 Glom the second edit into the first, assuming adjacency. More...
 
Mapping vg::merge_adjacent_edits (const Mapping &m)
 Merge adjacent edits of the same type. More...
 
Path vg::trim_hanging_ends (const Path &p)
 
bool vg::mappings_equivalent (const Mapping &m1, const Mapping &m2)
 
bool vg::mapping_ends_in_deletion (const Mapping &m)
 
bool vg::mapping_starts_in_deletion (const Mapping &m)
 
bool vg::mapping_is_total_deletion (const Mapping &m)
 
bool vg::mapping_is_total_insertion (const Mapping &m)
 
bool vg::mapping_is_simple_match (const Mapping &m)
 
bool vg::path_is_simple_match (const Path &p)
 
const string vg::mapping_sequence (const Mapping &mp, const string &node_seq)
 
const string vg::mapping_sequence (const Mapping &mp, const Node &n)
 
string vg::path_sequence (const HandleGraph &graph, const Path &path)
 
Mapping vg::reverse_complement_mapping (const Mapping &m, const function< int64_t(id_t)> &node_length)
 
void vg::reverse_complement_mapping_in_place (Mapping *m, const function< int64_t(id_t)> &node_length)
 
Path vg::reverse_complement_path (const Path &path, const function< int64_t(id_t)> &node_length)
 
void vg::reverse_complement_path_in_place (Path *path, const function< int64_t(id_t)> &node_length)
 
pair< Mapping, Mappingvg::cut_mapping (const Mapping &m, const Position &pos)
 
pair< mapping_t, mapping_tvg::cut_mapping (const mapping_t &m, const Position &pos)
 
pair< Mapping, Mappingvg::cut_mapping_offset (const Mapping &m, size_t offset)
 
pair< mapping_t, mapping_tvg::cut_mapping_offset (const mapping_t &m, size_t offset)
 
pair< Mapping, Mappingvg::cut_mapping (const Mapping &m, size_t offset)
 
pair< mapping_t, mapping_tvg::cut_mapping (const mapping_t &m, size_t offset)
 
pair< Path, Pathvg::cut_path (const Path &path, const Position &pos)
 
pair< Path, Pathvg::cut_path (const Path &path, size_t offset)
 
bool vg::maps_to_node (const Path &p, id_t id)
 
Position vg::path_start_position (const Path &path)
 
string vg::path_to_string (Path p)
 
Position vg::path_end_position (const Path &path)
 
bool vg::adjacent_mappings (const Mapping &m1, const Mapping &m2)
 
bool vg::mapping_is_match (const Mapping &m)
 
double vg::divergence (const Mapping &m)
 
double vg::identity (const Path &path)
 
void vg::decompose (const Path &path, map< pos_t, int > &ref_positions, map< pos_t, Edit > &edits)
 
double vg::overlap (const Path &p1, const Path &p2)
 
void vg::translate_node_ids (Path &path, const unordered_map< id_t, id_t > &translator)
 Switches the node ids in the path to the ones indicated by the translator. More...
 
void vg::translate_node_ids (Path &path, const unordered_map< id_t, id_t > &translator, id_t cut_node, size_t bases_removed, bool from_right)
 
void vg::translate_oriented_node_ids (Path &path, const unordered_map< id_t, pair< id_t, bool >> &translator)
 Switches the node ids and orientations in the path to the ones indicated by the translator. More...
 
void vg::translate_oriented_node_ids (Path &path, const function< pair< id_t, bool >(id_t)> &translator)
 Switches node ids and orientations in the path to the ones indicated by the translator. More...
 
void vg::translate_node_ids (path_t &path, const unordered_map< id_t, id_t > &translator)
 
void vg::translate_oriented_node_ids (path_t &path, const unordered_map< id_t, pair< id_t, bool >> &translator)
 
void vg::translate_oriented_node_ids (path_t &path, const function< pair< id_t, bool >(id_t)> &translator)
 
pos_t vg::initial_position (const Path &path)
 
pos_t vg::final_position (const Path &path)
 
Path vg::path_from_node_traversals (const list< NodeTraversal > &traversals)
 
void vg::remove_paths (Graph &graph, const function< bool(const string &)> &paths_to_take, std::list< Path > *matching)
 
Path vg::path_from_path_handle (const PathHandleGraph &graph, path_handle_t path_handle)
 
Alignment vg::alignment_from_path (const HandleGraph &graph, const Path &path)
 
void vg::from_proto_edit (const Edit &proto_edit, edit_t &edit)
 
void vg::to_proto_edit (const edit_t &edit, Edit &proto_edit)
 
void vg::from_proto_mapping (const Mapping &proto_mapping, path_mapping_t &mapping)
 
void vg::to_proto_mapping (const path_mapping_t &mapping, Mapping &proto_mapping)
 
void vg::from_proto_path (const Path &proto_path, path_t &path)
 
void vg::to_proto_path (const path_t &path, Path &proto_path)
 
int vg::mapping_from_length (const path_mapping_t &mapping)
 
int vg::path_from_length (const path_t &path)
 
int vg::mapping_to_length (const path_mapping_t &mapping)
 
int vg::path_to_length (const path_t &path)
 
void vg::reverse_complement_mapping_in_place (path_mapping_t *m, const function< int64_t(id_t)> &node_length)
 
path_mapping_t vg::reverse_complement_mapping (const path_mapping_t &m, const function< int64_t(id_t)> &node_length)
 
path_t vg::reverse_complement_path (const path_t &path, const function< int64_t(id_t)> &node_length)
 
void vg::reverse_complement_path_in_place (path_t *path, const function< int64_t(id_t)> &node_length)
 
pos_t vg::initial_position (const path_t &path)
 
pos_t vg::final_position (const path_t &path)
 
string vg::debug_string (const path_t &path)
 
string vg::debug_string (const path_mapping_t &mapping)
 
string vg::debug_string (const edit_t &edit)
 
int vg::corresponding_length_internal (const path_t &path, int given_length, bool is_from_length, bool from_end)
 
int vg::corresponding_to_length (const path_t &path, int from_length, bool from_end)
 
int vg::corresponding_from_length (const path_t &path, int to_length, bool from_end)