Class for a single variant.
More...
#include <ppvcf.hpp>
|
string | seq_name |
| Chromosome.
|
|
int | pos |
| Position (0-based)
|
|
string | idx |
| Identifier.
|
|
string | ref |
| Reference base(s)
|
|
vector< string > | alts |
| Alternate base(s)
|
|
string | quality |
| Phred-scaled quality score.
|
|
string | filter |
| Filter status.
|
|
map< string, string > | info |
| Additional information.
|
|
uint32_t | nsamples |
| Total number of samples.
|
|
uint32_t | gti |
| Genotype counter represeting how many GTs have been stored.
|
|
vector< GT > | genotypes |
| Genotype fields.
|
|
Class for a single variant.
Single line extracted from a VCF file.
◆ Variant()
Variant::Variant |
( |
const uint32_t |
_nsamples | ) |
|
|
inline |
Constructor
- Parameters
-
_nsamples | is the number of samples |
◆ ~Variant()
◆ add_genotype()
void Variant::add_genotype |
( |
const uint8_t |
a1, |
|
|
const uint8_t |
a2, |
|
|
const bool |
phased |
|
) |
| |
|
inline |
Store a single genotype information.
- Parameters
-
a1 | is the first allele |
a2 | is the second allele |
phased | is true if the genotype is phased, false otherwise |
◆ get_alt()
string Variant::get_alt |
( |
const int |
i | ) |
const |
|
inline |
- Returns
- the i-th (1-based) alternate allele
◆ get_alts()
vector<string> Variant::get_alts |
( |
| ) |
const |
|
inline |
- Returns
- the alternate alleles
◆ get_idx()
string Variant::get_idx |
( |
| ) |
const |
|
inline |
- Returns
- the variant identifier
◆ get_info()
string Variant::get_info |
( |
const string & |
k | ) |
const |
|
inline |
Extract the information value associated to a key.
- Parameters
-
- Returns
- the value associated to key k
◆ get_pos()
int Variant::get_pos |
( |
| ) |
const |
|
inline |
- Returns
- the (0-based) position of the variant
◆ get_quality()
string Variant::get_quality |
( |
| ) |
const |
|
inline |
- Returns
- the variant quality
◆ get_ref()
string Variant::get_ref |
( |
| ) |
const |
|
inline |
- Returns
- the reference allele
◆ get_seqname()
string Variant::get_seqname |
( |
| ) |
const |
|
inline |
- Returns
- the chromosome of the variant
◆ store_filter()
void Variant::store_filter |
( |
bcf_hdr_t * |
header, |
|
|
bcf1_t * |
record |
|
) |
| |
|
inlineprivate |
Extract the filter field from record and store it as a string.
- Parameters
-
header | is the htslib header |
record | is a htslib record |
◆ store_info()
void Variant::store_info |
( |
bcf_hdr_t * |
header, |
|
|
bcf1_t * |
record |
|
) |
| |
|
inlineprivate |
Extract the additional information from record and store them as a map<string, string>.
- Parameters
-
header | is the htslib header |
record | is a htslib record |
◆ update_till_info()
void Variant::update_till_info |
( |
bcf_hdr_t * |
header, |
|
|
bcf1_t * |
record |
|
) |
| |
|
inline |
Extract and store the first 8 fields of record.
- Parameters
-
header | is the htslib header |
record | is a htslib record |
The documentation for this class was generated from the following file: