#include <yat/omic/VcfHeader.h>
|
| VcfHeader (const std::string &version) |
| Constructor. More...
|
|
| VcfHeader (std::istream &is) |
|
void | add (const std::string &key, const std::string &value) |
|
void | add (const std::string &key, const std::string &ID, int number, const std::string &type, const std::string &description) |
|
void | add_info (const std::string &ID, const std::string &number, const std::string &type, const std::string &description) |
|
void | add_format (const std::string &ID, const std::string &number, const std::string &type, const std::string &description) |
|
void | add_program_command (int argc, char *argv[]) |
|
void | add_program_version (const std::string &prog, const std::string &version) |
|
const std::string & | header (void) const |
|
void | header (const std::string &header) |
|
const std::string & | line (size_t i) const |
|
std::string | key (size_t line) const |
|
void | nicify (void) |
|
std::string | value (size_t line) const |
|
std::string | value (size_t line, const std::string &key) const |
|
size_t | size (void) const |
|
const std::vector< std::string > & | samples (void) const |
|
void | samples (const std::vector< std::string > &s) |
|
|
std::ostream & | operator<< (std::ostream &os, const VcfHeader &b) |
|
theplu::yat::omic::VcfHeader::VcfHeader |
( |
const std::string & |
version | ) |
|
Constructor.
Creates an empty header
theplu::yat::omic::VcfHeader::VcfHeader |
( |
std::istream & |
is | ) |
|
Consumes lines until a line does not start with '#' and constructs a VcfHeader.
void theplu::yat::omic::VcfHeader::add |
( |
const std::string & |
key, |
|
|
const std::string & |
value |
|
) |
| |
Adds a line ##key = value
void theplu::yat::omic::VcfHeader::add |
( |
const std::string & |
key, |
|
|
const std::string & |
ID, |
|
|
int |
number, |
|
|
const std::string & |
type, |
|
|
const std::string & |
description |
|
) |
| |
Add a line
key=<ID,Number=number,Type=type,Description=description>
If number is 0, it's replaced with ".".
void theplu::yat::omic::VcfHeader::add_format |
( |
const std::string & |
ID, |
|
|
const std::string & |
number, |
|
|
const std::string & |
type, |
|
|
const std::string & |
description |
|
) |
| |
Same as add("FORMAT", ID, number, type, description)
void theplu::yat::omic::VcfHeader::add_info |
( |
const std::string & |
ID, |
|
|
const std::string & |
number, |
|
|
const std::string & |
type, |
|
|
const std::string & |
description |
|
) |
| |
Same as add("INFO", ID, number, type, description)
number should be integer or special character as A: one per alt allele R: one per allele G: one per genotype .: unknown
void theplu::yat::omic::VcfHeader::add_program_command |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
add a line with something like:
bcftools_viewCommand=view -l 9 -O z -; Date=Wed Apr 19 10:49:09 2017
void theplu::yat::omic::VcfHeader::add_program_version |
( |
const std::string & |
prog, |
|
|
const std::string & |
version |
|
) |
| |
add a line with something like
bcftools_normVersion=1.4+htslib-1.4
const std::string& theplu::yat::omic::VcfHeader::header |
( |
void |
| ) |
const |
- Returns
- the last line of the header
void theplu::yat::omic::VcfHeader::header |
( |
const std::string & |
header | ) |
|
Set the last line of the header
std::string theplu::yat::omic::VcfHeader::key |
( |
size_t |
line | ) |
const |
- Returns
- everything between prefix '##' and first '=' of line line
const std::string& theplu::yat::omic::VcfHeader::line |
( |
size_t |
i | ) |
const |
void theplu::yat::omic::VcfHeader::nicify |
( |
void |
| ) |
|
const std::vector<std::string>& theplu::yat::omic::VcfHeader::samples |
( |
void |
| ) |
const |
Sample names occur tab-delimited in the last line starting from 10th column.
- Returns
- samples name
void theplu::yat::omic::VcfHeader::samples |
( |
const std::vector< std::string > & |
s | ) |
|
size_t theplu::yat::omic::VcfHeader::size |
( |
void |
| ) |
const |
std::string theplu::yat::omic::VcfHeader::value |
( |
size_t |
line | ) |
const |
everything right of first '=' on line line
std::string theplu::yat::omic::VcfHeader::value |
( |
size_t |
line, |
|
|
const std::string & |
key |
|
) |
| const |
returns "" if key is missing is false otherwise corresponding value e.g. value(i, "Description") returns value for key Description of line line
std::ostream & operator<< |
( |
std::ostream & |
, |
|
|
const VcfHeader & |
header |
|
) |
| |
|
related |
The documentation for this class was generated from the following file: