vdj_pipe
pipeline for processing DNA sequence data
histogram_step.hpp
Go to the documentation of this file.
1 
7 #ifndef HISTOGRAM_STEP_HPP_
8 #define HISTOGRAM_STEP_HPP_
9 #include <string>
10 #include <vector>
11 #include "boost/unordered_map.hpp"
12 #include "vdj_pipe/config.hpp"
14 #include "vdj_pipe/file.hpp"
16 #include "vdj_pipe/value_map.hpp"
18 
19 namespace vdj_pipe{
20 class Value_ids_single;
21 namespace detail{class File_output;}
22 
25 class VDJ_PIPE_DECL Histogram_step : public detail::Step_base {
26  typedef std::vector<value_variant> hvalue_t;
27  typedef boost::unordered_map<hvalue_t, std::size_t> map_t;
28 public:
29  typedef Value_map vma_type;
30  VDJ_PIPE_STATIC_STRING_METHOD(name, "histogram")
31  VDJ_PIPE_STATIC_STRING_METHOD(category, "statistics")
32  VDJ_PIPE_STATIC_STRING_METHOD(comment,
33  "build a histogram of value occurrences")
34  VDJ_PIPE_STATIC_STRING_METHOD(description, "XXX")
35 
37  vma_type const& vm,
38  boost::property_tree::ptree const& pt,
40  );
41 
42  void reset_access(Value_ids_single const& ids) {}
43  void run();
44  void finish();
45 
46 private:
47  Value_map vm_;
48  std::vector<Val_id> ids_;
49  File_output f_;
50  map_t map_;
51 
52  void write_header(std::ostream& os) const;
53 };
54 
55 }//namespace vdj_pipe
56 #endif /* HISTOGRAM_STEP_HPP_ */
Main namespace of vdj_pipe library.
Definition: sequence_file.hpp:14
Definition: pipe_environment.hpp:26
Definition: step_base.hpp:23
Definition: histogram_step.hpp:25
Provides access to standard values for single read pipeline.
Definition: value_names.hpp:33
Store values mapped against name strings and value IDs.
Definition: value_map.hpp:23
File target is created if needed at construction time.
Definition: file.hpp:105