yat
0.14.5pre
|
Compact Idiosyncratic Gapped Alignment Report. More...
#include <yat/utility/Aligner.h>
Public Types | |
typedef CigarIterator < std::deque< uint32_t > ::const_iterator > | const_iterator |
Public Member Functions | |
const_iterator | begin (void) const |
void | clear (void) |
const_iterator | end (void) const |
uint32_t | length (void) const |
uint8_t | op (size_t i) const |
char | opchr (size_t i) const |
uint32_t | oplen (size_t i) const |
void | pop_back (uint32_t len=1) |
void | pop_front (uint32_t len=1) |
void | push_back (uint8_t op, uint32_t len=1) |
void | push_front (uint8_t op, uint32_t len=1) |
uint32_t | query_length (void) const |
Translate CIGAR to a query length. More... | |
uint32_t | reference_length (void) const |
Translate CIGAR to a reference length. More... | |
void | reverse (void) |
reverse the CIGAR More... | |
uint32_t | operator[] (size_t i) const |
size_t | size (void) const |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &os, const Aligner::Cigar &cigar) |
Compact Idiosyncratic Gapped Alignment Report.
A CIGAR is a representation of an alignment, an array of operation/length where the operation and length is packed into a uint32_t. So a CIGAR of e.g. '3M1D5M' means alignment is three matches, one deletion, and five matches, which is represented by an array of length 3.
#define | value | char | type | consume ref | consume query |
BAM_CMATCH | 0 | M | 3 | true | true |
BAM_CINS | 1 | I | 1 | false | true |
BAM_CDEL | 2 | D | 2 | true | false |
BAM_CREF_SKIP | 3 | N | 2 | true | false |
BAM_CSOFT_CLIP | 4 | S | 1 | false | true |
BAM_CHARD_CLIP | 5 | H | 0 | false | false |
BAM_CPAD | 6 | P | 0 | false | false |
BAM_CEQUAL | 7 | = | 3 | true | true |
BAM_CDIFF | 8 | X | 3 | true | true |
BAM_CBACK | 9 | B | 0 | false | false |
typedef CigarIterator<std::deque<uint32_t>::const_iterator > theplu::yat::utility::Aligner::Cigar::const_iterator |
const_iterator theplu::yat::utility::Aligner::Cigar::begin | ( | void | ) | const |
void theplu::yat::utility::Aligner::Cigar::clear | ( | void | ) |
Erases all elements.
const_iterator theplu::yat::utility::Aligner::Cigar::end | ( | void | ) | const |
uint32_t theplu::yat::utility::Aligner::Cigar::length | ( | void | ) | const |
Total length of operations counting operations that consume either (or both) query and reference e.g. match, insertion, or deletion. HardClip or Padding operations are ignored.
uint8_t theplu::yat::utility::Aligner::Cigar::op | ( | size_t | i | ) | const |
See table in class documntation.
char theplu::yat::utility::Aligner::Cigar::opchr | ( | size_t | i | ) | const |
Translate the op(i) to a descriptive character of one of the following "MIDNSHP=XB". See table in class documentation.
uint32_t theplu::yat::utility::Aligner::Cigar::operator[] | ( | size_t | i | ) | const |
uint32_t theplu::yat::utility::Aligner::Cigar::oplen | ( | size_t | i | ) | const |
void theplu::yat::utility::Aligner::Cigar::pop_back | ( | uint32_t | len = 1 | ) |
Erase last len operation.
void theplu::yat::utility::Aligner::Cigar::pop_front | ( | uint32_t | len = 1 | ) |
Erase first len operation.
void theplu::yat::utility::Aligner::Cigar::push_back | ( | uint8_t | op, |
uint32_t | len = 1 |
||
) |
Add an operation op of length len at back of cigar. If last operation equals op, length of that element is changed and the size() is not modified.
void theplu::yat::utility::Aligner::Cigar::push_front | ( | uint8_t | op, |
uint32_t | len = 1 |
||
) |
Add an operation op of length len at front of cigar.
uint32_t theplu::yat::utility::Aligner::Cigar::query_length | ( | void | ) | const |
Translate CIGAR to a query length.
Calculate total length of operations which consume a query e.g. match or insetion. See table in class documentation.
This is the same function as bam_cigar2qlen in samtools C API.
uint32_t theplu::yat::utility::Aligner::Cigar::reference_length | ( | void | ) | const |
Translate CIGAR to a reference length.
Calculate total length of operations which consume a reference e.g. match or deletion. See table in class documentation.
Similar to bam_calend but does not handle BAM_CBACK
as it has not been included in SAM specification. http://sourceforge.net/p/samtools/mailman/message/29373646/
void theplu::yat::utility::Aligner::Cigar::reverse | ( | void | ) |
reverse the CIGAR
size_t theplu::yat::utility::Aligner::Cigar::size | ( | void | ) | const |
|
related |
Output e.g. '5S44M5I98M' if the cigar has four elements. Each element is output as the length followed by the character descibing the operation (see opchr).