vg
tools for working with variation graphs
Classes | Namespaces | Functions
gbwt_helper.hpp File Reference
#include <vector>
#include "position.hpp"
#include <gbwt/dynamic_gbwt.h>
#include <gbwt/fast_locate.h>
#include <handlegraph/mutable_path_handle_graph.hpp>

Classes

struct  vg::GBWTHandler
 
struct  vg::RebuildJob
 
struct  vg::RebuildParameters
 Parameters for rebuild_gbwt. More...
 

Namespaces

 vg
 

Functions

std::vector< std::string > vg::parseGenotypes (const std::string &vcf_line, size_t num_samples)
 
handle_t vg::gbwt_to_handle (const HandleGraph &graph, gbwt::node_type node)
 Convert gbwt::node_type to handle_t. More...
 
pos_t vg::gbwt_to_pos (gbwt::node_type node, size_t offset)
 Convert gbwt::node_type and an offset as size_t to pos_t. More...
 
gbwt::node_type vg::handle_to_gbwt (const HandleGraph &graph, handle_t handle)
 Convert handle_t to gbwt::node_type. More...
 
gbwt::node_type vg::pos_to_gbwt (pos_t pos)
 Extract gbwt::node_type from pos_t. More...
 
gbwt::node_type vg::mapping_to_gbwt (const Mapping &mapping)
 Convert Mapping to gbwt::node_type. More...
 
gbwt::vector_type vg::path_to_gbwt (const Path &path)
 Convert Path to a GBWT path. More...
 
gbwt::vector_type vg::extract_as_gbwt_path (const PathHandleGraph &graph, const std::string &path_name)
 Extract a path as a GBWT path. If the path does not exist, it is treated as empty. More...
 
gbwt::vector_type vg::path_predecessors (const PathHandleGraph &graph, const std::string &path_name)
 
gbwt::size_type vg::gbwt_node_width (const HandleGraph &graph)
 Determine the node width in bits for the GBWT nodes based on the given graph. More...
 
void vg::load_gbwt (gbwt::GBWT &index, const std::string &filename, bool show_progress=false)
 Load a compressed GBWT from the file. More...
 
void vg::load_gbwt (gbwt::DynamicGBWT &index, const std::string &filename, bool show_progress=false)
 Load a dynamic GBWT from the file. More...
 
void vg::load_r_index (gbwt::FastLocate &index, const std::string &filename, bool show_progress=false)
 Load an r-index from the file. More...
 
void vg::save_gbwt (const gbwt::GBWT &index, const std::string &filename, bool show_progress=false)
 Save a compressed GBWT to the file. More...
 
void vg::save_gbwt (const gbwt::DynamicGBWT &index, const std::string &filename, bool show_progress=false)
 Save a dynamic GBWT to the file. More...
 
void vg::save_r_index (const gbwt::FastLocate &index, const std::string &filename, bool show_progress=false)
 Save an r-index to the file. More...
 
gbwt::GBWT vg::rebuild_gbwt (const gbwt::GBWT &gbwt_index, const std::vector< RebuildJob > &jobs, const std::unordered_map< nid_t, size_t > &node_to_job, const RebuildParameters &parameters)
 
gbwt::GBWT vg::rebuild_gbwt (const gbwt::GBWT &gbwt_index, const std::vector< RebuildJob::mapping_type > &mappings)
 As the general rebuild_gbwt, but always using a single job with default parameters. More...
 
std::vector< gbwt::size_type > vg::threads_for_sample (const gbwt::GBWT &gbwt_index, const std::string &sample_name)
 Return the list of thread ids / gbwt path ids for the given sample. More...
 
std::vector< gbwt::size_type > vg::threads_for_contig (const gbwt::GBWT &gbwt_index, const std::string &contig_name)
 Return the list of thread ids / gbwt path ids for the given contig. More...
 
std::string vg::insert_gbwt_path (MutablePathHandleGraph &graph, const gbwt::GBWT &gbwt_index, gbwt::size_type id, std::string path_name)
 
Path vg::extract_gbwt_path (const HandleGraph &graph, const gbwt::GBWT &gbwt_index, gbwt::size_type id)
 
std::string vg::compose_short_path_name (const gbwt::GBWT &gbwt_index, gbwt::size_type id)
 
void vg::copy_reference_samples (const gbwt::GBWT &source, gbwt::GBWT &destination)
 Copies the reference sample tag from the source GBWT index to the destination GBWT index. More...
 
void vg::copy_reference_samples (const PathHandleGraph &source, gbwt::GBWT &destination)
 
gbwt::GBWT vg::get_gbwt (const std::vector< gbwt::vector_type > &paths)
 Transform the paths into a GBWT index. Primarily for testing. More...
 
unordered_map< string, vector< nid_t > > vg::load_translation_map (ifstream &input_stream)
 
unordered_map< nid_t, pair< string, size_t > > vg::load_translation_back_map (HandleGraph &graph, ifstream &input_stream)
 

Detailed Description

Utility classes and functions for working with GBWT.