collapsed_q_plot_test_generator.h
Go to the documentation of this file.
1 
9 #pragma once
10 #include <vector>
15 
16 namespace illumina { namespace interop { namespace unittest
17 {
22  template<class PlotData>
24  {
25  typedef typename abstract_generator<PlotData>::parent_type base_type;
26  public:
32  m_plot_type(plot_type)
33  {
34  const model::run::read_info read_array[]={
35  model::run::read_info(1, 1, 26),
36  model::run::read_info(2, 27, 76)
37  };
38  hiseq4k_run_info::create_expected(m_info, util::to_vector(read_array));
39  if(plot_type != constants::UnknownPlotType) m_metric_iterator.reset(m_info, plot_type);
40  }
46  virtual base_type operator()(const constants::plot_types plot_type)const
47  {
48  return new collapsed_q_plot_test_generator(plot_type);
49  }
50 
57  virtual ::testing::AssertionResult generate(PlotData& expected, PlotData &actual, bool*) const
58  {
61  metrics.finalize_after_load();
62  m_metric_iterator.plot(metrics, expected);
63 
64  metrics.get<model::metrics::q_metric>().clear();
65  m_metric_iterator.plot(metrics, actual);
66  return ::testing::AssertionSuccess();
67  }
68 
73  virtual base_type clone() const
74  {
75  return new collapsed_q_plot_test_generator(*this);
76  }
77 
82  void write(std::ostream &out) const
83  {
85  out << "Metric_" << constants::to_string(m_metric_iterator.metric()) << "_";
86  out << m_metric_iterator.options();
87  }
92  bool advance()
93  {
94  return m_metric_iterator.advance();
95  }
96 
97  protected:
101  };
102 
103 }}}
104 
model::run::info m_info
Definition: collapsed_q_plot_test_generator.h:99
Definition: enum_description.h:15
void plot(model::metrics::run_metrics &run, model::plot::plot_data< model::plot::candle_stick_point > &data) const
Definition: metric_filter_iterator.h:72
Definition: metric_filter_iterator.h:24
Definition: generic_fixture.h:23
void write(std::ostream &out) const
Definition: collapsed_q_plot_test_generator.h:82
plot_types
Definition: enums.h:339
collapsed_q_plot_test_generator(const constants::plot_types plot_type=constants::UnknownPlotType)
Definition: collapsed_q_plot_test_generator.h:31
virtual base_type clone() const
Definition: collapsed_q_plot_test_generator.h:73
virtual ::testing::AssertionResult generate(PlotData &expected, PlotData &actual, bool *) const
Definition: collapsed_q_plot_test_generator.h:57
void reset(const std::string &run_info_filename, const constants::plot_types plot_type)
Definition: metric_filter_iterator.h:57
bool advance()
Definition: collapsed_q_plot_test_generator.h:92
constants::metric_type metric() const
Definition: metric_filter_iterator.h:197
bool advance()
Definition: metric_filter_iterator.h:217
const model::plot::filter_options & options() const
Definition: metric_filter_iterator.h:208
Definition: collapsed_q_plot_test_generator.h:23
metric_base::metric_set_helper< T >::metric_set_t & get()
Definition: run_metrics.h:330
static void create_expected(metric_set_t &metrics, const model::run::info &=model::run::info())
Definition: q_metrics_test.h:250
virtual base_type operator()(const constants::plot_types plot_type) const
Definition: collapsed_q_plot_test_generator.h:46
constants::plot_types m_plot_type
Definition: collapsed_q_plot_test_generator.h:100
static void create_expected(model::run::info &expected_run_info, const std::vector< model::run::read_info > &reads)
Definition: info_test.h:197
std::string to_string(Enum value)
Definition: enums.h:43
metric_filter_iterator m_metric_iterator
Definition: collapsed_q_plot_test_generator.h:98