yat  0.13.2pre
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
theplu::yat::omic::InBamFile Class Reference

#include <yat/omic/BamFile.h>

Inheritance diagram for theplu::yat::omic::InBamFile:
theplu::yat::omic::BamFile< InBamFile >

Public Types

typedef bam_index_t index_type
 

Public Member Functions

 InBamFile (void)
 Default constructor.
 
 InBamFile (const std::string &fn)
 
virtual ~InBamFile (void)
 destructor
 
const BamHeaderheader (void) const
 
const index_typeindex (void) const
 
void open (const std::string &fn)
 Open an input bam file. More...
 
bool read (BamRead &read)
 read the next BamRead More...
 
bool read (BamRead &read, bam_iter_t iter)
 read the next BamRead More...
 
void close (void)
 close file
 
bool is_open (void) const
 

Protected Types

typedef samfile_t samFile
 only defined when compiling against old bamlib More...
 

Protected Member Functions

void open_base (const std::string &fn, const std::string &mode, const void *aux)
 
const std::string & filename (void) const
 filename of bam file More...
 

Protected Attributes

samFilesf_
 

Detailed Description

This class supports reading from a bam file.

Since
New in yat 0.10

Member Typedef Documentation

Struct describing bam index.

If compiled against htslib, hts_idx_t. If compiled against libbam, bam_index_t.

Since
New in yat 0.13
See Also
function index(void) const
typedef samfile_t theplu::yat::omic::BamFile< InBamFile >::samFile
protectedinherited

only defined when compiling against old bamlib

Old samtools 0.1.xx had a struct samfile_t, which in htslib has changed to samFile

Constructor & Destructor Documentation

theplu::yat::omic::InBamFile::InBamFile ( const std::string &  fn)
explicit

Create an input file

Parameters
fnstring specifying the filename
See Also
open(const std::string&)

Member Function Documentation

const std::string& theplu::yat::omic::BamFile< InBamFile >::filename ( void  ) const
inlineprotectedinherited

filename of bam file

The filename is set in open_base().

const BamHeader& theplu::yat::omic::InBamFile::header ( void  ) const
Returns
header
const index_type* theplu::yat::omic::InBamFile::index ( void  ) const
Returns
index associated with BamFile

First time this function is called an index file is loaded from disk. If bam file is named 'foo.bam', the index file should be named 'foo.bam.bai'. If no such file exists or this bam file reads from stdin, this function throws.

bool theplu::yat::omic::BamFile< InBamFile >::is_open ( void  ) const
inherited
Returns
true iff open
void theplu::yat::omic::InBamFile::open ( const std::string &  fn)

Open an input bam file.

Open a bam file named fn. If fn is "-", stdin is used.

Parameters
fnstring specifying the filename
void theplu::yat::omic::BamFile< InBamFile >::open_base ( const std::string &  fn,
const std::string &  mode,
const void *  aux 
)
protectedinherited

open a bam file named fn with mode mode

See Also
samopen
Note
aux is ignored when compiling against htslib
bool theplu::yat::omic::InBamFile::read ( BamRead read)

read the next BamRead

Returns
true on success
bool theplu::yat::omic::InBamFile::read ( BamRead read,
bam_iter_t  iter 
)

read the next BamRead

This function is used in BamReadIterator. Typically it is more convenient to read bams via a BamReadIterator than through this function directly.

Returns
true on success

Member Data Documentation

samFile* theplu::yat::omic::BamFile< InBamFile >::sf_
protectedinherited

bam file handler


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

Generated on Wed Jan 4 2017 02:23:07 for yat by  doxygen 1.8.5