tile_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 tile_metric_v2 : metric_test<model::metrics::tile_metric, 2>
25  {
26  enum{
31  };
37  {
38  metrics = metric_set_t(VERSION);
39 
41  reads1.push_back(metric_t::read_metric_type(1, 2.61630869f, 0.0797112584f, 0.119908921f));
42  reads1.push_back(metric_t::read_metric_type(2, 2.61630869f, 0.0797112584f, 0.119908921f));
43 
44  metrics.insert(metric_t(7, 1114, 2355119.25f,1158081.50f,6470949,3181956,reads1));
45  metrics.insert(metric_t(7, 1214, 2355119.25f,1174757.75f,6470949,3227776,
46  metric_t::read_metric_vector(1, metric_t::read_metric_type(1, 2.62243795f, 0.129267812f, 0.135128692f))));
47  metrics.insert(metric_t(7, 2114, 2355119.25f,1211592.38f,6470949,3328983,
48  metric_t::read_metric_vector(1, metric_t::read_metric_type(1, 2.490309f, 0.11908555f, 0.092706576f))));
49  }
54  template<class Collection>
55  static void create_binary_data(Collection& buffer)
56  {
57  const signed char tmp[] =
58  {
59  2,10
60  ,7,0,90,4,100,0,-67,-66,15,74
61  ,7,0,90,4,102,0,74,122,-59,74
62  ,7,0,90,4,101,0,12,94,-115,73
63  ,7,0,90,4,103,0,16,54,66,74
64  ,7,0,90,4,-56,0,82,-11,80,58
65  ,7,0,90,4,-55,0,-62,42,-99,58
66  ,7,0,90,4,44,1,-102,113,39,64
67  ,7,0,90,4,-54,0,82,-11,80,58
68  ,7,0,90,4,-53,0,-62,42,-99,58
69  ,7,0,90,4,45,1,-102,113,39,64
70  ,7,0,90,4,-56,0,82,-11,80,58
71  ,7,0,90,4,-55,0,-62,42,-99,58
72  ,7,0,90,4,44,1,-102,113,39,64
73  ,7,0,-66,4,100,0,-67,-66,15,74
74  ,7,0,-66,4,102,0,74,122,-59,74
75  ,7,0,-66,4,101,0,46,103,-113,73
76  ,7,0,-66,4,103,0,0,2,69,74
77  ,7,0,-66,4,-56,0,21,111,-87,58
78  ,7,0,-66,4,-55,0,-86,29,-79,58
79  ,7,0,-66,4,44,1,6,-42,39,64
80  ,7,0,66,8,100,0,-67,-66,15,74
81  ,7,0,66,8,102,0,74,122,-59,74
82  ,7,0,66,8,101,0,67,-26,-109,73
83  ,7,0,66,8,103,0,92,47,75,74
84  ,7,0,66,8,-56,0,123,22,-100,58
85  ,7,0,66,8,-55,0,85,6,115,58
86  ,7,0,66,8,44,1,57,97,31,64
87  ,7,0,66,8,-112,1,0,0,0,0 // Test whether control lane accidentally clears data
88  ,6,0,66,8,-112,1,0,0,0,0 // Test whether control lane for empty tile shows up
89  };
90  buffer.assign(tmp, tmp+util::length_of(tmp));
91  }
96  {
97  const size_t lane_count = 1;
98  const size_t surface_count = 2;
99  const size_t channel_count = 2;
100  const model::run::read_info reads[]={
101  model::run::read_info(1, 1, 3, false),
102  model::run::read_info(2, 1, 3, false)
103  };
104  summary.initialize(to_vector(reads), lane_count, surface_count, channel_count);
105  for(size_t read=0;read<summary.size();++read)
106  {
107  summary[read][0].lane(7);
108  //
109  summary[read][0][0].tile_count(0);
110  summary[read][0][0].reads_pf(6409732);
111  summary[read][0][0].reads(12941898);
112  summary[read][0][0].density(model::summary::metric_stat(2355119.25f, 0, 2355119.25f));
113  summary[read][0][0].density_pf(model::summary::metric_stat(1166419.625f, 11791.8896484375f, 1166419.625f));
114  summary[read][0][0].cluster_count(model::summary::metric_stat(6470949.0f, 0, 6470949));
115  summary[read][0][0].cluster_count_pf(model::summary::metric_stat(3204866.0f, 32399.6328125f, 3204866));
116  summary[read][0][0].percent_pf(model::summary::metric_stat(49.526985168457031f, 0.50069648027420044f, 49.526985168457031f));
117  //
118  summary[read][0][1].tile_count(0);
119  summary[read][0][1].reads_pf(3328983);
120  summary[read][0][1].reads(6470949);
121  summary[read][0][1].density(model::summary::metric_stat(2355119.25f, 0, 2355119.25f));
122  summary[read][0][1].density_pf(model::summary::metric_stat(1211592.375f, 0.0f, 1211592.375f));
123  summary[read][0][1].cluster_count(model::summary::metric_stat(6470949.0f, 0, 6470949));
124  summary[read][0][1].cluster_count_pf(model::summary::metric_stat(3328983.0f, 0.0f, 3328983));
125  summary[read][0][1].percent_pf(model::summary::metric_stat(51.445053100585938f, 0.0f, 51.445053100585938f));
126  //
127  summary[read][0].tile_count(3);
128  summary[read][0].reads_pf(9738715);
129  summary[read][0].reads(19412847);
130  summary[read][0].density(model::summary::metric_stat(2355119.25f, 0, 2355119.25f));
131  summary[read][0].density_pf(model::summary::metric_stat(1181477.125f, 27380.955078125f, 1174757.75f));
132  summary[read][0].cluster_count(model::summary::metric_stat(6470949.5f, 0, 6470949));
133  summary[read][0].cluster_count_pf(model::summary::metric_stat(3246238.25f, 75232.1640625f, 3227776));
134  summary[read][0].percent_pf(model::summary::metric_stat(50.166339874267578f, 1.1626163721084595f, 49.881031036376953f));
135  summary[read][0][0].tile_count(2);
136  summary[read][0][1].tile_count(1);
137  }
138  summary[0][0].phasing(model::summary::metric_stat(0.10935487598180771f, 0.026172075420618057f, 0.11908555030822754f));
139  summary[0][0].prephasing(model::summary::metric_stat(0.1159147247672081f, 0.021491257473826408f, 0.11990892142057419f));
140  summary[0][0].percent_aligned(model::summary::metric_stat(2.5763518810272217f, 0.074578315019607544f, 2.6163086891174316f));
141 
142  summary[0][0][0].phasing(model::summary::metric_stat(0.1044895350933075f, 0.035041775554418564f, 0.1044895350933075f));
143  summary[0][0][0].prephasing(model::summary::metric_stat(0.12751880288124084f, 0.010762002319097519f, 0.12751880288124084f));
144  summary[0][0][0].percent_aligned(model::summary::metric_stat( 2.6193733215332031f, 0.0043340446427464485f, 2.6193733215332031f));
145 
146  summary[1][0][0].phasing(model::summary::metric_stat(0.079711258411407471f, 0, 0.079711258411407471f));
147  summary[1][0][0].prephasing(model::summary::metric_stat(0.11990892142057419f, 0, 0.11990892142057419f));
148  summary[1][0][0].percent_aligned(model::summary::metric_stat(2.6163086891174316f, 0, 2.6163086891174316f));
149 
150 
151  summary[0][0][1].phasing(model::summary::metric_stat( 0.11908555030822754f, 0.0, 0.11908555030822754f));
152  summary[0][0][1].prephasing(model::summary::metric_stat(0.092706575989723206f, 0.0f, 0.092706575989723206f));
153  summary[0][0][1].percent_aligned(model::summary::metric_stat(2.4903090000152588f, 0.0f, 2.4903090000152588f));
154 
155  summary[1][0].phasing(model::summary::metric_stat(0.079711258411407471f, 0, 0.079711258411407471f));
156  summary[1][0].prephasing(model::summary::metric_stat(0.11990892142057419f, 0, 0.11990892142057419f));
157  summary[1][0].percent_aligned(model::summary::metric_stat(2.6163086891174316, 0, 2.6163086891174316f));
158 
159  summary[0].summary().percent_aligned(2.5763518810272217f);
160  summary[1].summary().percent_aligned(2.6163086891174316f);
161  summary.total_summary().percent_aligned(2.5863409042358398f);
162  summary.nonindex_summary().percent_aligned(2.5863409042358398f);
163  }
164  };
165 
172  struct tile_metric_v3 : metric_test<model::metrics::tile_metric, 3>
173  {
179  {
180  metrics = metric_set_t(header_t(2.7476099f), VERSION);
182  reads1.push_back(metric_t::read_metric_type(1, 2.61630869f));
183  reads1.push_back(metric_t::read_metric_type(2, 2.61630869f));
184 
185  metrics.insert(metric_t(7, 111014, 2355119.25f,1158081.50f,6470949,3181956,reads1));
186  metrics.insert(metric_t(7, 121014, 2355119.25f,1174757.75f,6470949,3227776,
188  metrics.insert(metric_t(7, 211014, 2355119.25f,1211592.38f,6470949,3328983,
190 
191  }
196  template<class Collection>
197  static void create_binary_data(Collection &buffer)
198  {
199  const signed char tmp[] =
200  {
201  3,15,-41,-40,47,64,7,0,-90,-79,1,0,116,74,122,-59,74,16,54,66
202  ,74,7,0,-90,-79,1,0,114,1,0,0,0,-102,113,39,64,7,0,-90,-79,1
203  ,0,114,2,0,0,0,-102,113,39,64,7,0,-74,-40,1,0,116,74,122,-59
204  ,74,0,2,69,74,7,0,-74,-40,1,0,114,1,0,0,0,6,-42,39,64,7,0
205  ,70,56,3,0,116,74,122,-59,74,92,47,75,74,7,0,70,56,3,0,114,1
206  ,0,0,0,57,97,31,64
207  };
208  buffer.assign(tmp, tmp+util::length_of(tmp));
209  }
210  };
211 
212 }}}
213 
214 
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
float percent_aligned() const
Definition: metric_summary.h:60
std::vector< read_metric > read_metric_vector
Definition: tile_metric.h:177
size_t size() const
Definition: run_summary.h:224
static std::vector< T > to_vector(const T(&vals)[N])
Definition: metric_test.h:85
Definition: tile_metrics_test.h:172
model::metrics::tile_metric metric_t
Definition: metric_test.h:57
static void create_summary(model::summary::run_summary &summary)
Definition: tile_metrics_test.h:95
static void create_expected(metric_set_t &metrics, const model::run::info &=model::run::info())
Definition: tile_metrics_test.h:178
Definition: metric_test.h:41
model::metric_base::metric_set< model::metrics::tile_metric > metric_set_t
Definition: metric_test.h:59
static void create_expected(metric_set_t &metrics, const model::run::info &=model::run::info())
Definition: tile_metrics_test.h:36
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: tile_metrics_test.h:197
def read(run, valid_to_load=None, requires=None, search_paths=None, extra)
Definition: core.py:752
Definition: tile_metrics_test.h:24
metric_t::header_type header_t
Definition: metric_test.h:61
size_t length_of(const T &val)
Definition: length_of.h:55
static void create_binary_data(Collection &buffer)
Definition: tile_metrics_test.h:55
const metric_summary & nonindex_summary() const
Definition: run_summary.h:342