Gamgee
You miserable little maggot. I'll stove your head in!
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Namespaces | Functions
hts_memory.h File Reference
#include "htslib/sam.h"
#include "htslib/vcf.h"
#include "htslib/synced_bcf_reader.h"
#include "htslib/kstring.h"
#include <memory>
#include <vector>
#include <string>

Go to the source code of this file.

Classes

struct  gamgee::utils::HtsFileDeleter
 a functor object to delete an htsFile pointer More...
 
struct  gamgee::utils::HtsIndexDeleter
 a functor object to delete an hts file index pointer More...
 
struct  gamgee::utils::HtsIteratorDeleter
 a functor object to delete an hts file iterator pointer More...
 
struct  gamgee::utils::SamBodyDeleter
 a functor object to delete a bam1_t pointer More...
 
struct  gamgee::utils::SamHeaderDeleter
 a functor object to delete a bam_hdr_t pointer More...
 
struct  gamgee::utils::VariantHeaderDeleter
 a functor object to delete a bcf_hdr_t pointer More...
 
struct  gamgee::utils::VariantBodyDeleter
 a functor object to delete a bcf1_t pointer More...
 
struct  gamgee::utils::SyncedReaderDeleter
 a functor object to delete a bcf_srs_t pointer More...
 

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 val)
 
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...
 
uint8_t gamgee::utils::int_encoded_size (const int32_t val)
 
uint32_t gamgee::utils::encoded_size (const int8_t field_type, const uint32_t field_length, bool add_type_descriptor=true)
 
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...