phasing_summary.h
Go to the documentation of this file.
1 
8 #pragma once
9 
10 #include <vector>
12 #include "interop/util/exception.h"
18 
19 
20 namespace illumina { namespace interop { namespace logic { namespace summary
21 {
36  template<typename I>
38  I end,
40  const constants::tile_naming_method naming_method,
41  const bool skip_median=false) INTEROP_THROW_SPEC((model::index_out_of_bounds_exception))
42  {
43  typedef summary_by_lane_read<float> summary_by_lane_read_t;
44  if (beg == end) return;
45  if (run.size() == 0)return;
46  const size_t surface_count = run.surface_count();
47  summary_by_lane_read_t phasing_slope(run, std::distance(beg, end));
48  summary_by_lane_read_t phasing_offset(run, std::distance(beg, end));
49  summary_by_lane_read_t prephasing_slope(run, std::distance(beg, end));
50  summary_by_lane_read_t prephasing_offset(run, std::distance(beg, end));
51 
52  summary_by_lane_read_t phasing_slope_surface(run, std::distance(beg, end), surface_count);
53  summary_by_lane_read_t phasing_offset_surface(run, std::distance(beg, end), surface_count);
54  summary_by_lane_read_t prephasing_slope_surface(run, std::distance(beg, end), surface_count);
55  summary_by_lane_read_t prephasing_offset_surface(run, std::distance(beg, end), surface_count);
56 
57  for (; beg != end; ++beg)
58  {
59  const size_t read = beg->read() - 1;
60  INTEROP_ASSERT(read < phasing_slope.read_count());
61  const size_t lane = beg->lane() - 1;
62  INTEROP_BOUNDS_CHECK(lane, phasing_slope.lane_count(), "Lane exceeds number of lanes in RunInfo.xml");
63  phasing_slope(read, lane).push_back(beg->phasing_slope());
64  phasing_offset(read, lane).push_back(beg->phasing_offset());
65  prephasing_slope(read, lane).push_back(beg->prephasing_slope());
66  prephasing_offset(read, lane).push_back(beg->prephasing_offset());
67 
68  if(surface_count < 2) continue;
69  const size_t surface = beg->surface(naming_method);
70  phasing_slope_surface(read, lane, surface-1).push_back(beg->phasing_slope());
71  phasing_offset_surface(read, lane, surface-1).push_back(beg->phasing_offset());
72  prephasing_slope_surface(read, lane, surface-1).push_back(beg->prephasing_slope());
73  prephasing_offset_surface(read, lane, surface-1).push_back(beg->prephasing_offset());
74  }
75 
76  for (size_t read = 0; read < run.size(); ++read)
77  {
78  INTEROP_ASSERT(read < phasing_slope.read_count());
79  INTEROP_ASSERT(read < run.size());
80  for (size_t lane = 0; lane < run[read].size(); ++lane)
81  {
82  INTEROP_ASSERT(lane < phasing_slope.lane_count());
83  INTEROP_ASSERT(lane < run[read].size());
84  model::summary::metric_stat phasing_stat;
85  summarize(phasing_slope(read, lane).begin(), phasing_slope(read, lane).end(), phasing_stat, skip_median);
86  run[read][lane].phasing_slope(phasing_stat);
87  summarize(phasing_offset(read, lane).begin(), phasing_offset(read, lane).end(), phasing_stat,skip_median);
88  run[read][lane].phasing_offset(phasing_stat);
89  summarize(prephasing_slope(read, lane).begin(), prephasing_slope(read, lane).end(), phasing_stat,skip_median);
90  run[read][lane].prephasing_slope(phasing_stat);
91  summarize(prephasing_offset(read, lane).begin(), prephasing_offset(read, lane).end(), phasing_stat,skip_median);
92  run[read][lane].prephasing_offset(phasing_stat);
93  if(surface_count < 2) continue;
94  for(size_t surface=0;surface<surface_count;++surface)
95  {
96  summarize(phasing_slope_surface(read, lane,surface).begin(), phasing_slope_surface(read, lane,surface).end(), phasing_stat, skip_median);
97  run[read][lane][surface].phasing_slope(phasing_stat);
98  summarize(phasing_offset_surface(read, lane,surface).begin(), phasing_offset_surface(read, lane,surface).end(), phasing_stat,skip_median);
99  run[read][lane][surface].phasing_offset(phasing_stat);
100  summarize(prephasing_slope_surface(read, lane,surface).begin(), prephasing_slope_surface(read, lane,surface).end(), phasing_stat,skip_median);
101  run[read][lane][surface].prephasing_slope(phasing_stat);
102  summarize(prephasing_offset_surface(read, lane,surface).begin(), prephasing_offset_surface(read, lane,surface).end(), phasing_stat,skip_median);
103  run[read][lane][surface].prephasing_offset(phasing_stat);
104  }
105  }
106  }
107  }
108 
109 
110 
111 }}}}
Definition: enum_description.h:15
size_t surface_count() const
Definition: run_summary.h:287
#define INTEROP_THROW_SPEC(SPEC)
Definition: exception_specification.h:15
inline::uint32_t surface(const ::uint32_t tile_id, const constants::tile_naming_method method)
Definition: tile_metric.h:93
size_t size() const
Definition: run_summary.h:224
#define INTEROP_ASSERT(TST)
Definition: assert.h:21
def summary(run_metrics, level='Total', columns=None, dtype='f4', ignore_missing_columns=True, extra)
Definition: core.py:217
void summarize(I beg, I end, S &stat, const bool skip_median)
Definition: summary_statistics.h:149
def read(run, valid_to_load=None, requires=None, search_paths=None, extra)
Definition: core.py:752
#define INTEROP_BOUNDS_CHECK(VALUE, RANGE, MESSAGE)
Definition: exception.h:24
void summarize_phasing_metrics(I beg, I end, model::summary::run_summary &run, const constants::tile_naming_method naming_method, const bool skip_median=false) INTEROP_THROW_SPEC((model
Definition: phasing_summary.h:37
tile_naming_method
Definition: enums.h:294