Object represents a variant record in the VCF, offering methods to access and modify fields.
More...
|
| BcfRecord () |
| empty constructor. call init() afterwards
|
|
| BcfRecord (BcfHeader &h) |
| constructor with a given BcfHeader object
|
|
void | initHeader (BcfHeader &h) |
| initilize the header associated with BcfRecord object by pointing to another BcfHeader object
|
|
void | resetHeader (BcfHeader &h) |
| reset the header associated with BcfRecord object by pointing to another BcfHeader object
|
|
std::string | asString () const |
| return current variant as raw string
|
|
template<typename T > |
isValidGT< T > | getGenotypes (T &v) |
| fill in the input vector with genotypes of 0 and 1. only works for ploidy<=2. Genotypes with missing allele is coded as heterozygous More...
|
|
bool | getGenotypes (std::vector< int > &v) |
| fill in the input vector with genotype values, 0, 1 or -9 (missing). More...
|
|
template<typename T , typename S = typename T::value_type> |
isFormatVector< T > | getFORMAT (std::string tag, T &v) |
| get tag value in FORMAT More...
|
|
bool | getFORMAT (std::string tag, std::vector< std::string > &v) |
| get tag value in FORMAT More...
|
|
template<typename T , typename S = typename T::value_type> |
isInfoVector< T > | getINFO (std::string tag, T &v) |
| get tag value in INFO More...
|
|
template<typename T > |
isScalar< T > | getINFO (std::string tag, T &v) |
| get tag value in INFO More...
|
|
template<typename T > |
isString< T > | getINFO (std::string tag, T &v) |
| get tag value in INFO More...
|
|
template<typename T > |
isScalar< T > | setINFO (std::string tag, const T &v) |
| set tag value for INFO More...
|
|
template<typename T > |
isValidInfo< T > | setINFO (std::string tag, const T &v) |
| set tag value for INFO More...
|
|
void | removeINFO (std::string tag) |
| remove the given tag from INFO of the variant
|
|
bool | setGenotypes (const std::vector< int > &v) |
| set genotypes from scratch even if genotypes not present More...
|
|
void | setPhasing (const std::vector< char > &v) |
| set phasing status for all diploid samples using given vector More...
|
|
void | removeFORMAT (std::string tag) |
| remove the given tag from FORMAT of the variant
|
|
template<typename T > |
isValidFMT< T > | setFORMAT (std::string tag, const T &v) |
| set tag values for all samples in FORMAT using given vector More...
|
|
template<typename T > |
isScalar< T > | setFORMAT (std::string tag, const T &v) |
| set tag for a single sample in FORMAT using given singular value. this works only when there is one sample in the vcf More...
|
|
void | addLineFromString (const std::string &vcfline) |
| add one variant record from given string
|
|
bool | isNoneMissing () const |
| if all samples have non missing values for the tag in FORMAT
|
|
bool | isSV () const |
| return boolean value indicates if current variant is Structual Variant or not
|
|
bool | isIndel () const |
| return boolean value indicates if current variant is exclusively INDEL
|
|
bool | isMultiAllelics () const |
| return boolean value indicates if current variant is multiallelic sites
|
|
bool | isMultiAllelicSNP () const |
| return boolean value indicates if current variant is exclusively multiallelic SNP sites
|
|
bool | isSNP () const |
| return boolean value indicates if current variant is exclusively biallelic SNP. Note ALT=* are skipped
|
|
bool | hasSNP () const |
| return boolean value indicates if current variant has SNP type defined in vcf.h (htslib>=1.16)
|
|
bool | hasINDEL () const |
| return boolean value indicates if current variant has INDEL type defined in vcf.h (htslib>=1.16)
|
|
bool | hasINS () const |
| return boolean value indicates if current variant has INS type defined in vcf.h (htslib>=1.16)
|
|
bool | hasDEL () const |
| return boolean value indicates if current variant has DEL type defined in vcf.h (htslib>=1.16)
|
|
bool | hasMNP () const |
| return boolean value indicates if current variant has MNP type defined in vcf.h (htslib>=1.16)
|
|
bool | hasBND () const |
| return boolean value indicates if current variant has BND type defined in vcf.h (htslib>=1.16)
|
|
bool | hasOTHER () const |
| return boolean value indicates if current variant has OTHER type defined in vcf.h (htslib>=1.16)
|
|
bool | hasOVERLAP () const |
| return boolean value indicates if current variant has OVERLAP type defined in vcf.h (htslib>=1.16)
|
|
std::string | CHROM () const |
| return CHROM name
|
|
std::string | ID () const |
| return ID field
|
|
int64_t | POS () const |
| return 1-base position
|
|
void | setCHR (const std::string &s) |
| modify CHROM value
|
|
void | setPOS (int64_t p) |
| modify position given 1-based value
|
|
void | setID (const std::string &s) |
| update ID
|
|
void | setRefAlt (const std::string &s) |
| set REF and ALT alleles given a string seperated by comma
|
|
void | setQUAL (float q) |
| modify the QUAL value
|
|
void | setQUAL (char q) |
| modify the QUAL value
|
|
void | setFILTER (const std::string &s) |
| modify the FILTER value
|
|
int64_t | Start () const |
| return 0-base start of the variant (can be any type)
|
|
int64_t | End () const |
| return 0-base end of the variant (can be any type)
|
|
std::string | REF () const |
| return raw REF alleles as string
|
|
void | swap_REF_ALT () |
| swap REF and ALT for biallelic SNP
|
|
std::string | ALT () const |
| return raw ALT alleles as string
|
|
float | QUAL () |
| return QUAL value
|
|
std::string | FILTER () |
| return raw FILTER column as string
|
|
std::string | allINFO () |
| return raw INFO column as string. recommend to use getINFO for specific tag.
|
|
bool | allPhased () const |
| return boolean value indicates if genotypes of all samples are phased
|
|
int | ploidy () const |
| return the number of ploidy of current variant
|
|
void | setPloidy (int v) |
| in a rare case, one may want to set the number of ploidy manually
|
|
Object represents a variant record in the VCF, offering methods to access and modify fields.
- Note
- BcfRecord has to be associated with a BcfHeader object and needs to be filled in by calling BcfReader.getNextVariant function.