corrected_intensity_metrics_test.h
Go to the documentation of this file.
1 
9 #pragma once
13 #include "interop/util/length_of.h"
14 
15 namespace illumina{ namespace interop { namespace unittest
16 {
22  struct corrected_intensity_metric_v2 : metric_test<model::metrics::corrected_intensity_metric, 2>
23  {
29  {
30  typedef metric_t::uint_t uint_t;
31  typedef metric_t::ushort_t ushort_t;
32  metrics = metric_set_t(VERSION);
33  const ushort_t corrected_int_all1[] = {1213, 966, 960, 1095};
34  const float corrected_int_called1[] = {4070, 4074, 4029, 3972};
35  const uint_t called_counts1[] = {0, 698433, 548189, 548712, 646638};
36  metrics.insert(
37  metric_t(1, 1103, 25, 1063, 11.9458876f, to_vector(corrected_int_called1), to_vector(corrected_int_all1),
38  to_vector(called_counts1)));
39  const ushort_t corrected_int_all2[] = {1558, 1151, 1158, 1293};
40  const uint_t called_counts2[] = {10938, 733661, 537957, 543912, 615504};
41  const float corrected_int_called2[] = {5013, 4983, 4915, 4932};
42  metrics.insert(
43  metric_t(1, 1104, 1, 1295, 13.3051805f, to_vector(corrected_int_called2), to_vector(corrected_int_all2),
44  to_vector(called_counts2)));
45  const ushort_t corrected_int_all3[] = {1171, 932, 912, 1069};
46  const uint_t called_counts3[] = {0, 706987, 556441, 556067, 653959};
47  const float corrected_int_called3[] = {3931, 3931, 3923, 3878};
48  metrics.insert(
49  metric_t(1, 1105, 25, 1025, 11.7396259f, to_vector(corrected_int_called3), to_vector(corrected_int_all3),
50  to_vector(called_counts3)));
51  }
56  template<class Collection>
57  static void create_binary_data(Collection& buffer)
58  {
59  const signed char tmp[] =
60  {
61  2
62  ,48,1,0,79,4,25,0,39,4,-67,4,-58,3,-64,3,71,4,-26,15,-22
63  ,15,-67,15,-124,15,0,0,0,0,65,-88,10,0,93,93,8,0,104,95,8
64  ,0,-18,-35,9,0,91,34,63,65,1,0,80,4,1,0,15,5,22,6,127
65  ,4,-122,4,13,5,-107,19,119,19,51,19,68,19,-70,42,0,0,-35,49,11
66  ,0,101,53,8,0,-88,76,8,0,80,100,9,0,5,-30,84,65,1,0,81
67  ,4,25,0,1,4,-109,4,-92,3,-112,3,45,4,91,15,91,15,83,15,38
68  ,15,0,0,0,0,-85,-55,10,0,-103,125,8,0,35,124,8,0,-121,-6,9
69  ,0,-126,-43,59,65
70  };
71  buffer.assign(tmp, tmp+util::length_of(tmp));
72  }
77  {
78  const size_t lane_count = 1;
79  const size_t surface_count = 2;
80  const size_t channel_count = 2;
81  const model::run::read_info reads[]={
82  model::run::read_info(1, 1, 27, false)
83  };
84  summary.initialize(to_vector(reads), lane_count, surface_count, channel_count);
87  summary[0][0][0].tile_count(3);
88  summary[0][0].tile_count(3);
89  summary[0][0].lane(1);
90  }
91  };
92 
93 
99  struct corrected_intensity_metric_v3 : metric_test<model::metrics::corrected_intensity_metric, 3>
100  {
106  {
107  typedef metric_t::uint_t uint_t;
108  metrics = metric_set_t(VERSION);
109  const uint_t called_counts1[] = {52, 1049523, 654071, 500476, 982989};
110  const float corrected_int_called1[] = {245, 252, 61, 235};
111  metrics.insert(metric_t(7, 1114, 1, to_vector(corrected_int_called1), to_vector(called_counts1)));
112  const uint_t called_counts2[] = {0, 1063708, 582243, 588028, 953132};
113  const float corrected_int_called2[] = {232, 257, 68, 228};
114  metrics.insert(metric_t(7, 1114, 2, to_vector(corrected_int_called2), to_vector(called_counts2)));
115  const uint_t called_counts3[] = {0, 1022928, 617523, 594836, 951825};
116  const float corrected_int_called3[] = {227, 268, 68, 229};
117  metrics.insert(metric_t(7, 1114, 3, to_vector(corrected_int_called3), to_vector(called_counts3)));
118  }
123  template<class Collection>
124  static void create_binary_data(Collection& buffer)
125  {
126  const signed char tmp[] =
127  {
128  3, 34, 7, 0, 90, 4, 1, 0, -11, 0, -4, 0, 61, 0, -21, 0, 52, 0, 0, 0, -77, 3, 16, 0, -9, -6, 9, 0,
129  -4, -94, 7, 0, -51, -1, 14, 0, 7, 0, 90, 4, 2, 0, -24, 0, 1, 1, 68, 0, -28, 0, 0, 0, 0, 0, 28, 59,
130  16, 0, 99, -30, 8, 0, -4, -8, 8, 0, 44, -117, 14, 0, 7, 0, 90, 4, 3, 0, -29, 0, 12, 1, 68, 0, -27,
131  0, 0, 0, 0, 0, -48, -101, 15, 0, 51, 108, 9, 0, -108, 19, 9, 0, 17, -122, 14, 0
132  };
133  buffer.assign(tmp, tmp+util::length_of(tmp));
134  }
140  {
141  const size_t lane_count = 1;
142  const size_t surface_count = 2;
143  const size_t channel_count = 2;
144  const model::run::read_info reads[]={
145  model::run::read_info(1, 1, 27, false)
146  };
147  summary.initialize(to_vector(reads), lane_count, surface_count, channel_count);
149  summary[0][0].lane(7);
150  summary[0][0].tile_count(1);
151  summary[0][0][0].tile_count(1);
153  }
154  };
155 
163  struct corrected_intensity_metric_v4 : metric_test<model::metrics::corrected_intensity_metric, 4>
164  {
170  {
171  typedef metric_t::uint_t uint_t;
172  metrics = metric_set_t(VERSION);
173  uint_t called_counts1[] = {0,111617,71352,57947,104195};
174  uint_t called_counts2[] = {0,109387,64466,66598,104660};
175  uint_t called_counts3[] = {0,106933,68530,65092,104556};
176 
177  metrics.insert(metric_t(3, 211011, 1, to_vector(called_counts1)));
178  metrics.insert(metric_t(3, 211011, 2, to_vector(called_counts2)));
179  metrics.insert(metric_t(3, 211011, 3, to_vector(called_counts3)));
180  }
185  template<class Collection>
186  static void create_binary_data(Collection& buffer)
187  {
188  const signed char tmp[] =
189  {
190  4,28,3,0,67,56,3,0,1,0,0,0,0,0,1,-76,1,0,-72,22,1,0,91,-30
191  ,0,0,3,-105,1,0,3,0,67,56,3,0,2,0,0,0,0,0,75,-85,1,0,-46
192  ,-5,0,0,38,4,1,0,-44,-104,1,0,3,0,67,56,3,0,3,0,0,0,0,0
193  ,-75,-95,1,0,-78,11,1,0,68,-2,0,0,108,-104,1,0
194  };
195  buffer.assign(tmp, tmp+util::length_of(tmp));
196  }
197  };
198 }}}
199 
void insert(const metric_type &metric)
Definition: metric_set.h:267
Definition: corrected_intensity_metrics_test.h:163
static void create_expected(metric_set_t &metrics, const model::run::info &=model::run::info())
Definition: corrected_intensity_metrics_test.h:169
Definition: enum_description.h:15
static void create_binary_data(Collection &buffer)
Definition: corrected_intensity_metrics_test.h:124
void initialize(const run::info &run_info)
Definition: run_summary.h:99
static void create_binary_data(Collection &buffer)
Definition: corrected_intensity_metrics_test.h:57
static std::vector< T > to_vector(const T(&vals)[N])
Definition: metric_test.h:85
const run::cycle_range & called_cycle_range() const
Definition: cycle_state_summary.h:50
::uint16_t ushort_t
Definition: base_metric.h:141
Definition: cycle_range.h:20
model::metrics::corrected_intensity_metric metric_t
Definition: metric_test.h:57
static void create_expected(metric_set_t &metrics, const model::run::info &=model::run::info())
Definition: corrected_intensity_metrics_test.h:105
static void create_binary_data(Collection &buffer)
Definition: corrected_intensity_metrics_test.h:186
Definition: metric_test.h:41
model::metric_base::metric_set< model::metrics::corrected_intensity_metric > metric_set_t
Definition: metric_test.h:59
static void create_summary(model::summary::run_summary &summary)
Definition: corrected_intensity_metrics_test.h:76
static void create_summary(model::summary::run_summary &summary)
Definition: corrected_intensity_metrics_test.h:139
::uint32_t uint_t
Definition: base_metric.h:77
def summary(run_metrics, level='Total', columns=None, dtype='f4', ignore_missing_columns=True, extra)
Definition: core.py:217
Definition: corrected_intensity_metrics_test.h:22
const cycle_state_summary & cycle_state() const
Definition: run_summary.h:370
static void create_expected(metric_set_t &metrics, const model::run::info &=model::run::info())
Definition: corrected_intensity_metrics_test.h:28
Definition: corrected_intensity_metrics_test.h:99
size_t length_of(const T &val)
Definition: length_of.h:55