vdj_pipe
pipeline for processing DNA sequence data
filter_base.hpp
Go to the documentation of this file.
1 
7 #ifndef FILTER_BASE_HPP_
8 #define FILTER_BASE_HPP_
10 #include "vdj_pipe/object_ids.hpp"
12 
13 namespace vdj_pipe{ namespace detail{
14 
17 class Filter_base : public Step_base_single {
18 public:
19 
20  void summary(std::ostream& os) const;
21 
22 protected:
23 
25  kwds,
26 
27  //name of boolean variable indicating whether read passed filter
28  (passed_name)
29  );
30 
32  vma_type const& vma,
35  );
36 
37  void pass(const bool b) {
38  if( ! b ) {
39  ++nf_;
40  vma_.set_empty();
41  }
42  if( pass_id_ ) vma_[pass_id_] = b;
43  }
44 
45  std::size_t nf_;
46  Val_id pass_id_;
47 };
48 
52 public:
53  void summary(std::ostream& os) const;
54 
55 protected:
57  vma_type const& vma,
60  )
61  : Filter_base(vma, pt, pe), nt_(0)
62  {}
63 
64  void trim(sequence_interval const& si) {
65  pass( ! empty(si) );
66  if( si.lower() > 0 || si.upper() < (int)vma_.sequence().size() ) {
67  ++nt_;
68  vma_.trim(si);
69  }
70  }
71 
72  std::size_t nt_;
73 };
74 
75 }//namespace detail
76 }//namespace vdj_pipe
77 #endif /* FILTER_BASE_HPP_ */
Window_filter_base(vma_type const &vma, boost::property_tree::ptree const &pt, Pipe_environment &pe)
Definition: filter_base.hpp:56
Definition: filter_base.hpp:17
void trim(sequence_interval const &si)
Definition: filter_base.hpp:64
Definition: value_map_access_single.hpp:16
std::size_t nf_
Definition: filter_base.hpp:45
void summary(std::ostream &os) const
Definition: filter_base.cpp:42
void trim(sequence_interval const &si)
Definition: value_map_access_single.hpp:53
Definition: filter_base.hpp:51
Filter_base(vma_type const &vma, boost::property_tree::ptree const &pt, Pipe_environment &pe)
Definition: filter_base.cpp:26
Vm_access_single vma_
Definition: step_base_single.hpp:31
Main namespace of vdj_pipe library.
Definition: keywords_variable.hpp:11
Definition: pipe_environment.hpp:26
void set_empty()
Definition: value_map_access_single.hpp:51
Val_id pass_id_
Definition: filter_base.hpp:46
boost::numeric::interval< int, boost::numeric::interval_lib::policies< boost::numeric::interval_lib::rounded_math< int >, detail::Interval_checking_policy< int > > > sequence_interval
Definition: sequence_interval.hpp:40
VDJ_PIPE_KEYWORD_STRUCT(kwds,(passed_name))
void pass(const bool b)
Definition: filter_base.hpp:37
std::size_t nt_
Definition: filter_base.hpp:72
Definition: step_base_single.hpp:16
seq_type const & sequence() const
Definition: value_map_access_single.hpp:41
bpt::ptree ptree
Definition: processing_step_utils.hpp:19