yat
0.11.3pre
|
Wrapper around bam_header_t struct. More...
#include <yat/omic/BamHeader.h>
Public Member Functions | |
BamHeader (void) | |
Default constructor. | |
void | parse_region (const std::string ®, int &tid, int &begin, int &end) const |
const char * | target_name (size_t tid) const |
uint32_t | target_length (size_t tid) const |
int32_t | tid (const std::string &name) const |
inverse of target_name(size_t) | |
int32_t | n_targets (void) const |
Friends | |
class | InBamFile |
class | OutBamFile |
Wrapper around bam_header_t struct.
Class is typically created via InBamFile::header().
It is possible to copy and assign a BamHeader, but note that a BamHeader does not own underlying data. The underlying data is owned by the InBamFile and the BamHeader is thus invalid after the corresponding InBamFile has been destroyed.
int32_t theplu::yat::omic::BamHeader::n_targets | ( | void | ) | const |
Number of chromosomes
void theplu::yat::omic::BamHeader::parse_region | ( | const std::string & | reg, |
int & | tid, | ||
int & | begin, | ||
int & | end | ||
) | const |
Parse a region in the format: 'chr2:100,000-200,000 and return values in variables tid, begin and end. reg is 1-based and begin and end are 0-based, i.e., "chr2:100,000-200,000" will set begin = 99999 and end = 200000.
utility::runtime_error | on failure |
uint32_t theplu::yat::omic::BamHeader::target_length | ( | size_t | tid | ) | const |
Length of chromosome with ID tid
const char* theplu::yat::omic::BamHeader::target_name | ( | size_t | tid | ) | const |
Name of chromosome with ID tid
int32_t theplu::yat::omic::BamHeader::tid | ( | const std::string & | name | ) | const |
inverse of target_name(size_t)