vdj_pipe
pipeline for processing DNA sequence data
me_truncate.hpp
Go to the documentation of this file.
1 
7 #ifndef ME_TRUNCATE_HPP_
8 #define ME_TRUNCATE_HPP_
10 
11 namespace vdj_pipe{ namespace match{
12 
15 class Truncate {
16 public:
17  static Truncate lower(const int pos, const bool re_start) {
18  return Truncate(
19  true, false,
20  Relative_position(pos, re_start),
22  );
23  }
24 
25  static Truncate upper(const int pos, const bool re_start) {
26  return Truncate(
27  false, true,
29  Relative_position(pos, re_start)
30  );
31  }
32 
33  static Truncate none() {
34  return Truncate(
35  false, false,
38  );
39  }
40 
42  const bool cut_lo,
43  const bool cut_up,
44  Relative_position const& lower,
46  )
47  : cut_lo_(cut_lo),
48  cut_up_(cut_up),
49  lo_(lower),
50  up_(upper)
51  {}
52 
54  if( is_valid(si) ) {
55  return sequence_interval(
56  (cut_lo_ ? lo_(si) : 0),
57  (cut_up_ ? up_(si) : sequence_interval::whole().upper())
58  );
59  }
60  return sequence_interval::whole();
61  }
62 
63 private:
64  bool cut_lo_;
65  bool cut_up_;
68 };
69 
70 }//namespace match
71 }//namespace vdj_pipe
72 #endif /* ME_TRUNCATE_HPP_ */
Sequence position defined relatively to an interval.
Definition: me_relative_position.hpp:16
Definition: me_truncate.hpp:15
static Truncate upper(const int pos, const bool re_start)
Definition: me_truncate.hpp:25
bool cut_up_
Definition: me_truncate.hpp:65
bool cut_lo_
Definition: me_truncate.hpp:64
Main namespace of vdj_pipe library.
Definition: keywords_variable.hpp:11
Truncate(const bool cut_lo, const bool cut_up, Relative_position const &lower, Relative_position const &upper)
Definition: me_truncate.hpp:41
Relative_position lo_
Definition: me_truncate.hpp:66
Relative_position up_
Definition: me_truncate.hpp:67
static Truncate lower(const int pos, const bool re_start)
Definition: me_truncate.hpp:17
static Truncate none()
Definition: me_truncate.hpp:33
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
bool is_valid(vdj_pipe::sequence_interval const &si)
Definition: sequence_interval.hpp:62
sequence_interval operator()(sequence_interval const &si) const
Definition: me_truncate.hpp:53