read_summary.h
Go to the documentation of this file.
1 
8 #pragma once
9 
10 #include <vector>
11 #include "interop/util/exception.h"
12 #include "interop/util/assert.h"
18 
19 namespace illumina { namespace interop { namespace model { namespace summary
20 {
21 
26  {
28  typedef std::vector<lane_summary> lane_summary_vector_t;
29  public:
31  typedef lane_summary_vector_t::reference reference;
33  typedef lane_summary_vector_t::const_reference const_reference;
35  typedef lane_summary_vector_t::iterator iterator;
37  typedef lane_summary_vector_t::const_iterator const_iterator;
39  typedef lane_summary_vector_t::size_type size_type;
40  public:
46  read_summary(const run::read_info &read = run::read_info(), const size_t channel_count=0) :
47  m_read(read), m_metric_summary(channel_count)
48  {
49  }
50 
51  public:
58  {
59  INTEROP_BOUNDS_CHECK(n, m_summary_by_lane.size(), "Lane index exceeds lane count");
60  return m_summary_by_lane[n];
61  }
62 
70  {
71  INTEROP_BOUNDS_CHECK(n, m_summary_by_lane.size(), "Lane index exceeds lane count");
72  return m_summary_by_lane[n];
73  }
74 
79  iterator begin()
80  {
81  return m_summary_by_lane.begin();
82  }
83 
88  iterator end()
89  {
90  return m_summary_by_lane.end();
91  }
92 
97  void resize(const size_type n)
98  {
99  m_summary_by_lane.resize(n);
100  }
101 
107  {
108  return m_read;
109  }
110 
116  {
117  return m_metric_summary;
118  }
119 
125  {
126  m_metric_summary = summary;
127  }
128 
129  public:
144  {
145  INTEROP_BOUNDS_CHECK(n, m_summary_by_lane.size(), "Lane index exceeds lane count");
146  return m_summary_by_lane[n];
147  }
148 
155  const_reference at(const size_type n) const INTEROP_THROW_SPEC((model::index_out_of_bounds_exception))
156  {
157  INTEROP_BOUNDS_CHECK(n, m_summary_by_lane.size(), "Lane index exceeds lane count");
158  return m_summary_by_lane[n];
159  }
160 
165  size_t size() const
166  {
167  return m_summary_by_lane.size();
168  }
169 
174  size_t lane_count() const
175  {
176  return m_summary_by_lane.size();
177  }
178 
183  const_iterator begin() const
184  {
185  return m_summary_by_lane.begin();
186  }
187 
192  const_iterator end() const
193  {
194  return m_summary_by_lane.end();
195  }
196 
197  public:
202  const run::read_info &read() const
203  {
204  return m_read;
205  }
206 
211  const metric_summary &summary() const
212  {
213  return m_metric_summary;
214  }
217  private:
219  run::read_info m_read;
220  metric_summary m_metric_summary;
221 
222  private:
223  lane_summary_vector_t m_summary_by_lane;
224  template<class MetricType, int Version>
225  friend struct io::generic_layout;
226  };
227 
228 }}}}
229 
lane_summary_vector_t::iterator iterator
Definition: read_summary.h:35
const metric_summary & summary() const
Definition: read_summary.h:211
Definition: enum_description.h:15
read_summary(const run::read_info &read=run::read_info(), const size_t channel_count=0)
Definition: read_summary.h:46
#define INTEROP_THROW_SPEC(SPEC)
Definition: exception_specification.h:15
void resize(const size_type n)
Definition: read_summary.h:97
lane_summary & at(const size_type n) INTEROP_THROW_SPEC((model
Definition: read_summary.h:69
lane_summary & operator[](const size_type n) INTEROP_THROW_SPEC((model
Definition: read_summary.h:57
const_reference at(const size_type n) const INTEROP_THROW_SPEC((model
Definition: read_summary.h:155
lane_summary_vector_t::const_reference const_reference
Definition: read_summary.h:33
lane_summary_vector_t::size_type size_type
Definition: read_summary.h:39
void summary(const metric_summary &summary)
Definition: read_summary.h:124
lane_summary_vector_t::const_iterator const_iterator
Definition: read_summary.h:37
def summary(run_metrics, level='Total', columns=None, dtype='f4', ignore_missing_columns=True, extra)
Definition: core.py:217
Definition: generic_layout.h:24
size_t lane_count() const
Definition: read_summary.h:174
lane_summary_vector_t::reference reference
Definition: read_summary.h:31
const_iterator begin() const
Definition: read_summary.h:183
run::read_info & read()
Definition: read_summary.h:106
#define INTEROP_BOUNDS_CHECK(VALUE, RANGE, MESSAGE)
Definition: exception.h:24
const_iterator end() const
Definition: read_summary.h:192
iterator begin()
Definition: read_summary.h:79
iterator end()
Definition: read_summary.h:88
size_t size() const
Definition: read_summary.h:165
metric_summary & summary()
Definition: read_summary.h:115
const lane_summary & operator[](const size_t n) const INTEROP_THROW_SPEC((model
Definition: read_summary.h:143
const run::read_info & read() const
Definition: read_summary.h:202