forked from abyzovlab/CNVnator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VcfParser.hh
70 lines (59 loc) · 1.49 KB
/
VcfParser.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef __VCFPARSER__
#define __VCFPARSER__
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include "vcf.h"
#include "vcfutils.h"
using namespace std;
class VcfParser {
private:
htsFile *f;
bcf_hdr_t *h;
bcf1_t *rec;
bool stdin;
int nsamples;
string *cnames_;
int *clens_;
int n_chr_;
int cmax;
int nrec;
istream *in;
string c_chr;
int c_pos;
string c_id;
string c_ref;
string c_alt;
double c_qual;
string c_filter;
string c_info;
string c_format;
string c_rec;
string c_gt;
int c_nref;
int c_nalt;
void parseHeader();
public:
inline string getChromosome() {return c_chr;}
int getChromosomeIndex();
inline int getPosition() {return c_pos;}
inline string getId() {return c_id;}
inline string getRef() {return c_ref;}
inline string getAlt() {return c_alt;}
inline int getNRef() {return c_nref;}
inline int getNAlt() {return c_nalt;}
inline double getQual() {return c_qual;}
inline string getFilter() {return c_filter;}
inline string getInfo() {return c_info;}
inline string getFormat() {return c_format;}
inline string getRecord() {return c_rec;}
inline string getGT() {return c_gt;}
int numChrom() { return n_chr_; }
string chromName(int i) { return (i >= 0 && i < n_chr_) ? cnames_[i] : ""; }
int chromLen(int i) { return (i >= 0 && i < n_chr_) ? clens_[i] : 0; }
VcfParser(string fileName);
~VcfParser();
bool parseRecord(bool idvar=false);
};
#endif