1 #ifndef gamgee__cigar__guard
2 #define gamgee__cigar__guard
26 explicit Cigar(
const std::shared_ptr<bam1_t>& sam_record);
35 uint32_t
size()
const {
return m_num_cigar_elements; }
92 std::shared_ptr<bam1_t> m_sam_record;
94 uint32_t m_num_cigar_elements;
96 static const char cigar_ops_as_chars[];
static const std::vector< int8_t > cigar_op_parse_table
Table used to parse chars representing cigar operations into their htslib encodings.
Definition: cigar.h:68
std::string to_string() const
produce a string representation of this Cigar
Definition: cigar.cpp:99
static CigarElement make_cigar_element(const uint32_t oplen, const CigarOperator op)
creates an encoded htslib cigar element suitable for direct insertion into a Cigar out of a length an...
Definition: cigar.h:58
#define bam_cigar_op(c)
Definition: sam.h:76
class to build Sam objects from existing data or from scratch
Definition: sam_builder.h:58
#define bam_cigar_type(o)
Definition: sam.h:100
uint32_t size() const
number of base qualities in the container
Definition: cigar.h:35
CigarOperator
comprehensive list of valid cigar operators
Definition: cigar.h:17
uint32_t CigarElement
Definition: cigar.h:19
#define BAM_CIGAR_SHIFT
Definition: sam.h:72
bool operator==(const Cigar &other) const
check for equality with another Cigar
Definition: cigar.cpp:79
static uint32_t cigar_oplen(const CigarElement cigar_element)
gets the length of an individual cigar element
Definition: cigar.h:50
static CigarOperator cigar_op(const CigarElement cigar_element)
gets the operator of an individual cigar element
Definition: cigar.h:43
Cigar(const std::shared_ptr< bam1_t > &sam_record)
creates a Cigar object that points to htslib memory already allocated
Definition: cigar.cpp:26
Definition: exceptions.h:9
static bool consumes_reference_bases(const CigarOperator op)
returns true if operator is one of the following: Match (M), Deletion (D), Reference-Skip (N)...
Definition: cigar.h:87
static bool consumes_read_bases(const CigarOperator op)
returns true if operator is one of the following: Match (M), Insertion (I), Soft-Clip (S)...
Definition: cigar.h:86
Cigar & operator=(const Cigar &other)
creates a deep copy of a Cigar object
Definition: cigar.cpp:48
~Cigar()=default
default destruction is sufficient, since our shared_ptr will handle deallocation
Utility class to manage the memory of the cigar structure.
Definition: cigar.h:24
static CigarElement parse_next_cigar_element(std::stringstream &cigar_stream)
utility function to parse cigar strings (in a stringstream) one element at a time ...
Definition: cigar.cpp:107
#define bam_cigar_oplen(c)
Definition: sam.h:77
CigarElement operator[](const uint32_t index) const
use freely as you would an array.
Definition: cigar.cpp:63
bool operator!=(const Cigar &other) const
check for inequality with another Cigar
Definition: cigar.cpp:91