vdj_pipe
pipeline for processing DNA sequence data
nodes.hpp
Go to the documentation of this file.
1 
7 #ifndef NODES_HPP_
8 #define NODES_HPP_
9 #include "boost/array.hpp"
11 #include "vdj_pipe/object_ids.hpp"
14 
15 namespace vdj_pipe{ namespace gdst{
16 
22 class Leaf : public detail::Vector_set<Seq_id> {};
23 
26 class Children {
27  typedef boost::array<Branch_id,4> stor;
28 
29  static stor const& init() {
30  const static stor x =
31  {{Branch_id(),Branch_id(),Branch_id(),Branch_id()}};
32  return x;
33  }
34 
35 public:
36  Children() : b_(init()) {}
37  Branch_id const& operator[](const Nucleotide n) const {return b_[n];}
38  Branch_id& operator[](const Nucleotide n) {return b_[n];}
39 private:
40  stor b_;
41 };
42 
45 struct Branch {
46  static const unsigned npos = static_cast<unsigned>(-1);
47  explicit Branch(const unsigned n)
48  : n_(n),
49  c_(),
50  sb_(),
51  leaf_(),
52  sl_()
53  {}
54 
57  unsigned n_;
58 
59  Children_id c_;
60 
64  Branch_id sb_;
65 
67  Leaf_id leaf_;
68 
69  Branch_id sl_;
71 };
72 
73 }//namespace gdst
74 }//namespace vdj_pipe
75 #endif /* NODES_HPP_ */
Definition: nodes.hpp:26
Nucleotide
Definition: nucleotide_index.hpp:24
Collection of unique objects stored in an ordered vector.
Definition: vector_set.hpp:18
Leaf_id leaf_
Definition: nodes.hpp:67
Definition: nodes.hpp:45
unsigned n_
Definition: nodes.hpp:57
Main namespace of vdj_pipe library.
Definition: sequence_file.hpp:14
Branch_id sb_
Definition: nodes.hpp:64
Branch_id sl_
Definition: nodes.hpp:69
Store suffixes Each leaf is attached to a branch and stores suffixes that have the length of the bran...
Definition: nodes.hpp:22