vg
tools for working with variation graphs
Namespaces | Functions
gbwt_helper.cpp File Reference
#include "gbwt_helper.hpp"
#include "utility.hpp"
#include <vg/io/vpkg.hpp>
#include <handle.hpp>
#include <gbwtgraph/utils.h>
#include <sstream>
#include <unordered_map>

Namespaces

 vg
 

Functions

std::vector< std::string > vg::parseGenotypes (const std::string &vcf_line, size_t num_samples)
 
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::finish_gbwt_constuction (gbwt::GBWTBuilder &builder, const std::vector< std::string > &sample_names, const std::vector< std::string > &contig_names, size_t haplotype_count, bool print_metadata, const std::string &header="GBWT")
 Finish GBWT construction and optionally print the metadata. 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...
 
std::vector< std::vector< gbwt::size_type > > vg::partition_gbwt_sequences (const gbwt::GBWT &gbwt_index, const std::unordered_map< nid_t, size_t > &node_to_job, size_t num_jobs)
 
gbwt::GBWT vg::rebuild_gbwt_job (const gbwt::GBWT &gbwt_index, const RebuildJob &job, size_t job_id, const std::vector< gbwt::size_type > &sequences, const RebuildParameters &parameters)
 
void vg::copy_metadata (const gbwt::GBWT &source, gbwt::GBWT &target, const std::vector< std::vector< gbwt::size_type >> &jobs, const std::vector< size_t > &job_order)
 
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)