extraction_metrics_test.h
Go to the documentation of this file.
1 
9 #pragma once
13 #include "interop/util/length_of.h"
14 
15 
16 namespace illumina{ namespace interop { namespace unittest
17 {
18 
24  struct extraction_metric_v2 : metric_test<model::metrics::extraction_metric, 2>
25  {
31  {
32  metrics = metric_set_t(VERSION);
33 
34  typedef metric_t::ushort_t ushort_t;
35  const float focus1[] = {2.24664021f, 2.1896739f, 0, 0};
36  const ushort_t p90_1[] = {302, 273, 0, 0};
37  metrics.insert(metric_t(7, 1114, 1, interop::util::csharp_date_time(9859129975844165472ul), to_vector(p90_1), to_vector(focus1)));
38  const float focus2[] = {2.23177338f, 2.20616174f, 0, 0};
39  const ushort_t p90_2[] = {312, 273, 0, 0};
40  metrics.insert(metric_t(7, 1214, 1, interop::util::csharp_date_time(9859129975872781680ul), to_vector(p90_2), to_vector(focus2)));
41  const float focus3[] = {2.10524225f, 2.14023066f, 0, 0};
42  const ushort_t p90_3[] = {349, 302, 0, 0};
43  metrics.insert(metric_t(7, 2114, 1, interop::util::csharp_date_time(9859129975901427921ul), to_vector(p90_3), to_vector(focus3)));
44 
45  }
50  template<class Collection>
51  static void create_binary_data(Collection& buffer)
52  {
53  const signed char tmp[] =
54  {
55  2,38,7,0,90,4,1,0,-12,-56,15,64,-98,35,12,64,0,0,0,0,0,0,0,0,46,1,17,1,0,0,0,0,96,-41,-104,36,122,-86,-46,-120
56  ,7,0,-66,4,1,0,96,-43,14,64,-63,49,13,64,0,0,0,0,0,0,0,0,56,1,17,1,0,0,0,0,112,125,77,38,122,-86,-46,-120
57  ,7,0,66,8,1,0,74,-68,6,64,-118,-7,8,64,0,0,0,0,0,0,0,0,93,1,46,1,0,0,0,0,-47,-104,2,40,122,-86,-46,-120
58  };
59  buffer.assign(tmp, tmp+util::length_of(tmp));
60  }
66  {
67  const size_t lane_count = 1;
68  const size_t surface_count = 2;
69  const size_t channel_count = 2;
70  const model::run::read_info reads[]={
71  model::run::read_info(1, 1, 2, false)
72  };
73  summary.initialize(to_vector(reads), lane_count, surface_count, channel_count);
74  summary[0][0].lane(7);
75  summary[0][0].first_cycle_intensity(model::summary::metric_stat(321, 24.75883674621582f, 312));
76  summary[0][0][0].tile_count(2);
77  summary[0][0][1].tile_count(1);
78  summary[0][0][0].first_cycle_intensity(model::summary::metric_stat(307.0f, 7.0710678f, 307.0f));
79  summary[0][0][1].first_cycle_intensity(model::summary::metric_stat(349.0f, 0.0f, 349.0f));
81  summary[0].summary().first_cycle_intensity(321);
82  summary.total_summary().first_cycle_intensity(321);
84  summary[0][0].tile_count(3);
86  }
87  };
88 
95  struct extraction_metric_v3 : metric_test<model::metrics::extraction_metric, 3>
96  {
102  {
103  metrics = metric_set_t(header_t(2), VERSION);
104  typedef metric_t::ushort_t ushort_t;
105 
106  const ushort_t p90_1[] = {877,518};
107  const float focus1[] = {2.14784f,2.12109f};
108  const ushort_t p90_2[] = {862,508};
109  const float focus2[] = {2.1639f,2.08307f};
110  const ushort_t p90_3[] = {887,519};
111  const float focus3[] = {2.15751f,2.09462f};
112 
113  metrics.insert(metric_t(3,211011,1, to_vector(p90_1), to_vector(focus1)));
114  metrics.insert(metric_t(3,211012,1, to_vector(p90_2), to_vector(focus2)));
115  metrics.insert(metric_t(3,211013,1, to_vector(p90_3), to_vector(focus3)));
116  }
121  template<class Collection>
122  static void create_binary_data(Collection &buffer)
123  {
124  const signed char tmp[] =
125  {
126  3,20,2,3,0,67,56,3,0,1,0,54,118,9,64,-16,-65,7,64,109,3,6,2
127  ,3,0,68,56,3,0,1,0,86,125,10,64,5,81,5,64,94,3,-4,1,3,0,69
128  ,56,3,0,1,0,-91,20,10,64,65,14,6,64,119,3,7,2
129  };
130  buffer.assign(tmp, tmp+util::length_of(tmp));
131  }
132  };
133 
134 }}}
135 
const metric_summary & total_summary() const
Definition: run_summary.h:314
void insert(const metric_type &metric)
Definition: metric_set.h:267
const run::cycle_range & extracted_cycle_range() const
Definition: cycle_state_summary.h:41
Definition: enum_description.h:15
void initialize(const run::info &run_info)
Definition: run_summary.h:99
static std::vector< T > to_vector(const T(&vals)[N])
Definition: metric_test.h:85
::uint16_t ushort_t
Definition: base_metric.h:141
Definition: cycle_range.h:20
static void create_binary_data(Collection &buffer)
Definition: extraction_metrics_test.h:122
model::metrics::extraction_metric metric_t
Definition: metric_test.h:57
Definition: metric_test.h:41
model::metric_base::metric_set< model::metrics::extraction_metric > metric_set_t
Definition: metric_test.h:59
static void create_binary_data(Collection &buffer)
Definition: extraction_metrics_test.h:51
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: extraction_metrics_test.h:101
static void create_summary(model::summary::run_summary &summary)
Definition: extraction_metrics_test.h:65
const cycle_state_summary & cycle_state() const
Definition: run_summary.h:370
float first_cycle_intensity() const
Definition: metric_summary.h:68
Definition: extraction_metrics_test.h:95
Definition: extraction_metrics_test.h:24
static void create_expected(metric_set_t &metrics, const model::run::info &=model::run::info())
Definition: extraction_metrics_test.h:30
size_t length_of(const T &val)
Definition: length_of.h:55
const metric_summary & nonindex_summary() const
Definition: run_summary.h:342