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

#include <yat/omic/VcfFile.h>

Inheritance diagram for theplu::yat::omic::VcfFile:

Public Member Functions

 VcfFile (void)
 default constructor
 
 VcfFile (const std::string &fn)
 
void close (void)
 close file
 
bool good (void) const
 
bool is_open (void) const
 
void open (const std::string &fn)
 open file named fn More...
 
bool read (VCF &vcf)
 
VcfHeaderheader (void)
 
const VcfHeaderheader (void) const
 

Friends

class VcfIterator
 

Detailed Description

Since
New in yat 0.16

Constructor & Destructor Documentation

◆ VcfFile()

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

Opens file named fn.

See also
open

Member Function Documentation

◆ good()

bool theplu::yat::omic::VcfFile::good ( void  ) const

A file is good when it's open and until reading an entry failed.

Returns
true if file is still good

◆ header() [1/2]

VcfHeader& theplu::yat::omic::VcfFile::header ( void  )
Returns
reference to header

Note that modifying the referenced object does not modify the underlying file.

Note
If file is not open, behaviour is undefined.

◆ header() [2/2]

const VcfHeader& theplu::yat::omic::VcfFile::header ( void  ) const
Returns
reference to header
Note
If file is not open, behaviour is undefined.

◆ is_open()

bool theplu::yat::omic::VcfFile::is_open ( void  ) const
Returns
true if file is open

◆ open()

void theplu::yat::omic::VcfFile::open ( const std::string &  fn)

open file named fn

Open file fn, unless fn is "-", in which case stdin is used. The function tries to detect whether file is compressed (gzipped) or not by looking at the first byte which is 0x1f for gzipped files.

Function opens a VcfHeader and if the first bit does not conform with the format of a VCF header, an excpetion is thrown.

Note
If file already is open behaviour is undefined.

◆ read()

bool theplu::yat::omic::VcfFile::read ( VCF vcf)

Read one VCF entry from file and assign to vcf. If there is no more entry to read, the state of the file is switched to bad and false is returned.

Returns
true if successful

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

Generated on Tue Sep 7 2021 17:32:33 for yat by  doxygen 1.8.14