yat  0.12.3pre
BamHeader.h
1 #ifndef theplu_yat_omic_bam_header
2 #define theplu_yat_omic_bam_header
3 
4 // $Id: BamHeader.h 3188 2014-03-25 10:24:29Z peter $
5 
6 /*
7  Copyright (C) 2012, 2013, 2014 Peter Johansson
8 
9  This file is part of the yat library, http://dev.thep.lu.se/yat
10 
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 3 of the
14  License, or (at your option) any later version.
15 
16  The yat library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with this program. If not, see <http://www.gnu.org/licenses/>.
23 */
24 
25 #include "config_bam.h"
26 
27 #include YAT_BAM_HEADER
28 
29 #include <string>
30 
31 namespace theplu {
32 namespace yat {
33 namespace omic {
34 
47  class BamHeader
48  {
49  public:
53  BamHeader(void);
54 
68  void parse_region(const std::string& reg, int& tid, int& begin,
69  int& end) const;
70 
74  const char* target_name(size_t tid) const;
75 
79  uint32_t target_length(size_t tid) const;
80 
88  int32_t tid(const std::string& name) const;
89 
93  int32_t n_targets(void) const;
94  private:
95  bam_header_t* header_;
96 
97  friend class InBamFile;
98  friend class OutBamFile;
99  BamHeader(bam_header_t* h);
100 
101  // using compiler generated copy and assignment
102  //BamHeader(const BamHeader&);
103  //BamHeader& operator=(const BamHeader& rhs);
104  };
105 
106 }}}
107 #endif
BamHeader(void)
Default constructor.
int32_t tid(const std::string &name) const
inverse of target_name(size_t)
int32_t n_targets(void) const
Wrapper around bam_header_t struct.
Definition: BamHeader.h:47
uint32_t target_length(size_t tid) const
const char * target_name(size_t tid) const
void parse_region(const std::string &reg, int &tid, int &begin, int &end) const
Definition: BamFile.h:176
Definition: BamFile.h:105

Generated on Mon Jun 1 2015 12:29:51 for yat by  doxygen 1.8.5