-
Notifications
You must be signed in to change notification settings - Fork 296
Expand file tree
/
Copy pathwindowMaker.h
More file actions
66 lines (52 loc) · 1.8 KB
/
windowMaker.h
File metadata and controls
66 lines (52 loc) · 1.8 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
/*****************************************************************************
windowMaker.h
(c) 2009 - Aaron Quinlan
Hall Laboratory
Department of Biochemistry and Molecular Genetics
University of Virginia
aaronquinlan@gmail.com
Licenced under the GNU General Public License 2.0 license.
******************************************************************************/
#include "NewGenomeFile.h"
#include "bedFile.h"
#include <stdint.h>
using namespace std;
//************************************************
// Class methods and elements
//************************************************
class WindowMaker {
public:
enum INPUT_FILE_TYPE {
GENOME_FILE,
BED_FILE
};
enum WINDOW_METHOD {
FIXED_WINDOW_SIZE,
FIXED_WINDOW_COUNT
};
enum ID_METHOD {
ID_NONE,
ID_WINDOW_NUMBER,
ID_SOURCE_ID,
ID_SOURCE_ID_WINDOW_NUMBER
};
// constructor
WindowMaker(string &fileName, ID_METHOD id_method, INPUT_FILE_TYPE input_file_type, uint32_t count, bool reverse);
WindowMaker(string &fileName, ID_METHOD id_method, INPUT_FILE_TYPE input_file_type, uint32_t size, uint32_t step, bool reverse);
// destructor
~WindowMaker(void);
void MakeWindowsFromGenome(const string& genomeFileName);
void MakeWindowsFromBED(string& bedFileName);
private:
uint32_t _size;
uint32_t _step;
uint32_t _count;
bool _reverse; // should window numbering be reversed?
WINDOW_METHOD _window_method;
ID_METHOD _id_method;
void MakeBEDWindow(const BED& interval);
void MakeFixedSizeWindow(const BED& interval);
void MakeFixedCountWindow(const BED& interval);
uint32_t CalculateWindows(const BED& interval);
string GenerateID(const BED& interval, uint32_t window_index, uint32_t num_windows, bool _reverse) const;
};