Gamgee
You miserable little maggot. I'll stove your head in!
|
Utility class to manage the memory of the cigar structure. More...
#include <cigar.h>
Public Member Functions | |
Cigar (const std::shared_ptr< bam1_t > &sam_record) | |
creates a Cigar object that points to htslib memory already allocated More... | |
Cigar (const Cigar &other) | |
creates a deep copy of a Cigar object More... | |
Cigar (Cigar &&other)=default | |
Cigar & | operator= (const Cigar &other) |
creates a deep copy of a Cigar object More... | |
Cigar & | operator= (Cigar &&other)=default |
~Cigar ()=default | |
default destruction is sufficient, since our shared_ptr will handle deallocation More... | |
CigarElement | operator[] (const uint32_t index) const |
use freely as you would an array. More... | |
CigarElement & | operator[] (const uint32_t index) |
use freely as you would an array More... | |
uint32_t | size () const |
number of base qualities in the container More... | |
bool | operator== (const Cigar &other) const |
check for equality with another Cigar More... | |
bool | operator!= (const Cigar &other) const |
check for inequality with another Cigar More... | |
std::string | to_string () const |
produce a string representation of this Cigar More... | |
Static Public Member Functions | |
static CigarOperator | cigar_op (const CigarElement cigar_element) |
gets the operator of an individual cigar element More... | |
static uint32_t | cigar_oplen (const CigarElement cigar_element) |
gets the length of an individual cigar element More... | |
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 and a CigarOperator More... | |
static CigarElement | parse_next_cigar_element (std::stringstream &cigar_stream) |
utility function to parse cigar strings (in a stringstream) one element at a time More... | |
static bool | consumes_read_bases (const CigarOperator op) |
returns true if operator is one of the following: Match (M), Insertion (I), Soft-Clip (S), Equal (=) or Different (X) More... | |
static bool | consumes_reference_bases (const CigarOperator op) |
returns true if operator is one of the following: Match (M), Deletion (D), Reference-Skip (N), Equal (=) or Different (X) More... | |
Static Public Attributes | |
static const std::vector< int8_t > | cigar_op_parse_table = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,-1,-1,-1,-1,9,-1,2,-1,-1,-1,5,1,-1,-1,-1,0,3,-1,6,-1,-1,4,-1,-1,-1,-1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} |
Table used to parse chars representing cigar operations into their htslib encodings. More... | |
Friends | |
class | SamBuilder |
builder needs access to the internals in order to build efficiently More... | |
Utility class to manage the memory of the cigar structure.
|
explicit |
gamgee::Cigar::Cigar | ( | const Cigar & | other | ) |
creates a deep copy of a Cigar object
|
default |
|
default |
default destruction is sufficient, since our shared_ptr will handle deallocation
|
inlinestatic |
gets the operator of an individual cigar element
|
inlinestatic |
gets the length of an individual cigar element
|
inlinestatic |
returns true if operator is one of the following: Match (M), Insertion (I), Soft-Clip (S), Equal (=) or Different (X)
|
inlinestatic |
returns true if operator is one of the following: Match (M), Deletion (D), Reference-Skip (N), Equal (=) or Different (X)
|
inlinestatic |
creates an encoded htslib cigar element suitable for direct insertion into a Cigar out of a length and a CigarOperator
creates a deep copy of a Cigar object
< check for self assignment
< shared_ptr assignment will take care of deallocating old sam record if necessary
CigarElement gamgee::Cigar::operator[] | ( | const uint32_t | index | ) | const |
use freely as you would an array.
access an individual cigar element by index
CigarElement & gamgee::Cigar::operator[] | ( | const uint32_t | index | ) |
use freely as you would an array
access and/or modify an individual cigar element by index
|
static |
utility function to parse cigar strings (in a stringstream) one element at a time
This function is useful if you are parsing a cigar string into elements and operators. A simple way to iterate over all the elements is :
|
inline |
number of base qualities in the container
string gamgee::Cigar::to_string | ( | ) | const |
produce a string representation of this Cigar
returns a string representation of this cigar
|
friend |
builder needs access to the internals in order to build efficiently
|
static |
Table used to parse chars representing cigar operations into their htslib encodings.