extended_tile_metrics_test.h
Go to the documentation of this file.
1 
9 #pragma once
10 #include <gtest/gtest.h>
11 #include "metric_test.h"
14 
15 
16 namespace illumina{ namespace interop { namespace unittest
17 {
18 
25  struct extended_tile_metric_v1 : metric_test<model::metrics::extended_tile_metric, 1>
26  {
32  {
33  metrics = metric_set_t(VERSION);
34  metrics.insert(metric_t(7, 1114, 6309736));
35  metrics.insert(metric_t(7, 1214, 6260919));
36  metrics.insert(metric_t(7, 2114, 6232864));
37  }
42  template<class Collection>
43  static void create_binary_data(Collection &buffer)
44  {
45  const signed char tmp[] =
46  {
47  1
48  ,10,7,0,90,4,0,0,-48,-114,-64,74,7,0,-66,4,0,0,110,17,-65
49  ,74,7,0,66,8,0,0,64,54,-66,74
50  };
51  buffer.assign(tmp, tmp+util::length_of(tmp));
52  }
57  static void create_summary(model::summary::run_summary& summary, const bool =false)
58  {
59  const size_t lane_count = 1;
60  const size_t surface_count = 2;
61  const size_t channel_count = 2;
62  const model::run::read_info reads[]={
63  model::run::read_info(1, 1, 3, false),
64  model::run::read_info(2, 1, 3, false)
65  };
66  summary.initialize(to_vector(reads), lane_count, surface_count, channel_count);
67  summary[0][0].lane(7);
68  summary[0][0][0].tile_count(2);
69  summary[0][0][1].tile_count(1);
70  summary[0][0].tile_count(3);
71 
72  const float occupied_mean = 96.8612060546875f;
73  summary.total_summary().percent_occupied(occupied_mean);
74  summary.nonindex_summary().percent_occupied(occupied_mean);
75  for(size_t read_index=0;read_index<2;++read_index)
76  {
77  summary[read_index].summary().percent_occupied(occupied_mean);
78  summary[read_index][0].percent_occupied(model::summary::metric_stat(96.8612060546875f, 0.60115677118301392f, 96.754257202148438f));
79  summary[read_index][0][0].percent_occupied(model::summary::metric_stat(97.131454467773438f, 0.53344285488128662f, 97.131454467773438f));
80  summary[read_index][0][1].percent_occupied(model::summary::metric_stat(96.320701599121094f, 0.0f, 96.320701599121094f));
81  }
82  }
83  };
90  struct extended_tile_metric_v2 : metric_test<model::metrics::extended_tile_metric, 2>
91  {
97  {
98  metrics = metric_set_t(VERSION);
99  metrics.insert(metric_t(7, 111014, 6309736));
100  metrics.insert(metric_t(7, 121014, 6260919));
101  metrics.insert(metric_t(7, 211014, 6232864));
102  }
107  template<class Collection>
108  static void create_binary_data(Collection &buffer)
109  {
110  const signed char tmp[] =
111  {
112  2,10,
113  7,0,-90,-79,1,0,-48,-114,-64,74,7,0,-74,-40,1,0,110,17
114  ,-65,74,7,0,70,56,3,0,64,54,-66,74
115  };
116  buffer.assign(tmp, tmp+util::length_of(tmp));
117  }
118  };
125  struct extended_tile_metric_v3 : metric_test<model::metrics::extended_tile_metric, 3>
126  {
132  {
133  metrics = metric_set_t(VERSION);
134  metrics.insert(metric_t(7, 111014, 6309736, model::metrics::point2d(1,2)));
135  metrics.insert(metric_t(7, 121014, 6260919, model::metrics::point2d(3,4)));
136  metrics.insert(metric_t(7, 211014, 6232864, model::metrics::point2d(5,6)));
137  }
142  template<class Collection>
143  static void create_binary_data(Collection &buffer)
144  {
145  const signed char tmp[] =
146  {
147  3
148  ,18,7,0,-90,-79,1,0,-48,-114,-64,74,0,0,-128,63,0,0,0,64,7
149  ,0,-74,-40,1,0,110,17,-65,74,0,0,64,64,0,0,-128,64,7,0,70
150  ,56,3,0,64,54,-66,74,0,0,-96,64,0,0,-64,64
151  };
152  buffer.assign(tmp, tmp+util::length_of(tmp));
153  }
154  };
155 
156 }}}
157 
static void create_expected(metric_set_t &metrics, const model::run::info &=model::run::info())
Definition: extended_tile_metrics_test.h:131
const metric_summary & total_summary() const
Definition: run_summary.h:314
void insert(const metric_type &metric)
Definition: metric_set.h:267
Definition: enum_description.h:15
void initialize(const run::info &run_info)
Definition: run_summary.h:99
static void create_binary_data(Collection &buffer)
Definition: extended_tile_metrics_test.h:43
static std::vector< T > to_vector(const T(&vals)[N])
Definition: metric_test.h:85
static void create_binary_data(Collection &buffer)
Definition: extended_tile_metrics_test.h:143
model::metrics::extended_tile_metric metric_t
Definition: metric_test.h:57
static void create_expected(metric_set_t &metrics, const model::run::info &=model::run::info())
Definition: extended_tile_metrics_test.h:96
Definition: metric_test.h:41
model::metric_base::metric_set< model::metrics::extended_tile_metric > metric_set_t
Definition: metric_test.h:59
static void create_binary_data(Collection &buffer)
Definition: extended_tile_metrics_test.h:108
def summary(run_metrics, level='Total', columns=None, dtype='f4', ignore_missing_columns=True, extra)
Definition: core.py:217
static void create_expected(metric_set_t &metrics, const model::run::info &=model::run::info())
Definition: extended_tile_metrics_test.h:31
static void create_summary(model::summary::run_summary &summary, const bool=false)
Definition: extended_tile_metrics_test.h:57
Definition: extended_tile_metrics_test.h:25
float percent_occupied() const
Definition: metric_summary.h:107
Definition: extended_tile_metrics_test.h:125
size_t length_of(const T &val)
Definition: length_of.h:55
Definition: extended_tile_metrics_test.h:90
const metric_summary & nonindex_summary() const
Definition: run_summary.h:342