yat  0.21pre
BamReadFilter.h
1 #ifndef theplu_yat_omic_bam_read_filter
2 #define theplu_yat_omic_bam_read_filter
3 
4 // $Id: BamReadFilter.h 3999 2020-10-08 23:22:32Z peter $
5 
6 /*
7  Copyright (C) 2013, 2014, 2018, 2020 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 yat. If not, see <http://www.gnu.org/licenses/>.
23 */
24 
25 #include <htslib/sam.h>
26 
27 #include <functional>
28 
29 // this flag was defined in bam.h but has disappeared in htslib
30 #ifndef BAM_DEF_MASK
31 #define BAM_DEF_MASK (BAM_FUNMAP | BAM_FSECONDARY | BAM_FQCFAIL | BAM_FDUP)
32 #endif
33 
34 namespace theplu {
35 namespace yat {
36 namespace omic {
37 
38  class BamRead;
39 
57  class BamReadFilter : public std::unary_function<const BamRead&, bool>
58  {
59  public:
66  BamReadFilter(unsigned char mapQ, unsigned int filtered_flags=BAM_DEF_MASK,
67  unsigned int required_flags=0);
68 
74  bool operator()(const BamRead& bam) const;
75  private:
76  unsigned char mapQ_;
77  unsigned int filtered_;
78  unsigned int required_;
79  };
80 
81 }}}
82 #endif
bool operator()(const BamRead &bam) const
The Department of Theoretical Physics namespace as we define it.
Class holding a bam query.
Definition: BamRead.h:51
Filter bam reads.
Definition: BamReadFilter.h:57
BamReadFilter(unsigned char mapQ, unsigned int filtered_flags=BAM_DEF_MASK, unsigned int required_flags=0)

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14