1 #ifndef theplu_yat_omic_bam_read
2 #define theplu_yat_omic_bam_read
25 #include "config_bam.h"
27 #include YAT_BAM_HEADER
28 #include YAT_SAM_HEADER
36 #define BAM_CIGAR_STR "MIDNSHP=XB"
38 #define BAM_CIGAR_TYPE 0x3C1A7
41 #define bam_cigar_op(c) ((c)&BAM_CIGAR_MASK)
43 #define bam_cigar_oplen(c) ((c)>>BAM_CIGAR_SHIFT)
45 #define bam_cigar_opchr(c) (BAM_CIGAR_STR[bam_cigar_op(c)])
47 #define bam_cigar_gen(l, o) ((l)<<BAM_CIGAR_SHIFT|(o))
53 #define bam_cigar_type(o) (BAM_CIGAR_TYPE>>((o)<<1)&3)
119 const uint8_t*
aux(
void)
const;
132 const uint8_t*
aux(
const char tag[2])
const;
146 void aux_append(
const char tag[2],
char type,
int len, uint8_t* data);
155 void aux_del(
const char tag[2]);
169 const bam1_core_t&
core(
void)
const;
176 bam1_core_t&
core(
void);
184 const uint32_t*
cigar(
void)
const;
189 uint32_t
cigar(
size_t i)
const;
211 void cigar(
const std::vector<uint32_t>& c);
216 uint8_t
qual(
size_t i)
const;
226 void qual(
size_t i, uint8_t q);
233 const char*
name(
void)
const;
240 void name(
const std::string& n);
245 int32_t
tid(
void)
const;
250 int32_t
pos(
void)
const;
260 int32_t
end(
void)
const;
265 int32_t
mtid(
void)
const;
270 int32_t
mpos(
void)
const;
284 uint8_t
sequence(
size_t index)
const;
302 void sequence(
const std::string& seq,
const std::vector<uint8_t>& qual);
314 uint16_t
flag(
void)
const;
350 bool soft_clipped(
const BamRead& bam);
360 uint32_t left_soft_clipped(
const BamRead& bam);
370 uint32_t right_soft_clipped(
const BamRead& bam);
392 :
public std::binary_function<const BamRead&, const BamRead&, bool>
413 :
public std::binary_function<const BamRead&, const BamRead&, bool>