1 #ifndef __gamgee__cigar__
2 #define __gamgee__cigar__
4 #include "htslib/sam.h"
22 explicit Cigar(
const std::shared_ptr<bam1_t>& sam_record);
29 uint32_t
operator[](
const uint32_t index)
const;
30 uint32_t
size()
const {
return m_num_cigar_elements; }
37 return static_cast<CigarOperator>(bam_cigar_op(cigar_element));
43 inline static uint32_t
cigar_oplen(
const uint32_t cigar_element) {
44 return bam_cigar_oplen(cigar_element);
48 std::shared_ptr<bam1_t> m_sam_record;
50 uint32_t m_num_cigar_elements;
52 static const char cigar_ops_as_chars[];
static CigarOperator cigar_op(const uint32_t cigar_element)
gets the operator of an individual cigar element
Definition: cigar.h:36
std::string to_string() const
returns a string representation of this cigar
Definition: cigar.cpp:93
uint32_t size() const
number of base qualities in the container
Definition: cigar.h:30
CigarOperator
comprehensive list of valid cigar operators
Definition: cigar.h:15
Cigar(const std::shared_ptr< bam1_t > &sam_record)
creates a Cigar object that points to htslib memory already allocated
Definition: cigar.cpp:23
uint32_t operator[](const uint32_t index) const
use freely as you would an array.
Definition: cigar.cpp:84
Cigar & operator=(const Cigar &other)
creates a deep copy of a Cigar object
Definition: cigar.cpp:56
~Cigar()=default
default destruction is sufficient, since our shared_ptr will handle deallocation
static uint32_t cigar_oplen(const uint32_t cigar_element)
gets the length of an individual cigar element
Definition: cigar.h:43
Utility class to manage the memory of the cigar structure.
Definition: cigar.h:20