-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCIsbtVariant.h
105 lines (74 loc) · 3.54 KB
/
CIsbtVariant.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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: CIsbtVariant.h
* Author: mwittig
*
* Created on July 22, 2019, 8:08 AM
*/
#ifndef CISBTVARIANT_H
#define CISBTVARIANT_H
#include "meinetools.h"
#include "CBigWigReader.h"
#include "vcf.h"
#include "CVcfSnp.h"
#include "json/single_include/nlohmann/json.hpp"
class CIsbtVariant {
public:
CIsbtVariant();
CIsbtVariant(const std::string& lrg_anno, const std::string& refBase, const std::string& chrom, int pos, char strand, int vcfCoord, const std::string& vcfRef, const std::string& vcfAlt, bool are_ref_and_alt_switched_in_GRCh, const string& variation_type);
CIsbtVariant(const CIsbtVariant& orig);
CIsbtVariant& operator =(const CIsbtVariant& orig);
bool operator <(const CIsbtVariant& orig)const;
bool operator >(const CIsbtVariant& orig)const{return !(*this < orig || *this == orig);}
bool operator ==(const CIsbtVariant& orig)const;
//bool operator ==(const string& orig)const;
bool operator !=(const CIsbtVariant& orig)const{return !(*this == orig);};
friend std::ostream& operator<<(std::ostream& os, const CIsbtVariant& me);
virtual ~CIsbtVariant();
char strand(){return m_strand;}
std::string name()const{return m_isbt_name;}
std::string posLRG()const{return m_lrg_position;}
std::string chrom()const{return m_chromosome;}
int pos()const{return m_position;}
std::string getImpact()const{return (m_high_impact_variant ? "yes" : "no");}
std::string lrgReference()const{return m_lrg_reference;}
std::string lrgAlternative()const{return m_lrg_alternative;}
int vcfCoordinate()const{return m_vcf_coordinate;}
std::string vcfReference()const{return m_vcf_reference;}
std::string vcfAlternative()const{return m_vcf_alternative;}
std::string reference()const{if(m_strand == '-')return CMyTools::GetComplSequence(m_lrg_reference); return m_lrg_reference;}
std::string alternative()const{if(m_strand == '-')return CMyTools::GetComplSequence(m_lrg_alternative);return m_lrg_alternative;}
bool isInDel()const{return (m_variation_type.compare("del") == 0 || m_variation_type.compare("ins") == 0 || m_variation_type.compare("delins") == 0);}
bool addCoverage(const CBigWigReader& bigWig);
double getCoverage()const{if(m_coverage != m_coverage) return 0.0;return m_coverage;}
bool isCovered(double limit = 0.0f)const;
bool isHighImpactSNP()const{return m_high_impact_variant;}
bool isRefNClikeGRChNC()const{return !m_are_ref_and_alt_switched_in_GRCh;}
static void setVerbose(bool value = true){verbose=value;}
void addVcfSnp(const CVcfSnp& snp);
int getVcfGenotypeQuality()const;
nlohmann::json getSnpAsJson()const;
private:
CVcfSnp* m_vcf_snp;
std::string m_isbt_name;
bool m_high_impact_variant;
std::string m_lrg_position;
std::string m_lrg_reference;
std::string m_lrg_alternative;
int m_vcf_coordinate;
std::string m_vcf_reference;
std::string m_vcf_alternative;
std::string m_variation_type;
bool m_are_ref_and_alt_switched_in_GRCh;
std::string m_chromosome;
int m_position;
char m_strand;
double m_coverage;
bool parseIsbtVariant();
static bool verbose;
};
#endif /* CISBTVARIANT_H */