index_metrics_test.h
Go to the documentation of this file.
1 
9 #pragma once
12 #include "interop/model/run/info.h"
14 #include "interop/util/length_of.h"
15 
16 
17 namespace illumina{ namespace interop { namespace unittest
18 {
19 
25  struct index_metric_v1 : metric_test<model::metrics::index_metric, 1>
26  {
27  enum{
32  };
38  {
39  typedef metric_t::index_info_t index_info_t;
40  metrics = metric_set_t(VERSION);
41  metric_t::index_array_t indices1;
42  indices1.push_back(index_info_t("ATCACGAC-AAGGTTCA", "1", "TSCAIndexes", 4570));
43  metrics.insert(metric_t(7, 1114, 3, indices1));
44 
45  metric_t::index_array_t indices2;
46  indices2.push_back(index_info_t("ACAGTGGT-AAGGTTCA", "2", "TSCAIndexes", 4477));
47  metrics.insert(metric_t(7, 1214, 3, indices2));
48 
49  metric_t::index_array_t indices3;
50  indices3.push_back(index_info_t("CAGATCCA-AAGGTTCA", "3", "TSCAIndexes", 4578));
51  metrics.insert(metric_t(7, 2114, 3, indices3));
52  }
57  template<class Collection>
58  static void create_binary_data(Collection& buffer)
59  {
60  const signed char tmp[] =
61  {
62  1
63  ,7,0,90,4,3,0,17,0,65,84,67,65,67,71,65,67,45,65,65,71
64  ,71,84,84,67,65,-38,17,0,0,1,0,49,11,0,84,83,67,65,73,110
65  ,100,101,120,101,115,7,0,-66,4,3,0,17,0,65,67,65,71,84,71,71
66  ,84,45,65,65,71,71,84,84,67,65,125,17,0,0,1,0,50,11,0,84
67  ,83,67,65,73,110,100,101,120,101,115,7,0,66,8,3,0,17,0,67,65
68  ,71,65,84,67,67,65,45,65,65,71,71,84,84,67,65,-30,17,0,0,1
69  ,0,51,11,0,84,83,67,65,73,110,100,101,120,101,115
70 
71  };
72  buffer.assign(tmp, tmp+util::length_of(tmp));
73  }
79  {
80  const float NaN = std::numeric_limits<float>::quiet_NaN();
81  index_summary.resize(8);
82  for(size_t lane = 0;lane<index_summary.size();++lane)
83  {
84  if(lane != 6)
85  {
86  index_summary[lane] = model::summary::index_lane_summary(0, 0, 0, NaN);
87  }
88  else
89  {
90  index_summary[lane] = model::summary::index_lane_summary(19412847, 9738715, 0.1399f, 0.0118f, 0.046f, 0.047f);
91  index_summary[lane].push_back(model::summary::index_count_summary(1, "ATCACGAC", "AAGGTTCA", "1", "TSCAIndexes", 4570, 0.0469f));
92  index_summary[lane].push_back(model::summary::index_count_summary(2, "ACAGTGGT", "AAGGTTCA", "2", "TSCAIndexes", 4477, 0.046f));
93  index_summary[lane].push_back(model::summary::index_count_summary(3, "CAGATCCA", "AAGGTTCA", "3", "TSCAIndexes", 4578, 0.047f));
94  }
95  }
96 
97  }
98  };
99 
105  struct index_metric_v2 : metric_test<model::metrics::index_metric, 2>
106  {
107  enum{
112  };
118  {
119  typedef metric_t::index_info_t index_info_t;
120  metrics = metric_set_t(VERSION);
121  metric_t::index_array_t indices1;
122  indices1.push_back(index_info_t("ATCACGAC-AAGGTTCA", "1", "TSCAIndexes", 4570));
123  metric_t::index_array_t indices2;
124  indices2.push_back(index_info_t("ACAGTGGT-AAGGTTCA", "2", "TSCAIndexes", 4477));
125  metric_t::index_array_t indices3;
126  indices3.push_back(index_info_t("CAGATCCA-AAGGTTCA", "3", "TSCAIndexes", 4578));
127  metrics.insert(metric_t(1, 121106, 3, indices1));
128  metrics.insert(metric_t(2, 121106, 3, indices2));
129  metrics.insert(metric_t(3, 121106, 3, indices3));
130  }
135  template<class Collection>
136  static void create_binary_data(Collection& buffer)
137  {
138  const signed char tmp[] =
139  {
140  2
141  ,1,0,18,-39,1,0,3,0,17,0,65,84,67,65,67,71,65,67,45,65
142  ,65,71,71,84,84,67,65,-38,17,0,0,0,0,0,0,1,0,49,11,0
143  ,84,83,67,65,73,110,100,101,120,101,115,2,0,18,-39,1,0,3,0,17
144  ,0,65,67,65,71,84,71,71,84,45,65,65,71,71,84,84,67,65,125,17
145  ,0,0,0,0,0,0,1,0,50,11,0,84,83,67,65,73,110,100,101,120
146  ,101,115,3,0,18,-39,1,0,3,0,17,0,67,65,71,65,84,67,67,65
147  ,45,65,65,71,71,84,84,67,65,-30,17,0,0,0,0,0,0,1,0,51
148  ,11,0,84,83,67,65,73,110,100,101,120,101,115
149  };
150  buffer.assign(tmp, tmp+util::length_of(tmp));
151  }
152  };
153 
154 }}}
155 
void insert(const metric_type &metric)
Definition: metric_set.h:267
Definition: enum_description.h:15
void resize(const size_type n)
Definition: index_flowcell_summary.h:116
static void create_binary_data(Collection &buffer)
Definition: index_metrics_test.h:136
static void create_expected(metric_set_t &metrics, const model::run::info &=model::run::info())
Definition: index_metrics_test.h:37
model::metrics::index_metric metric_t
Definition: metric_test.h:57
static void create_summary(model::summary::index_flowcell_summary &index_summary)
Definition: index_metrics_test.h:78
Definition: metric_test.h:41
Definition: index_metrics_test.h:105
model::metric_base::metric_set< model::metrics::index_metric > metric_set_t
Definition: metric_test.h:59
std::vector< index_info > index_array_t
Definition: index_metric.h:234
static void create_binary_data(Collection &buffer)
Definition: index_metrics_test.h:58
static void create_expected(metric_set_t &metrics, const model::run::info &=model::run::info())
Definition: index_metrics_test.h:117
Definition: index_metrics_test.h:25
Definition: index_count_summary.h:17
def index_summary(run_metrics, level='Lane', columns=None, dtype='f4', extra)
Definition: core.py:67
size_t size() const
Definition: index_flowcell_summary.h:104
Definition: index_flowcell_summary.h:21
size_t length_of(const T &val)
Definition: length_of.h:55