-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCVariant.h
executable file
·83 lines (67 loc) · 2.25 KB
/
CVariant.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
/*
* CVariant.h
*
* Created on: 2011-01-28
* Author: Alexandre Dionne-Laporte
*/
#ifndef CVARIANT_H_
#define CVARIANT_H_
class CChromosome;
class CGene;
class CSample;
class CVariantInSample;
#include <string>
#include <iostream>
#include <vector>
#include <map>
#include <iostream>
#include <boost/thread/mutex.hpp>
#include "CGene.h"
#include "CVariantInSample.h"
using namespace std;
class CVariant {
private:
boost::mutex mtx_;
protected:
vector <CVariantInSample*> * _variantsInSamples;
string _variant_caller;
string _ref_allele; //ref_allele
string _novel_allele; //muta
CChromosome* _chromosome; //chr
int _position; //pos
VariantType _type; //type
string _filter; //Validity Tranches
map<string, string >* _infos; //Parsed INFO fields
CGene * _gene; //The gene
public:
//CONSTRUCTORS / DESCTRUCTORS
CVariant (
CChromosome* chromosome,
int position,
string ref_allele,
string novel_allele,
VariantType type,
string filter
);
~CVariant();
//GETTERS
inline const vector <CVariantInSample*> * getVariantInSamples () const { return _variantsInSamples; }
inline const CChromosome *getChromosome() const { return _chromosome; }
inline const int getPosition() const { return _position; }
inline const string getRef_allele() const { return _ref_allele; }
inline const string getNovel_allele() const { return _novel_allele; }
inline VariantType getType() const { return _type; }
inline const string getFilter() const { return _filter; }
inline const string getInfo (string key) const { return (*_infos)[key]; }
// inline const map<string, string >* getInfos() const { return _infos; }
inline const bool isSNP () const { return _ref_allele.length() == 1 && _novel_allele.length() == 1; }
inline const CGene *getGene() const { return _gene; }
//SETTERS
void addVariantInSample (CVariantInSample* variantInSample);
inline void setInfo ( string key, string value) { (*_infos)[key] = value; }
inline void setGene ( CGene* gene ) { _gene = gene; }
//Other functions implemented in cpp file
const int getNumberOfProbandsWithAltVariant();
friend std::ostream & operator << (std::ostream &, const CVariant &);
};
#endif /* CVARIANT_H_ */