comparison BEDTools-Version-2.14.3/src/utils/genomeFile/genomeFile.h @ 0:dfcd8b6c1bda

Uploaded
author aaronquinlan
date Thu, 03 Nov 2011 10:25:04 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:dfcd8b6c1bda
1 /*****************************************************************************
2 genomeFile.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 Licensed under the GNU General Public License 2.0 license.
11 ******************************************************************************/
12 #ifndef GENOMEFILE_H
13 #define GENOMEFILE_H
14
15 #include <map>
16 #include <string>
17 #include <iostream>
18 #include <sstream>
19 #include <fstream>
20 #include <cstring>
21 #include <cstdio>
22 #include "api/BamReader.h"
23 #include "api/BamAux.h"
24 using namespace BamTools;
25
26 using namespace std;
27
28
29 // typedef for mapping b/w chrom name and it's size in b.p.
30 typedef map<string, int, std::less<string> > chromToSizes;
31
32
33 class GenomeFile {
34
35 public:
36
37 // Constructor using a file
38 GenomeFile(const string &genomeFile);
39
40 // Constructor using a vector of BamTools RefVector
41 GenomeFile(const RefVector &genome);
42
43 // Destructor
44 ~GenomeFile(void);
45
46 // load a GENOME file into a map keyed by chrom. value is size of chrom.
47 void loadGenomeFileIntoMap();
48
49 int getChromSize(const string &chrom); // return the size of a chromosome
50 vector<string> getChromList(); // return a list of chrom names
51 int getNumberOfChroms(); // return the number of chroms
52 string getGenomeFileName(); // return the name of the genome file
53
54
55
56 private:
57 string _genomeFile;
58 chromToSizes _chromSizes;
59 vector<string> _chromList;
60 };
61
62 #endif /* GENOMEFILE_H */