plot_options.h
Go to the documentation of this file.
1 
10 #pragma once
12 
13 namespace illumina { namespace interop { namespace util
14 {
15  // todo move to logic?
16  inline std::istream &operator>>(std::istream &in, constants::dna_bases &bases)
17  {
18  std::string value;
19  std::getline(in, value);
20  constants::dna_bases val = constants::parse<constants::dna_bases>(value);
21  if (val == constants::UnknownBase)
22  {
23  std::istringstream iss(value);
24  int tmp = static_cast<int>(constants::UnknownBase);
25  iss >> tmp;
26  if (iss.eof())
27  bases = static_cast<constants::dna_bases>(tmp);
28  else bases = constants::UnknownBase;
29  }
30  else bases = val;
31  return in;
32  }
33 }}}
34 
36 
45 void add_metric_option(illumina::interop::util::option_parser& description, std::string& metric_name)
46 {
47  description
48  (metric_name, "metric-name", "Metric to plot");
49 }
69 {
70  using namespace illumina::interop;
71  std::string group = "filter-by-";
72  description
73  (util::wrap_setter(options, &model::plot::filter_options::lane), group+"lane", "Only the data for the selected lane will be displayed")
74  (util::wrap_setter(options, &model::plot::filter_options::channel), group+"channel", "Only the data for the selected channel will be displayed")
75  (util::wrap_setter(options, &model::plot::filter_options::dna_base), group+"base", "Only the data for the selected base will be displayed")
76  (util::wrap_setter(options, &model::plot::filter_options::surface), group+"surface", "Only the data for the selected surface will be displayed")
77  (util::wrap_setter(options, &model::plot::filter_options::read), group+"read", "Only the data for the selected read will be displayed")
78  (util::wrap_setter(options, &model::plot::filter_options::cycle), group+"cycle", "Only the data for the selected cycle will be displayed")
79  (util::wrap_setter(options, &model::plot::filter_options::tile_number), group+"tile-number", "Only the data for the selected tile number will be displayed")
80  (util::wrap_setter(options, &model::plot::filter_options::swath), group+"swath", "Only the data for the selected swath will be displayed")
81  (util::wrap_setter(options, &model::plot::filter_options::section), group+"section", "Only the data for the selected section will be displayed");
82 }
83 
92 std::string plot_image_name(const std::string& plot_name,
93  const std::string& run_name,
94  const std::string& metric_name="",
95  const std::string& extra="")
96 {
97  std::string name = run_name+"_"+plot_name;
98  if(metric_name != "") name += "_"+metric_name;
99  if(extra != "") name += "_"+extra;
100  return name+".png";
101 }
102 
id_t read() const
Definition: filter_options.h:553
Definition: filter_options.h:28
Definition: enum_description.h:15
std::istream & operator>>(std::istream &in, constants::dna_bases &bases)
Definition: plot_options.h:16
void add_metric_option(illumina::interop::util::option_parser &description, std::string &metric_name)
Definition: plot_options.h:45
Definition: option_parser.h:249
void section(const id_t s)
Definition: filter_options.h:499
channel_t channel() const
Definition: filter_options.h:535
id_t cycle() const
Definition: filter_options.h:562
value_container< R(T::*)(P1) > wrap_setter(T &obj, R(T::*func)(P1))
Definition: option_parser.h:184
id_t lane() const
Definition: filter_options.h:527
Definition: enum_description.h:15
void swath(const id_t s)
Definition: filter_options.h:491
std::string plot_image_name(const std::string &plot_name, const std::string &run_name, const std::string &metric_name="", const std::string &extra="")
Definition: plot_options.h:92
void add_filter_options(illumina::interop::util::option_parser &description, illumina::interop::model::plot::filter_options &options)
Definition: plot_options.h:67
void tile_number(const id_t s)
Definition: filter_options.h:507
dna_base_t dna_base() const
Definition: filter_options.h:544
dna_bases
Definition: enums.h:299
id_t surface() const
Definition: filter_options.h:571