1 | #ifndef theplu_yat_omic_bam_header |
---|
2 | #define theplu_yat_omic_bam_header |
---|
3 | |
---|
4 | // $Id: BamHeader.h 2883 2012-12-03 12:48:51Z peter $ |
---|
5 | // |
---|
6 | // Copyright (C) 2012 Peter Johansson |
---|
7 | // |
---|
8 | // This program is free software; you can redistribute it and/or modify |
---|
9 | // it under the terms of the GNU General Public License as published by |
---|
10 | // the Free Software Foundation; either version 3 of the License, or |
---|
11 | // (at your option) any later version. |
---|
12 | // |
---|
13 | // This program is distributed in the hope that it will be useful, but |
---|
14 | // WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
16 | // General Public License for more details. |
---|
17 | // |
---|
18 | // You should have received a copy of the GNU General Public License |
---|
19 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
20 | |
---|
21 | #include <bam.h> |
---|
22 | |
---|
23 | namespace theplu { |
---|
24 | namespace yat { |
---|
25 | namespace omic { |
---|
26 | |
---|
27 | /** |
---|
28 | Wrapper around bam_header_t struct. |
---|
29 | |
---|
30 | Class is typically created within InBamFile |
---|
31 | */ |
---|
32 | class BamHeader |
---|
33 | { |
---|
34 | public: |
---|
35 | /** |
---|
36 | \brief Default constructor |
---|
37 | */ |
---|
38 | BamHeader(void); |
---|
39 | |
---|
40 | /** |
---|
41 | Name of chromosome with ID \a tid |
---|
42 | */ |
---|
43 | const char* target_name(size_t tid) const; |
---|
44 | |
---|
45 | /** |
---|
46 | Length of chromosome with ID \a tid |
---|
47 | */ |
---|
48 | uint32_t target_length(size_t tid) const; |
---|
49 | |
---|
50 | /** |
---|
51 | Number of chromosomes |
---|
52 | */ |
---|
53 | int32_t n_targets(void) const; |
---|
54 | private: |
---|
55 | bam_header_t* header_; |
---|
56 | |
---|
57 | friend class InBamFile; |
---|
58 | friend class OutBamFile; |
---|
59 | BamHeader(bam_header_t* h); |
---|
60 | |
---|
61 | // using compiler generated copy and assignment |
---|
62 | //BamHeader(const BamHeader&); |
---|
63 | //BamHeader& operator=(const BamHeader& rhs); |
---|
64 | }; |
---|
65 | |
---|
66 | }}} |
---|
67 | #endif |
---|