Changeset 2949


Ignore:
Timestamp:
Jan 10, 2013, 2:29:00 AM (9 years ago)
Author:
Peter
Message:

comments describing defines from bam.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/omic/BamRead.h

    r2943 r2949  
    3131#ifndef BAM_CIGAR_STR
    3232#define BAM_CIGAR_STR "MIDNSHP=XB"
     33// lookup table used in bam_cigar_type
    3334#define BAM_CIGAR_TYPE 0x3C1A7
    3435
     36/// index of operation in range [0, 9], see below.
    3537#define bam_cigar_op(c) ((c)&BAM_CIGAR_MASK)
     38// length of the operation
    3639#define bam_cigar_oplen(c) ((c)>>BAM_CIGAR_SHIFT)
     40// char describing the operation, see column 2 in table below
    3741#define bam_cigar_opchr(c) (BAM_CIGAR_STR[bam_cigar_op(c)])
     42// Create a cigar element with length l and operation o
    3843#define bam_cigar_gen(l, o) ((l)<<BAM_CIGAR_SHIFT|(o))
     44// Returns a two-bits number describing the type of operation. The
     45// first bit, bam_cigar_type & 1, (4th column in table below) is 1 iff
     46// operation consumes query sequence. The second bit, bam_cigar_type &
     47// 2, (3rd column below) is 1 iff operation consumes reference
     48// sequence.
    3949#define bam_cigar_type(o) (BAM_CIGAR_TYPE>>((o)<<1)&3)
    4050#endif
Note: See TracChangeset for help on using the changeset viewer.