phasing_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 
24  struct phasing_metric_v1 : metric_test<model::metrics::phasing_metric, 1>
25  {
31  {
32  metrics = metric_set_t(VERSION);
33  metrics.insert(metric_t(4, 1116, 2, 1.16406322f, 1.92952883f));
34  metrics.insert(metric_t(4, 1116, 3, 0.582031608f, 2.12364316f));
35  metrics.insert(metric_t(4, 1116, 4, 0.291015804f, 2.20452404f)); // TODO add 25 cycles of data
36  }
41  template<class Collection>
42  static void create_binary_data(Collection &buffer)
43  {
44  const signed char tmp[] =
45  {
46  1
47  ,14,4,0,92,4,2,0,6,0,-107,63,-51,-6,-10,63,4,0,92,4,3
48  ,0,6,0,21,63,-59,-23,7,64,4,0,92,4,4,0,6,0,-107,62,-20
49  ,22,13,64
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, 4, false)
64  };
65  summary.initialize(to_vector(reads), lane_count, surface_count, channel_count);
66  summary[0][0].lane(4);
67  summary[0][0][0].tile_count(1);
68  summary[0][0].tile_count(1);
69  }
70  };
71 
77  struct phasing_metric_v2 : metric_test<model::metrics::phasing_metric, 2>
78  {
84  {
85  metrics = metric_set_t(VERSION);
86  metrics.insert(metric_t(4, 1116, 2, 1.16406322f, 1.92952883f));
87  metrics.insert(metric_t(4, 1116, 3, 0.582031608f, 2.12364316f));
88  metrics.insert(metric_t(4, 1116, 4, 0.291015804f, 2.20452404f));
89  }
94  template<class Collection>
95  static void create_binary_data(Collection &buffer)
96  {
97  const signed char tmp[] =
98  {
99  2,16,4,0,92,4,0,0,2,0,6,0,-107,63,-51,-6,-10,63,4,0,92,4,0
100  ,0,3,0,6,0,21,63,-59,-23,7,64,4,0,92,4,0,0,4,0,6,0,-107,62
101  ,-20,22,13,64
102  };
103  buffer.assign(tmp, tmp+util::length_of(tmp));
104  }
105  };
106 
107 }}}
108 
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_expected(metric_set_t &metrics, const model::run::info &=model::run::info())
Definition: phasing_metrics_test.h:30
static std::vector< T > to_vector(const T(&vals)[N])
Definition: metric_test.h:85
static void create_binary_data(Collection &buffer)
Definition: phasing_metrics_test.h:42
model::metrics::phasing_metric metric_t
Definition: metric_test.h:57
Definition: metric_test.h:41
model::metric_base::metric_set< model::metrics::phasing_metric > metric_set_t
Definition: metric_test.h:59
def summary(run_metrics, level='Total', columns=None, dtype='f4', ignore_missing_columns=True, extra)
Definition: core.py:217
static void create_binary_data(Collection &buffer)
Definition: phasing_metrics_test.h:95
Definition: phasing_metrics_test.h:24
size_t length_of(const T &val)
Definition: length_of.h:55
static void create_expected(metric_set_t &metrics, const model::run::info &=model::run::info())
Definition: phasing_metrics_test.h:83
Definition: phasing_metrics_test.h:77
static void create_summary(model::summary::run_summary &summary, const bool=false)
Definition: phasing_metrics_test.h:57