summary_run_metric.h
Go to the documentation of this file.
1 
10 #pragma once
11 
15 
16 namespace illumina { namespace interop { namespace model { namespace metrics
17 {
18 
26  {
27  public:
28  enum
29  {
34  };
38  typedef std::vector<float> float_vector;
40  typedef uint8_t ubyte_t;
42  typedef uint16_t ushort_t;
44  typedef uint32_t uint_t;
46  typedef double count_t;
47 
48  public:
51  m_occupancy_proxy_cluster_count(missing())
52  , m_raw_cluster_count(missing())
53  , m_occupied_cluster_count(missing())
54  , m_pf_cluster_count(missing())
55  { }
57  summary_run_metric(const header_type&) :
58  m_occupancy_proxy_cluster_count(missing())
59  , m_raw_cluster_count(missing())
60  , m_occupied_cluster_count(missing())
61  , m_pf_cluster_count(missing())
62  { }
63 
73  , const count_t raw_cluster_count
74  , const count_t occupied_cluster_count
75  , const count_t pf_cluster_count
76  ) :
77  m_occupancy_proxy_cluster_count(occupancy_proxy_cluster_count)
78  , m_raw_cluster_count(raw_cluster_count)
79  , m_occupied_cluster_count(occupied_cluster_count)
80  , m_pf_cluster_count(pf_cluster_count)
81  {}
82 
83  public:
93  , const count_t raw_cluster_count
94  , const count_t occupied_cluster_count
95  , const count_t pf_cluster_count)
96  {
97  m_occupancy_proxy_cluster_count = occupancy_proxy_cluster_count;
98  m_raw_cluster_count = raw_cluster_count;
99  m_occupied_cluster_count = occupied_cluster_count;
100  m_pf_cluster_count = pf_cluster_count;
101  }
102 
115  count_t raw_cluster_count() const
116  {
117  return m_raw_cluster_count;
118  }
123  count_t occupied_cluster_count() const
124  {
125  return m_occupied_cluster_count;
126  }
131  count_t pf_cluster_count() const
132  {
133  return m_pf_cluster_count;
134  }
140  {
141  return m_occupancy_proxy_cluster_count;
142  }
147  count_t percent_occupancy_proxy() const
148  {
149  if(std::isnan(m_pf_cluster_count)) return missing();
150  if(std::isnan(m_occupancy_proxy_cluster_count)) return missing();
151  return m_occupancy_proxy_cluster_count / m_pf_cluster_count * 100.0;
152  }
157  count_t percent_pf() const
158  {
159  if(std::isnan(m_raw_cluster_count)) return missing();
160  if(std::isnan(m_pf_cluster_count)) return missing();
161  return m_pf_cluster_count / m_raw_cluster_count * 100.0;
162  }
167  count_t percent_occupied() const
168  {
169  if(std::isnan(m_raw_cluster_count)) return missing();
170  if(std::isnan(m_occupied_cluster_count)) return missing();
171  return m_occupied_cluster_count / m_raw_cluster_count * 100.0;
172  }
178  id_t id() const
179  {
180  return 1;// There is only ever 1 per run, cannot be zero
181  }
182 
183  public:
188  static const char *prefix()
189  { return "SummaryRun"; }
190 
191  public:
196  static count_t missing()
197  {
198  return std::numeric_limits<count_t>::quiet_NaN();
199  }
200 
201  private:
202  count_t m_occupancy_proxy_cluster_count;
203  count_t m_raw_cluster_count;
204  count_t m_occupied_cluster_count;
205  count_t m_pf_cluster_count;
206 
207  template<class MetricType, int Version>
208  friend
209  struct io::generic_layout;
210  };
211 }}}}
212 
summary_run_metric(const header_type &)
Definition: summary_run_metric.h:57
::uint32_t id_t
Definition: base_metric.h:74
Definition: enum_description.h:15
metric_base::base_metric_header header_type
Definition: summary_run_metric.h:36
count_t percent_occupancy_proxy() const
Definition: summary_run_metric.h:147
count_t percent_occupied() const
Definition: summary_run_metric.h:167
summary_run_metric(const count_t occupancy_proxy_cluster_count, const count_t raw_cluster_count, const count_t occupied_cluster_count, const count_t pf_cluster_count)
Definition: summary_run_metric.h:72
count_t pf_cluster_count() const
Definition: summary_run_metric.h:131
count_t raw_cluster_count() const
Definition: summary_run_metric.h:115
std::vector< float > float_vector
Definition: summary_run_metric.h:38
count_t percent_pf() const
Definition: summary_run_metric.h:157
uint16_t ushort_t
Definition: summary_run_metric.h:42
Definition: generic_layout.h:24
count_t occupied_cluster_count() const
Definition: summary_run_metric.h:123
id_t id() const
Definition: summary_run_metric.h:178
uint8_t ubyte_t
Definition: summary_run_metric.h:40
static const char * prefix()
Definition: summary_run_metric.h:188
static count_t missing()
Definition: summary_run_metric.h:196
double count_t
Definition: summary_run_metric.h:46
summary_run_metric()
Definition: summary_run_metric.h:50
void set(const count_t occupancy_proxy_cluster_count, const count_t raw_cluster_count, const count_t occupied_cluster_count, const count_t pf_cluster_count)
Definition: summary_run_metric.h:92
uint32_t uint_t
Definition: summary_run_metric.h:44
count_t occupancy_proxy_cluster_count() const
Definition: summary_run_metric.h:139