-
Notifications
You must be signed in to change notification settings - Fork 0
/
vcf.h
101 lines (82 loc) · 2.16 KB
/
vcf.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
// ******************************************************
// vcfCTools (c) 2011 Alistair Ward
// Marth Lab, Department of Biology, Boston College
// All rights reserved.
// ------------------------------------------------------
// Last modified: 18 February 2011
// ------------------------------------------------------
// Define the vcf class with all associated operations.
// ******************************************************
#ifndef VCF_H
#define VCF_H
#include "split.h"
#include "vcf_aux.h"
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <fstream>
#include <string>
#include <stdlib.h>
#include <map>
using namespace std;
namespace vcfCTools {
// This structure contains a description of a particular
// variant. A map containing a structure for each variant
// is created at each variant locus. General information
// about the locus is contained in the following vInfo
// structure.
struct variantDescription {
// Variant descriptions.
string record;
string referenceSequence;
string rsid;
string ref;
string altString;
double quality;
string filters;
string info;
bool hasGenotypes;
string genotypeFormatString;
string genotypeString;
// Boolean flags describing variant class.
bool isBiallelicSnp;
bool isTriallelicSnp;
bool isQuadallelicSnp;
bool isMnp;
bool isInsertion;
bool isDeletion;
unsigned int variantClass; //DELETE
};
// Define the vcf class.
class vcf {
public:
vcf(void);
~vcf(void);
public:
// File opening and closing.
bool openVcf(string);
void closeVcf();
// Variant reading and structures.
bool getRecord();
public:
istream* input;
ifstream file;
string vcfFilename;
// Keep track of when a record is read successfully.
bool success;
bool update;
// variant information.
string record;
variantDescription variantRecord;
string referenceSequence;
vector<string> referenceSequenceVector;
map<string, bool> referenceSequences;
int position;
// Genotype information.
bool hasGenotypes;
bool processGenotypes;
vector<string> samples;
unsigned int numberSamples;
};
} // namespace vcfCTools
#endif // VCF_H