-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathclipper.hpp
64 lines (51 loc) · 1.3 KB
/
clipper.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef CLIPPER_HPP
#define CLIPPER_HPP
#include <algorithm>
#include <map>
#include <omp.h>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
#include "htslib/hts.h"
#include "htslib/sam.h"
#include "interval_tree.hpp"
#include "chromosomes.hpp"
#include "sv.hpp"
using namespace std;
using namespace lib_interval_tree;
struct Clip {
string name;
string chrom;
uint p;
uint l;
bool starting;
uint w;
Clip() { w = 0; }
Clip(string name_, string chrom_, const uint p_, uint l_, bool starting_,
uint w_ = 0) {
name = name_;
chrom = chrom_;
p = p_;
l = l_;
starting = starting_;
w = w_;
}
bool operator<(const Clip &c) const { return p < c.p; }
};
class Clipper {
private:
vector<Clip> clips;
vector<Clip> remove_duplicates(const vector<Clip> &);
vector<Clip> combine(const vector<Clip> &);
vector<Clip> filter_lowcovered(const vector<Clip> &, const uint);
vector<Clip> cluster(const vector<Clip> &, uint);
vector<Clip> filter_tooclose_clips(const vector<Clip> &,
lib_interval_tree::interval_tree_t<int>
&);
public:
vector<vector<SV>> _p_svs;
Clipper(const vector<Clip> &);
void call(int threads, lib_interval_tree::interval_tree_t<int> &);
};
#endif