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

#include <yat/omic/BamFile.h>

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

Classes

class  error
 Error thrown from OutBamFile::write(const BamRead&) at failure. More...
 

Public Member Functions

 OutBamFile (void)
 
 OutBamFile (const std::string &, const BamHeader &header)
 Create an output bam file. More...
 
 OutBamFile (const std::string &, const BamHeader &header, unsigned int compression)
 Create an output bam file. More...
 
void open (const std::string &fn, const BamHeader &hdr)
 Open an output bam file. More...
 
void open (const std::string &fn, const BamHeader &hdr, unsigned int compression)
 Open an output bam file. More...
 
void write (const BamRead &read)
 write a read to output file 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 writing to a bam file.

Since
New in yat 0.10

Member Typedef Documentation

typedef samfile_t theplu::yat::omic::BamFile< OutBamFile >::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::OutBamFile::OutBamFile ( void  )

Create an output bam file

theplu::yat::omic::OutBamFile::OutBamFile ( const std::string &  ,
const BamHeader header 
)

Create an output bam file.

Equivalent to default constructor followed by a call to open(2).

See Also
open(const std::string&, const BamHeader&)
theplu::yat::omic::OutBamFile::OutBamFile ( const std::string &  ,
const BamHeader header,
unsigned int  compression 
)

Create an output bam file.

Equivalent to default constructor followed by a call to open(3).

See Also
open(const std::string&, const BamHeader&, unsigned int)
Since
yat 0.12

Member Function Documentation

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

filename of bam file

The filename is set in open_base().

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

Open an output bam file.

Opens an output bam file and writes the header contained in hdr. If fn is "-", stdout is used.

Parameters
fnstring specifying the filename
hdrheader
void theplu::yat::omic::OutBamFile::open ( const std::string &  fn,
const BamHeader hdr,
unsigned int  compression 
)

Open an output bam file.

Opens an output bam file and writes the header contained in hdr. If fn is "-", stdout is used.

Parameters
fnstring specifying the filename
hdrheader
compressiona number [0,9] indicating level of compression. 9 gives highest compression and 0 indicates no compression (suitable for piping between applications).
Since
yat 0.12
void theplu::yat::omic::BamFile< OutBamFile >::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
void theplu::yat::omic::OutBamFile::write ( const BamRead read)

write a read to output file

Exceptions
OutBamFile::errorif write failed
Since
yat 0.12

Member Data Documentation

samFile* theplu::yat::omic::BamFile< OutBamFile >::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