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

class holiding data stored in FORMAT and data fields More...

#include <yat/omic/VCF.h>

Public Member Functions

 Data (void)
 Default constructor.
 
 Data (size_t n)
 
template<typename T >
void add (const std::string &key, const std::vector< T > &data)
 T is string, numeric or vector string or numeric.
 
void clear (void)
 
size_t count (const std::string &key) const
 
const std::vector< std::string > & format (void) const
 
template<typename T >
void get (const std::string &key, std::vector< T > &data) const
 T is string, numeric or vector string or numeric.
 
size_t n_samples (void) const
 
template<typename T >
void set (const std::string &key, const std::vector< T > &data)
 
void subset (const std::vector< size_t > &index)
 

Friends

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

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &os, const VCF::Data &data)
 output operator for VCF::Data More...
 

Detailed Description

class holiding data stored in FORMAT and data fields

Constructor & Destructor Documentation

◆ Data()

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

Create Data representing n samples

Since
New in yat 0.20

Member Function Documentation

◆ clear()

void theplu::yat::omic::VCF::Data::clear ( void  )

Set FORMAT and all data fields to empty string. Number of samples remains unmodified.

◆ count()

size_t theplu::yat::omic::VCF::Data::count ( const std::string &  key) const
Returns
1 if key exists

◆ format()

const std::vector<std::string>& theplu::yat::omic::VCF::Data::format ( void  ) const

FORMAT

Returns
vector of format in the data fields

◆ n_samples()

size_t theplu::yat::omic::VCF::Data::n_samples ( void  ) const
Returns
number of samples
Since
New in yat 0.20

◆ set()

template<typename T >
void theplu::yat::omic::VCF::Data::set ( const std::string &  key,
const std::vector< T > &  data 
)

T is string, numeric or vector string or numeric

If key exists in FORMAT, replace data with data. Otherwise add data with key; see data(key, data).

Since
New in yat 0.20

◆ subset()

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

Construct Data representing a subset of samples. The object will have index.size() samples; if index[0] is k, the first sample correspond to the (k+1)th sample in the old object.

Since
New in yat 0.20

Friends And Related Function Documentation

◆ operator<<()

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

output operator for VCF::Data

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