0
|
1 /*****************************************************************************
|
|
2 windowBed.h
|
|
3
|
|
4 (c) 2009 - Aaron Quinlan
|
|
5 Hall Laboratory
|
|
6 Department of Biochemistry and Molecular Genetics
|
|
7 University of Virginia
|
|
8 aaronquinlan@gmail.com
|
|
9
|
|
10 Licenced under the GNU General Public License 2.0 license.
|
|
11 ******************************************************************************/
|
|
12 #ifndef WINDOWBED_H
|
|
13 #define WINDOWBED_H
|
|
14
|
|
15 #include "api/BamReader.h"
|
|
16 #include "api/BamWriter.h"
|
|
17 #include "api/BamAux.h"
|
|
18 using namespace BamTools;
|
|
19
|
|
20 #include "bedFile.h"
|
|
21 #include <vector>
|
|
22 #include <iostream>
|
|
23 #include <fstream>
|
|
24
|
|
25 using namespace std;
|
|
26
|
|
27 //************************************************
|
|
28 // Class methods and elements
|
|
29 //************************************************
|
|
30 class BedWindow {
|
|
31
|
|
32 public:
|
|
33
|
|
34 // constructor
|
|
35 BedWindow(string bedAFile, string bedBFile, int leftSlop, int rightSlop,
|
|
36 bool anyHit, bool noHit, bool writeCount, bool strandWindows,
|
|
37 bool matchOnSameStrand, bool matchOnDiffStrand, bool bamInput, bool bamOutput, bool isUncompressedBam);
|
|
38
|
|
39 // destructor
|
|
40 ~BedWindow(void);
|
|
41
|
|
42 private:
|
|
43
|
|
44 string _bedAFile;
|
|
45 string _bedBFile;
|
|
46 bool _anyHit;
|
|
47 bool _writeCount;
|
|
48 int _leftSlop;
|
|
49 int _rightSlop;
|
|
50 bool _noHit;
|
|
51 bool _strandWindows;
|
|
52 bool _matchOnSameStrand;
|
|
53 bool _matchOnDiffStrand;
|
|
54 bool _bamInput;
|
|
55 bool _bamOutput;
|
|
56 bool _isUncompressedBam;
|
|
57
|
|
58 // instance of a bed file class.
|
|
59 BedFile *_bedA, *_bedB;
|
|
60
|
|
61 // methods
|
|
62 void WindowIntersectBed();
|
|
63 void WindowIntersectBam(string bamFile);
|
|
64 void FindWindowOverlaps(const BED &a, vector<BED> &hits);
|
|
65 bool FindOneOrMoreWindowOverlaps(const BED &a);
|
|
66 void AddWindow(const BED &a, CHRPOS &fudgeStart, CHRPOS &fudgeEnd);
|
|
67
|
|
68 };
|
|
69 #endif /* WINDOWBED_H */
|