-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvcf.hpp
41 lines (33 loc) · 845 Bytes
/
vcf.hpp
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
#ifndef VCF_HPP
#define VCF_HPP
#include <vector>
#include <string>
#include <iterator>
#include <fstream>
#include <sstream>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <math.h>
#include "lprint.hpp"
using namespace std ;
struct vcf_variant_t {
std::string chrom ;
int pos ;
std::string ref ;
std::string alleles[2] ;
int svlen ;
bool operator==(const vcf_variant_t& v) const {
return chrom == v.chrom && pos == v.pos ;
}
};
namespace std {
template <> struct hash<vcf_variant_t> {
std::size_t operator()(const vcf_variant_t& v) const {
return std::hash<std::string>()(v.chrom) + std::hash<int>()(v.pos) ;
}
};
}
std::unordered_map<std::string, std::vector<vcf_variant_t>> load_vcf_file(std::string);
#endif