bam_cigar2qlen

@param n_cigar Number of items in @p cigar @param cigar CIGAR data @return Query length

CIGAR data is stored as in the BAM format, i.e. (op_len << 4) | op where op_len is the length in bases and op is a value between 0 and 8 representing one of the operations "MIDNSHP=X" (M = 0; X = 8)

This function returns the sum of the lengths of the M, I, S, = and X operations in @p cigar (these are the operations that "consume" query bases). All other operations (including invalid ones) are ignored.

@note This return type of this function is hts_pos_t so that it can correctly return the length of CIGAR sequences including many long operations without overflow. However, other restrictions (notably the sizes of bam1_core_t::l_qseq and bam1_t::data) limit the maximum query sequence length supported by HTSlib to fewer than INT_MAX bases.

extern (C)
bam_cigar2qlen
(,
const(uint)* cigar
)

Meta