-
Notifications
You must be signed in to change notification settings - Fork 2
/
CoreVCF.h
104 lines (86 loc) · 2.31 KB
/
CoreVCF.h
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
* CoreVCF
* Date: Sep-30-2013
* Author : Gabriel Renaud gabriel.reno [at sign here] gmail.com
*
*/
#ifndef CoreVCF_h
#define CoreVCF_h
#include <iostream>
#include <string>
#include <string.h>
#include <vector>
#include <map>
#include "libgab.h"
using namespace std;
class CoreVCF{
private:
bool closeIndel;
unsigned int position;
string chrName;
string id;
string ref;
string alt;
vector<string> altAlleles;
bool allAltResolvedSingleBasePair;
bool isIndel;
bool resolvedSingleBasePairREF;
bool resolvedSingleBasePairALT;
float qual;
string filter;
vector<string> fields;
string infoFieldRaw;
map<string, string> * infoField;
bool haveInfoField;
int fieldIndex;
int fieldIndexINFO;
bool haveFormatNames;
string rawFormatNames;
vector<string> * formatNames;
template <typename T>
T getInfoField(string tag) {
if(!haveInfoField){ parseInfoFields(); }
map<string,string>::const_iterator it=infoField->find(tag);
if(it == infoField->end()){
return T();
}else{
return destringify<T>(it->second);
}
}
void parseInfoFields();
bool hasInfoField(string tag) ;
int getDepthInfo() ;
string getRef() const;
string getAlt() const;
string getID() const;
string getChr() const;
unsigned int getPosition() const;
string getFilter() const;
string getInfoFieldRaw() const;
float getQual() const;
void setCloseIndel(bool closeIndel);
bool getCloseIndel() const;
bool containsIndel() const;
bool isResolvedSingleBasePairREF() const;
bool isResolvedSingleBasePairALT() const;
int getFieldIndexAndIncrease();
int getFieldIndexINFO();
public:
CoreVCF();
CoreVCF(const vector<string> & fields);
CoreVCF(const CoreVCF & other);
~CoreVCF();
CoreVCF & operator= (const CoreVCF & other);
void setName( const char * p);
void setPos( const char * p);
void setID( const char * p);
void setREF( const char * p);
void setALT( const char * p);
void setQUAL( const char * p);
void setFILTER(const char * p);
void setINFO( const char * p);
void setFORMAT(const char * p);
const vector<string> * getFormatNames();
friend class SimpleVCF;
};
#endif