yat  0.14.5pre
BamReadFilter.h
1 #ifndef theplu_yat_omic_bam_read_filter
2 #define theplu_yat_omic_bam_read_filter
3 
4 // $Id: BamReadFilter.h 3363 2014-11-25 10:42:54Z peter $
5 
6 /*
7  Copyright (C) 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 #include YAT_SAM_HEADER
27 
28 #include <functional>
29 
30 // this flag was defined in bam.h but has disappeared in htslib
31 #ifndef BAM_DEF_MASK
32 #define BAM_DEF_MASK (BAM_FUNMAP | BAM_FSECONDARY | BAM_FQCFAIL | BAM_FDUP)
33 #endif
34 
35 namespace theplu {
36 namespace yat {
37 namespace omic {
38 
39  class BamRead;
40 
58  class BamReadFilter : public std::unary_function<const BamRead&, bool>
59  {
60  public:
67  BamReadFilter(unsigned char mapQ, unsigned int filtered_flags=BAM_DEF_MASK,
68  unsigned int required_flags=0);
69 
75  bool operator()(const BamRead& bam) const;
76  private:
77  unsigned char mapQ_;
78  unsigned int filtered_;
79  unsigned int required_;
80  };
81 
82 }}}
83 #endif
Class holding a bam query.
Definition: BamRead.h:53
bool operator()(const BamRead &bam) const
Filter bam reads.
Definition: BamReadFilter.h:58
BamReadFilter(unsigned char mapQ, unsigned int filtered_flags=BAM_DEF_MASK, unsigned int required_flags=0)

Generated on Tue Sep 26 2017 02:33:29 for yat by  doxygen 1.8.5