yat  0.11.3pre
Public Member Functions | Friends | List of all members
theplu::yat::omic::BamHeader Class Reference

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 &reg, 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
 

Detailed Description

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.

Since
New in yat 0.10

Member Function Documentation

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.

See Also
bam_parse_region
Exceptions
utility::runtime_erroron failure
Since
new in yat 0.11
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)

Note
If name does not exist, behaviour is undefined.
Since
new in yat 0.11

The documentation for this class was generated from the following file:

Generated on Sat May 24 2014 03:33:05 for yat by  doxygen 1.8.2