yat  0.20.3pre
Classes | Public Member Functions | Friends | Related Functions | List of all members
theplu::yat::omic::VCF Class Reference

#include <yat/omic/VCF.h>

Classes

class  Data
 class holiding data stored in FORMAT and data fields More...
 
class  Info
 class handling the INFO field in an VCF entry More...
 

Public Member Functions

 VCF (void)
 default constructor
 
 VCF (size_t n)
 
 VCF (const std::string &)
 Construct entry from a std::string.
 
 VCF (std::istream &is)
 
void chromosome (const std::string &chr)
 set chromosome name
 
const std::string & chromosome (void) const
 
void pos (int32_t p)
 set position
 
const int32_t & pos (void) const
 
void id (const std::string &id)
 Variant identifier. More...
 
const std::string & id (void) const
 
void ref (const std::string &r)
 set refererence sequence at position involved in variant
 
void ref (char r)
 set refererence sequence at position involved in variant
 
const std::string & ref (void) const
 
void alt (const std::string &a)
 set alternative sequence(s) More...
 
void alt (char a)
 set alternative sequence(s) More...
 
const std::string & alt (void) const
 
const std::vector< std::string > & alts (void) const
 
void alts (const std::vector< std::string > &a)
 set alternative alleles
 
void alts (std::vector< std::string > &&a)
 set alternative alleles
 
unsigned int n_alleles (void) const
 
const std::string & qual (void) const
 phred-scaled probability that all samples are wildtype
 
void qual (const std::string &q)
 set quality
 
void qual (unsigned int q)
 set quality
 
const std::string & filter (void) const
 
const std::vector< std::string > & filters (void) const
 
void add_filter (const std::string &)
 append list of filters
 
void filter (const std::string &)
 set filters
 
void subset (const std::vector< size_t > &index)
 
VCF::Infoinfo (void)
 set info
 
const VCF::Infoinfo (void) const
 
const Datadata (void) const
 access data
 
Datadata (void)
 access data
 
unsigned int n_samples (void) const
 
void n_samples (int n)
 set number of samples to n
 

Friends

std::ostream & operator<< (std::ostream &, const VCF &)
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &os, const VCF &vcf)
 output operator for VCF More...
 
std::istream & operator>> (std::istream &is, VCF &vcf)
 input operator for VCF More...
 

Detailed Description

Class to parse and modify an entry in a VcfFile (Variant Call Format) as defined in https://samtools.github.io/hts-specs/VCFv4.2.pdf

Since
new in yat 0.16

Constructor & Destructor Documentation

◆ VCF() [1/2]

theplu::yat::omic::VCF::VCF ( size_t  n)
explicit

Create a VCF representing n samples.

Since
New in yat 0.20

◆ VCF() [2/2]

theplu::yat::omic::VCF::VCF ( std::istream &  is)
explicit

Equivalent with

std::string line;
std::getline(is, line);
VCF(line);

Member Function Documentation

◆ alt() [1/3]

void theplu::yat::omic::VCF::alt ( const std::string &  a)

set alternative sequence(s)

Parameters
ais a comma-delimited list of sequences

◆ alt() [2/3]

void theplu::yat::omic::VCF::alt ( char  a)

set alternative sequence(s)

Parameters
ais a comma-delimited list of sequences

◆ alt() [3/3]

const std::string& theplu::yat::omic::VCF::alt ( void  ) const
Returns
alternative sequence(s)

◆ alts()

const std::vector<std::string>& theplu::yat::omic::VCF::alts ( void  ) const
Returns
alternative sequences

◆ chromosome()

const std::string& theplu::yat::omic::VCF::chromosome ( void  ) const
Returns
Chromosome name

◆ filter()

const std::string& theplu::yat::omic::VCF::filter ( void  ) const
Returns
semicolon delimited list of filters that the variant fails

◆ filters()

const std::vector<std::string>& theplu::yat::omic::VCF::filters ( void  ) const
Returns
filters

◆ id() [1/2]

void theplu::yat::omic::VCF::id ( const std::string &  id)

Variant identifier.

Usually the dbSNP rsID

◆ id() [2/2]

const std::string& theplu::yat::omic::VCF::id ( void  ) const
Returns
Variant identifier

◆ info()

const VCF::Info& theplu::yat::omic::VCF::info ( void  ) const
Returns
container holiding information in INFO field (column 8)

◆ n_alleles()

unsigned int theplu::yat::omic::VCF::n_alleles ( void  ) const
Returns
number of alternative sequences

◆ n_samples()

unsigned int theplu::yat::omic::VCF::n_samples ( void  ) const
Returns
number of samples

◆ pos()

const int32_t& theplu::yat::omic::VCF::pos ( void  ) const
Returns
position

◆ ref()

const std::string& theplu::yat::omic::VCF::ref ( void  ) const
Returns
reference sequence at position

◆ subset()

void theplu::yat::omic::VCF::subset ( const std::vector< size_t > &  index)

Create a VCF with subset of samples in other defined by index.

If present, INFO fields AC and AN are recalculated to match the subset.

See also
VCF::Data.subset(const std::vector<size_t>&)
Since
New in yat 0.20

Friends And Related Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const VCF vcf 
)
related

output operator for VCF

Returns
stream

◆ operator>>()

std::istream & operator>> ( std::istream &  is,
VCF vcf 
)
related

input operator for VCF

If is is good and next character is not EOF, a VCF is read into vcf as if it was created with the istream constructor.

Returns
stream

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

Generated on Sat Feb 18 2023 03:31:45 for yat by  doxygen 1.8.14