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

#include <gbwt_helper.hpp>

Public Types

enum  index_type { index_none, index_external, index_compressed, index_dynamic }
 

Public Member Functions

gbwt::GBWT * get_compressed ()
 Returns a pointer to the compressed GBWT in use, if any. More...
 
const gbwt::GBWT * get_compressed () const
 Returns a const pointer to the compressed GBWT in use, if any. More...
 
void use_compressed ()
 
void use_dynamic ()
 
void use (gbwt::GBWT &new_index)
 
void use_external (gbwt::GBWT &new_index)
 
void use (gbwt::DynamicGBWT &new_index)
 
void unbacked ()
 The GBWT is no longer backed by a file. More...
 
void serialize (const std::string &new_filename)
 Serialize the in-memory index to this file and start using it as the backing file. More...
 
void clear ()
 Clear the in-memory index. More...
 

Public Attributes

gbwt::GBWT compressed_owned
 Compressed GBWT stored within the handler. More...
 
gbwt::GBWT * compressed_external = nullptr
 Compressed GBWT stored somewhere else. More...
 
gbwt::DynamicGBWT dynamic
 Dynamic GBWT. More...
 
index_type in_use = index_none
 Which index is in use. More...
 
std::string filename
 The in-memory indexes are backed by this file. More...
 
bool show_progress = false
 Print progress information to stderr when loading/converting indexes. More...
 

Detailed Description

Helper class that stores either a GBWT or a DynamicGBWT and loads them from a file or converts between them when necessary.

Member Enumeration Documentation

◆ index_type

Enumerator
index_none 
index_external 
index_compressed 
index_dynamic 

Member Function Documentation

◆ clear()

void vg::GBWTHandler::clear ( )

Clear the in-memory index.

◆ get_compressed() [1/2]

const gbwt::GBWT * vg::GBWTHandler::get_compressed ( )

Returns a pointer to the compressed GBWT in use, if any.

◆ get_compressed() [2/2]

const gbwt::GBWT* vg::GBWTHandler::get_compressed ( ) const

Returns a const pointer to the compressed GBWT in use, if any.

◆ serialize()

void vg::GBWTHandler::serialize ( const std::string &  new_filename)

Serialize the in-memory index to this file and start using it as the backing file.

◆ unbacked()

void vg::GBWTHandler::unbacked ( )

The GBWT is no longer backed by a file.

◆ use() [1/2]

void vg::GBWTHandler::use ( gbwt::DynamicGBWT &  new_index)

Start using this dynamic GBWT. Clears the index used as the argument. The GBWT is not backed by a file.

◆ use() [2/2]

void vg::GBWTHandler::use ( gbwt::GBWT &  new_index)

Start using this compressed GBWT. Clears the index used as the argument. The GBWT is not backed by a file.

◆ use_compressed()

void vg::GBWTHandler::use_compressed ( )

Switch to a compressed GBWT, converting it from the dynamic GBWT or reading it from a file if necessary.

◆ use_dynamic()

void vg::GBWTHandler::use_dynamic ( )

Switch to a dynamic GBWT, converting it from the compressed GBWT or reading it from a file if necessary.

◆ use_external()

void vg::GBWTHandler::use_external ( gbwt::GBWT &  new_index)

Start using this external compressed GBWT. The handler does not take ownership of the index. This GBWT is not backed by a file.

Member Data Documentation

◆ compressed_external

gbwt::GBWT* vg::GBWTHandler::compressed_external = nullptr

Compressed GBWT stored somewhere else.

◆ compressed_owned

gbwt::GBWT vg::GBWTHandler::compressed_owned

Compressed GBWT stored within the handler.

◆ dynamic

gbwt::DynamicGBWT vg::GBWTHandler::dynamic

Dynamic GBWT.

◆ filename

std::string vg::GBWTHandler::filename

The in-memory indexes are backed by this file.

◆ in_use

index_type vg::GBWTHandler::in_use = index_none

Which index is in use.

◆ show_progress

bool vg::GBWTHandler::show_progress = false

Print progress information to stderr when loading/converting indexes.


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