-
Notifications
You must be signed in to change notification settings - Fork 296
Expand file tree
/
Copy pathbedFilePE.h
More file actions
97 lines (67 loc) · 1.99 KB
/
bedFilePE.h
File metadata and controls
97 lines (67 loc) · 1.99 KB
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
#ifndef BEDFILEPE_H
#define BEDFILEPE_H
#include <vector>
#include <map>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <cstring>
#include <stdint.h>
#include <algorithm>
#include "bedFile.h"
#include "lineFileUtilities.h"
using namespace std;
/*
Structure for paired-end records
*/
struct BEDPE {
// UCSC BED fields
string chrom1;
CHRPOS start1;
CHRPOS end1;
string chrom2;
CHRPOS start2;
CHRPOS end2;
string name;
string score;
string strand1;
string strand2;
// all of the original fields in the record
vector<string> fields;
// indices of the "other" fields
vector<uint16_t> other_idxs;
};
//************************************************
// BedFile Class methods and elements
//************************************************
class BedFilePE {
public:
// Constructor
BedFilePE(string &);
// Destructor
~BedFilePE(void);
// Open a BEDPE file for reading (creates an istream pointer)
void Open(void);
// Close an opened BEDPE file.
void Close(void);
// Get the next BED entry in an opened BED file.
BedLineStatus GetNextBedPE (BEDPE &bedpe, int &lineNum);
// Methods
void reportBedPETab(const BEDPE &a);
void reportBedPENewLine(const BEDPE &a);
void loadBedPEFileIntoMap();
void splitBedPEIntoBeds(const BEDPE &a, const int &lineNum, MATE *bedEntry1, MATE *bedEntry2);
void FindOverlapsPerBin(int bEnd, string chrom, CHRPOS start, CHRPOS end, string name, string strand,
vector<MATE> &hits, float overlapFraction, bool forceStrand, bool enforceDiffNames);
string bedFile;
unsigned int bedType;
masterMateMap bedMapEnd1;
masterMateMap bedMapEnd2;
private:
istream *_bedStream;
// methods
BedLineStatus parseLine (BEDPE &bedpe, const vector<string> &lineVector, int &lineNum);
bool parseBedPELine (BEDPE &bed, const vector<string> &lineVector, const int &lineNum);
};
#endif /* BEDFILEPE_H */