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
◆ BamRead() [1/2]
theplu::yat::omic::BamRead::BamRead |
( |
void |
| ) |
|
default constructor
Constructed object contains no data and most operations are not defined
◆ BamRead() [2/2]
theplu::yat::omic::BamRead::BamRead |
( |
BamRead && |
other | ) |
|
|
noexcept |
move constructor
- Since
- new in yat 0.15
◆ aux() [1/2]
const uint8_t* theplu::yat::omic::BamRead::aux |
( |
void |
| ) |
const |
- Returns
- pointer to auxiliary data
- See also
- aux_size(void)
◆ aux() [2/2]
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
◆ aux_append()
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
◆ aux_del()
void theplu::yat::omic::BamRead::aux_del |
( |
const char |
tag[2] | ) |
|
remove a tag in aux field
- Exceptions
-
- Since
- New in yat 0.11
◆ aux_size()
int theplu::yat::omic::BamRead::aux_size |
( |
void |
| ) |
const |
- Returns
- length of aux field
- Since
- New in yat 0.11
◆ cigar() [1/4]
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.
◆ cigar() [2/4]
uint32_t theplu::yat::omic::BamRead::cigar |
( |
size_t |
i | ) |
const |
- Returns
- i th element of CIGAR array
◆ cigar() [3/4]
void theplu::yat::omic::BamRead::cigar |
( |
const std::vector< uint32_t > & |
c | ) |
|
◆ cigar() [4/4]
set CIGAR
- Parameters
-
- Since
- new in yat 0.12
◆ cigar_op()
uint32_t theplu::yat::omic::BamRead::cigar_op |
( |
size_t |
i | ) |
const |
- Returns
- i th CIGAR operation
◆ cigar_oplen()
uint32_t theplu::yat::omic::BamRead::cigar_oplen |
( |
size_t |
i | ) |
const |
- Returns
- length of i th CIGAR element
◆ cigar_str()
std::string theplu::yat::omic::BamRead::cigar_str |
( |
void |
| ) |
const |
Translate CIGAR array to a string such as '72M3S'
◆ core() [1/2]
const bam1_core_t& theplu::yat::omic::BamRead::core |
( |
void |
| ) |
const |
access core data struct
- See also
- samtools C api documentaion
◆ core() [2/2]
bam1_core_t& theplu::yat::omic::BamRead::core |
( |
void |
| ) |
|
access core data struct
- See also
- samtools C api documentaion
◆ end()
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
◆ flag()
uint16_t theplu::yat::omic::BamRead::flag |
( |
void |
| ) |
const |
bitwise flag
- See also
- Preprocessor defines BAM_F*
- Since
- implemented since yat 0.12
◆ flag_bit_is_set()
bool theplu::yat::omic::BamRead::flag_bit_is_set |
( |
uint16_t |
x | ) |
const |
- Returns
true
if each bit set in x is also set in flag()
- Since
- new in yat 0.16
◆ flip_flag_bit()
void theplu::yat::omic::BamRead::flip_flag_bit |
( |
uint16_t |
x | ) |
|
For each bit set in x, flip bit in flag.
flag ^= x
- Since
- new in yat 0.16
◆ get_flag_bit()
uint16_t theplu::yat::omic::BamRead::get_flag_bit |
( |
uint16_t |
x | ) |
const |
- Returns
- bits set in both x and flag()
- Since
- new in yat 0.16
◆ mstrand()
bool theplu::yat::omic::BamRead::mstrand |
( |
void |
| ) |
const |
- Returns
true
if mate is mapped to to positive strand, i.e., BAM_FMREVERSE
is not set.
- Since
- new in yat 0.16
◆ name() [1/2]
const char* theplu::yat::omic::BamRead::name |
( |
void |
| ) |
const |
- Returns
- query name
Length of array is described by core().l_qname
◆ name() [2/2]
void theplu::yat::omic::BamRead::name |
( |
const std::string & |
n | ) |
|
modify name
- Since
- New in yat 0.11
◆ operator=()
move assignment operator
- Since
- new in yat 0.15
◆ qual() [1/2]
uint8_t theplu::yat::omic::BamRead::qual |
( |
size_t |
i | ) |
const |
◆ qual() [2/2]
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
◆ sequence() [1/4]
std::string theplu::yat::omic::BamRead::sequence |
( |
void |
| ) |
const |
Each character in returned sequence is either A, C, G, T, or N.
- Returns
- sequence
◆ sequence() [2/4]
uint8_t theplu::yat::omic::BamRead::sequence |
( |
size_t |
index | ) |
const |
4-bit integer describing base index
- See also
- nt16_str
◆ sequence() [3/4]
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
- nt16_table(char)
- Since
- New in yat 0.11
◆ sequence() [4/4]
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
◆ sequence_length()
uint32_t theplu::yat::omic::BamRead::sequence_length |
( |
void |
| ) |
const |
◆ sequence_str()
char theplu::yat::omic::BamRead::sequence_str |
( |
size_t |
index | ) |
const |
- Returns
- A, C, G, T, or N.
- Since
- New in yat 0.13
◆ set_flag_bit()
void theplu::yat::omic::BamRead::set_flag_bit |
( |
uint16_t |
x | ) |
|
For each bit set in x, set bit in flag.
flag |= x
- Since
- new in yat 0.16
◆ strand()
bool theplu::yat::omic::BamRead::strand |
( |
void |
| ) |
const |
- Returns
true
if mapped to to positive strand, i.e., BAM_FREVERSE
is not set.
- Since
- new in yat 0.16
◆ swap()
void theplu::yat::omic::BamRead::swap |
( |
BamRead & |
other | ) |
|
◆ unset_flag_bit()
void theplu::yat::omic::BamRead::unset_flag_bit |
( |
uint16_t |
x | ) |
|
For each bit set in x, unset bit in flag.
flag &= ~x
- Since
- new in yat 0.16
◆ left_soft_clipped()
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
◆ less_query_name()
return true
if lhs query name is less than rhs query name
- See also
- BamRead::name()
- Since
- New in yat 0.13
◆ right_soft_clipped()
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
◆ same_query_name()
return true
if query names are equal
- See also
- BamRead::name()
- Since
- New in yat 0.10
◆ soft_clipped()
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()
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: