Gamgee
You miserable little maggot. I'll stove your head in!
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Functions | Variables
hts_memory.cpp File Reference
#include "hts_memory.h"
#include <memory>
#include <stdexcept>

Namespaces

 gamgee
 
 gamgee::utils
 utility functions for the gamgee library
 

Functions

shared_ptr< htsFilegamgee::utils::make_shared_hts_file (htsFile *hts_file_ptr)
 wraps a pre-allocated htsFile in a shared_ptr with correct deleter More...
 
shared_ptr< hts_idx_tgamgee::utils::make_shared_hts_index (hts_idx_t *hts_index_ptr)
 wraps a pre-allocated hts_idx_t in a shared_ptr with correct deleter More...
 
shared_ptr< hts_itr_tgamgee::utils::make_shared_hts_itr (hts_itr_t *hts_itr_ptr)
 wraps a pre-allocated hts_itr_t in a shared_ptr with correct deleter More...
 
shared_ptr< bam1_tgamgee::utils::make_shared_sam (bam1_t *sam_ptr)
 wraps a pre-allocated bam1_t in a shared_ptr with correct deleter More...
 
shared_ptr< bam_hdr_tgamgee::utils::make_shared_sam_header (bam_hdr_t *sam_header_ptr)
 wraps a pre-allocated bam_hdr_t in a shared_ptr with correct deleter More...
 
shared_ptr< bcf1_tgamgee::utils::make_shared_variant (bcf1_t *bcf_ptr)
 wraps a pre-allocated bcf1_t in a shared_ptr with correct deleter More...
 
shared_ptr< bcf_hdr_tgamgee::utils::make_shared_variant_header (bcf_hdr_t *bcf_hdr_ptr)
 wraps a pre-allocated bcf_hdr_t in a shared_ptr with correct deleter More...
 
std::shared_ptr< bcf_srs_tgamgee::utils::make_shared_synced_variant_reader (bcf_srs_t *synced_reader_ptr)
 wraps a pre-allocated bcf_srs_t in a shared_ptr with correct deleter More...
 
unique_ptr< htsFile,
HtsFileDeleter > 
gamgee::utils::make_unique_hts_file (htsFile *hts_file_ptr)
 wraps a pre-allocated htsFile in a unique_ptr with correct deleter More...
 
std::unique_ptr< hts_itr_t,
HtsIteratorDeleter > 
gamgee::utils::make_unique_hts_itr (hts_itr_t *hts_itr_ptr)
 wraps a pre-allocated hts_itr_t in a unique_ptr with correct deleter More...
 
bam1_tgamgee::utils::sam_deep_copy (bam1_t *original)
 creates a deep copy of an existing bam1_t More...
 
bam_hdr_tgamgee::utils::sam_header_deep_copy (bam_hdr_t *original)
 creates a deep copy of an existing bam_hdr_t More...
 
bcf1_tgamgee::utils::variant_deep_copy (bcf1_t *original)
 creates a deep copy of an existing bcf1_t More...
 
bcf_hdr_tgamgee::utils::variant_header_deep_copy (bcf_hdr_t *original)
 creates a deep copy of an existing bcf_hdr_t More...
 
bam1_tgamgee::utils::sam_shallow_copy (bam1_t *original)
 creates a shallow copy of an existing bam1_t: copies core fields but not the data buffer or fields related to the size of the data buffer More...
 
std::string gamgee::utils::htslib_filter_name (bcf_hdr_t *header, bcf1_t *body, int index)
 helper function to translate an index into a string in the filter list More...
 
uint8_t gamgee::utils::bcf_type_to_element_size (const int32_t htslib_type)
 Returns the number of bytes required to store each BCF_BT_* type. More...
 
uint8_t gamgee::utils::int_encoded_type (const int32_t min_val, const int32_t max_val)
 Given a min and max value, determines whether int8, int16, or int32 BCF encoding is required. More...
 
kstring_t gamgee::utils::initialize_htslib_buffer (const uint32_t initial_capacity)
 Returns a newly-allocated kstring_t buffer suitable for passing to htslib. More...
 

Variables

const uint8_t gamgee::utils::bcf_type_sizes [] = { 0, 1, 2, 4, 0, 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 }