Class holding a bam query.
More...
#include <yat/omic/BamRead.h>
|
class | InBamFile |
|
class | OutBamFile |
|
class | BamReadIterator |
|
Class holding a bam query.
This is a wrapper around bam1_t and most of its information is held in the core struct. A BamRead is typically created from a InBamFile.
- See Also
- samtools
- Since
- New in yat 0.10
theplu::yat::omic::BamRead::BamRead |
( |
void |
| ) |
|
default constructor
Constructed object contains no data and most operations are not defined
const uint8_t* theplu::yat::omic::BamRead::aux |
( |
void |
| ) |
const |
- Returns
- pointer to auxiliary data
- See Also
- aux_size(void)
const uint8_t* theplu::yat::omic::BamRead::aux |
( |
const char |
tag[2] | ) |
const |
Use bam_aux2? functions (in samtools C api) to convert returned pointer to corresponding type.
- Returns
- pointer to field associated with tag, NULL if tag doesn't exist.
- See Also
- bam_aux_get
- Since
- New in yat 0.11
void theplu::yat::omic::BamRead::aux_append |
( |
const char |
tag[2], |
|
|
char |
type, |
|
|
int |
len, |
|
|
uint8_t * |
data |
|
) |
| |
append a new tag to aux field
- Parameters
-
tag | two-charcter tag to append |
type | describes which type and can be 'iIsScCdfAZH' |
len | length of data |
data | pointer to data |
- Since
- New in yat 0.11
- See Also
- SAM specification
void theplu::yat::omic::BamRead::aux_del |
( |
const char |
tag[2] | ) |
|
remove a tag in aux field
- Exceptions
-
- Since
- New in yat 0.11
int theplu::yat::omic::BamRead::aux_size |
( |
void |
| ) |
const |
- Returns
- length of aux field
- Since
- New in yat 0.11
const uint32_t* theplu::yat::omic::BamRead::cigar |
( |
void |
| ) |
const |
access CIGAR array
In each element the lower 4 bits gives a CIGAR operation and the upper 28 bits keep the length.
The size of CIGAR array is accessed via core().n_cigar.
uint32_t theplu::yat::omic::BamRead::cigar |
( |
size_t |
i | ) |
const |
- Returns
- i th element of CIGAR array
void theplu::yat::omic::BamRead::cigar |
( |
const std::vector< uint32_t > & |
c | ) |
|
set CIGAR
- Parameters
-
- Since
- new in yat 0.12
uint32_t theplu::yat::omic::BamRead::cigar_op |
( |
size_t |
i | ) |
const |
- Returns
- i th CIGAR operation
uint32_t theplu::yat::omic::BamRead::cigar_oplen |
( |
size_t |
i | ) |
const |
- Returns
- length of i th CIGAR element
std::string theplu::yat::omic::BamRead::cigar_str |
( |
void |
| ) |
const |
Translate CIGAR array to a string such as '72M3S'
const bam1_core_t& theplu::yat::omic::BamRead::core |
( |
void |
| ) |
const |
access core data struct
- See Also
- samtools C api documentaion
bam1_core_t& theplu::yat::omic::BamRead::core |
( |
void |
| ) |
|
access core data struct
- See Also
- samtools C api documentaion
int32_t theplu::yat::omic::BamRead::end |
( |
void |
| ) |
const |
rightmost coordinate
Coordinate is 0-based, i.e., the end is one passed the last matching position.
- See Also
- bam_calend
uint16_t theplu::yat::omic::BamRead::flag |
( |
void |
| ) |
const |
bitwise flag
- See Also
- Preprocessor defines BAM_F*
- Since
- implemented since yat 0.12
const char* theplu::yat::omic::BamRead::name |
( |
void |
| ) |
const |
- Returns
- query name
Length of array is described by core().l_qname
void theplu::yat::omic::BamRead::name |
( |
const std::string & |
n | ) |
|
modify name
- Since
- New in yat 0.11
uint8_t theplu::yat::omic::BamRead::qual |
( |
size_t |
i | ) |
const |
void theplu::yat::omic::BamRead::qual |
( |
size_t |
i, |
|
|
uint8_t |
q |
|
) |
| |
set quality of a base
- Parameters
-
i | base to modify |
q | new quality |
- Since
- New in yat 0.11
std::string theplu::yat::omic::BamRead::sequence |
( |
void |
| ) |
const |
Each character in returned sequence is either A, C, G, T, or N.
- Returns
- sequence
uint8_t theplu::yat::omic::BamRead::sequence |
( |
size_t |
index | ) |
const |
4-bit integer describing base index
- See Also
- bam_nt16_rev_table
void theplu::yat::omic::BamRead::sequence |
( |
size_t |
i, |
|
|
uint8_t |
x |
|
) |
| |
modify a base in sequence
Set i-th base in sequence to x, where seq is a 4-bit integer.
- See Also
- bam_nt16_table
- Since
- New in yat 0.11
void theplu::yat::omic::BamRead::sequence |
( |
const std::string & |
seq, |
|
|
const std::vector< uint8_t > & |
qual |
|
) |
| |
set sequence and quality
- Since
- New in yat 0.11
uint32_t theplu::yat::omic::BamRead::sequence_length |
( |
void |
| ) |
const |
char theplu::yat::omic::BamRead::sequence_str |
( |
size_t |
index | ) |
const |
- Returns
- A, C, G, T, or N.
- Since
- New in yat 0.13
void theplu::yat::omic::BamRead::swap |
( |
BamRead & |
other | ) |
|
uint32_t left_soft_clipped |
( |
const BamRead & |
bam | ) |
|
|
related |
If read is soft clipped on left side, return how many bases are clipped, otherwise return 0.
- Since
- New in yat 0.10
return true
if lhs query name is less than rhs query name
- See Also
- BamRead::name()
- Since
- New in yat 0.13
uint32_t right_soft_clipped |
( |
const BamRead & |
bam | ) |
|
|
related |
If read is soft clipped on right side, return how many bases are clipped, otherwise return 0.
- Since
- New in yat 0.10
return true
if query names are equal
- See Also
- BamRead::name()
- Since
- New in yat 0.10
bool soft_clipped |
( |
const BamRead & |
bam | ) |
|
|
related |
- Returns
true
if read is soft clipped, either left_soft_clipped or right_soft_clipped.
- Since
- New in yat 0.10
Swap specialization for BamRead that is faster than generic std::swap as it just swap a pair of pointers.
- Since
- New in yat 0.10
The documentation for this class was generated from the following file: