0
|
1 /*****************************************************************************
|
|
2 annotateBed.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 ANNOTATEBED_H
|
|
13 #define ANNOTATEBED_H
|
|
14
|
|
15 #include "bedFile.h"
|
|
16 #include <vector>
|
|
17 #include <algorithm>
|
|
18 #include <iostream>
|
|
19 #include <iomanip>
|
|
20 #include <fstream>
|
|
21 #include <stdlib.h>
|
|
22
|
|
23 using namespace std;
|
|
24
|
|
25 //************************************************
|
|
26 // Class methods and elements
|
|
27 //************************************************
|
|
28 class BedAnnotate {
|
|
29
|
|
30 public:
|
|
31
|
|
32 // constructor
|
|
33 BedAnnotate(const string &mainFile, const vector<string> &annoFileNames,
|
|
34 const vector<string> &annoTitles, bool sameStrand, bool diffStrand, bool reportCounts, bool reportBoth);
|
|
35
|
|
36 // destructor
|
|
37 ~BedAnnotate(void);
|
|
38
|
|
39 // annotate the master file with all of the annotation files.
|
|
40 void AnnotateBed();
|
|
41
|
|
42 private:
|
|
43
|
|
44 // input files.
|
|
45 string _mainFile;
|
|
46 vector<string> _annoFileNames;
|
|
47 vector<string> _annoTitles;
|
|
48
|
|
49 // instance of a bed file class.
|
|
50 BedFile *_bed;
|
|
51 vector<BedFile*> _annoFiles;
|
|
52
|
|
53 // do we care about strandedness when counting coverage?
|
|
54 bool _sameStrand;
|
|
55 bool _diffStrand;
|
|
56
|
|
57 bool _reportCounts;
|
|
58 bool _reportBoth;
|
|
59
|
|
60 // private function for reporting coverage information
|
|
61 void ReportAnnotations();
|
|
62
|
|
63 void OpenAnnoFiles();
|
|
64
|
|
65 void CloseAnnoFiles();
|
|
66
|
|
67 void PrintHeader();
|
|
68
|
|
69 void InitializeMainFile();
|
|
70 };
|
|
71 #endif /* ANNOTATEBED_H */
|