index_count_summary.h
Go to the documentation of this file.
1 
8 #pragma once
9 #include <string>
10 #include "interop/util/math.h"
12 
13 namespace illumina { namespace interop { namespace model { namespace summary {
14 
18  {
19  public:
30  index_count_summary(const size_t id=0,
31  const std::string& index1="",
32  const std::string& index2="",
33  const std::string& sample_id="",
34  const std::string& project_name="",
35  const ::uint64_t count=0,
36  const float fraction_mapped=0.0f) : m_id(id),
37  m_index1(index1),
38  m_index2(index2),
39  m_fraction_mapped(fraction_mapped),
40  m_cluster_count(count),
41  m_sample_id(sample_id),
42  m_project_name(project_name)
43  {}
44 
45  public:
60  size_t id()const
61  {
62  return m_id;
63  }
70  const std::string& index1()const
71  {
72  return m_index1;
73  }
80  const std::string& index2()const
81  {
82  return m_index2;
83  }
90  float fraction_mapped()const
91  {
92  return m_fraction_mapped;
93  }
98  ::uint64_t cluster_count()const
99  {
100  return m_cluster_count;
101  }
108  const std::string& sample_id()const
109  {
110  return m_sample_id;
111  }
116  const std::string& project_name()const
117  {
118  return m_project_name;
119  }
122  public:
127  void id(const size_t n)
128  {
129  m_id = n;
130  }
137  {
138  m_cluster_count += cluster_count;
139  return *this;
140  }
145  void update_fraction_mapped(const double total_pf_cluster_count)
146  {
147  if(total_pf_cluster_count != 0.0f)
148  m_fraction_mapped = roundf(static_cast<float>(m_cluster_count / total_pf_cluster_count * 100.0)*10000)/10000;
149  }
155  bool operator<(const index_count_summary& rhs)const
156  {
157  return id() < rhs.id();
158  }
159 
160  private:
161  size_t m_id;
162  std::string m_index1;
163  std::string m_index2;
164  float m_fraction_mapped;
165  ::uint64_t m_cluster_count;
166  std::string m_sample_id;
167  std::string m_project_name;
168 
169 
170  template<class MetricType, int Version>
171  friend struct io::generic_layout;
172  };
173 
174 }}}}
175 
const std::string & sample_id() const
Definition: index_count_summary.h:108
void update_fraction_mapped(const double total_pf_cluster_count)
Definition: index_count_summary.h:145
Definition: enum_description.h:15
size_t id() const
Definition: index_count_summary.h:60
::uint64_t cluster_count() const
Definition: index_count_summary.h:98
bool operator<(const index_count_summary &rhs) const
Definition: index_count_summary.h:155
float fraction_mapped() const
Definition: index_count_summary.h:90
const std::string & index2() const
Definition: index_count_summary.h:80
def summary(run_metrics, level='Total', columns=None, dtype='f4', ignore_missing_columns=True, extra)
Definition: core.py:217
Definition: generic_layout.h:24
const std::string & project_name() const
Definition: index_count_summary.h:116
index_count_summary & operator+=(const ::uint64_t cluster_count)
Definition: index_count_summary.h:136
index_count_summary(const size_t id=0, const std::string &index1="", const std::string &index2="", const std::string &sample_id="", const std::string &project_name="", const ::uint64_t count=0, const float fraction_mapped=0.0f)
Definition: index_count_summary.h:30
Definition: index_count_summary.h:17
const std::string & index1() const
Definition: index_count_summary.h:70
void id(const size_t n)
Definition: index_count_summary.h:127