1 #ifndef theplu_yat_omic_bam_read
2 #define theplu_yat_omic_bam_read
25 #include "config_bam.h"
27 #include "yat/utility/Aligner.h"
29 #include "yat/utility/Cigar.h"
32 #include YAT_SAM_HEADER
84 const uint8_t*
aux(
void)
const;
97 const uint8_t*
aux(
const char tag[2])
const;
111 void aux_append(
const char tag[2],
char type,
int len, uint8_t* data);
120 void aux_del(
const char tag[2]);
134 const bam1_core_t&
core(
void)
const;
141 bam1_core_t&
core(
void);
151 const uint32_t*
cigar(
void)
const;
156 uint32_t
cigar(
size_t i)
const;
181 void cigar(
const std::vector<uint32_t>& c) YAT_DEPRECATE;
200 int32_t
end(
void)
const;
209 uint16_t
flag(
void)
const;
214 int32_t
mpos(
void)
const;
219 int32_t
mtid(
void)
const;
226 const char*
name(
void)
const;
233 void name(
const std::string& n);
238 int32_t
pos(
void)
const;
243 uint8_t
qual(
size_t i)
const;
253 void qual(
size_t i, uint8_t q);
267 uint8_t
sequence(
size_t index)
const;
292 void sequence(
const std::string& seq,
const std::vector<uint8_t>& qual);
309 int32_t
tid(
void)
const;
320 #ifndef YAT_HAVE_HTSLIB
321 uint32_t calend(
const bam1_core_t *c,
const uint32_t *cigar)
const;
324 int& data_size(
void);
325 const int& data_size(
void)
const;
375 bool soft_clipped(
const BamRead& bam);
385 uint32_t left_soft_clipped(
const BamRead& bam);
395 uint32_t right_soft_clipped(
const BamRead& bam);
428 :
public std::binary_function<const BamRead&, const BamRead&, bool>
449 :
public std::binary_function<const BamRead&, const BamRead&, bool>
469 :
public std::binary_function<const BamRead&, const BamRead&, bool>
496 template<
typename RandomAccessIterator>
498 double mismatch,
double gap=0.0,
double open_gap=0.0)
500 BOOST_CONCEPT_ASSERT((boost_concepts::ReadableIterator<RandomAccessIterator>));
501 BOOST_CONCEPT_ASSERT((boost_concepts::RandomAccessTraversal<RandomAccessIterator>));
505 for (uint32_t i = 0; i<bam.
core().n_cigar; ++i) {
508 RandomAccessIterator end = ref + bam.
cigar_oplen(i);
509 for (; ref!=end; ++ref) {
530 case (BAM_CSOFT_CLIP): {
void aux_del(const char tag[2])
remove a tag in aux field
virtual ~BamRead(void)
Destructor.
uint32_t sequence_length(void) const
int32_t tid(void) const
chromosome ID
BamRead(void)
default constructor
const char nt16_str(uint8_t)
bool operator()(const BamRead &lhs, const BamRead &rhs) const
bool operator()(const BamRead &lhs, const BamRead &rhs) const
int32_t end(void) const
rightmost coordinate
const char * name(void) const
const bam1_core_t & core(void) const
access core data struct
Class holding a bam query.
Definition: BamRead.h:53
uint32_t cigar_op(size_t i) const
double alignment_score(const BamRead &bam, RandomAccessIterator ref, double mismatch, double gap=0.0, double open_gap=0.0)
Definition: BamRead.h:497
const BamRead & operator=(const BamRead &rhs)
assignment operator
char sequence_str(size_t index) const
Definition: BamRead.h:427
int32_t mtid(void) const
Chromosome ID for mate.
std::string sequence(void) const
void aux_append(const char tag[2], char type, int len, uint8_t *data)
append a new tag to aux field
const uint8_t * aux(void) const
Compact Idiosyncratic Gapped Alignment Report.
Definition: Aligner.h:179
Definition: BamRead.h:468
Definition: BamFile.h:233
int32_t mpos(void) const
leftmost position for mate
Definition: BamRead.h:448
bool operator()(const BamRead &lhs, const BamRead &rhs) const
Definition: BamFile.h:118
void swap(BamRead &other)
uint32_t cigar_oplen(size_t i) const
class to iterate through a InBamFile
Definition: BamReadIterator.h:60
uint16_t flag(void) const
bitwise flag
uint8_t qual(size_t i) const
const unsigned char nt16_table(char)
int32_t pos(void) const
0-based laftmost coordinate
const uint32_t * cigar(void) const
access CIGAR array
std::string cigar_str(void) const