@@ -266,16 +266,16 @@ namespace illumina { namespace interop { namespace model { namespace metrics
266266 typedef header_type::qscore_bin_vector_type qscore_bin_vector_type;
267267 /* * Defines a vector of unsigned 32-bit ints
268268 */
269- typedef std::vector< ::uint32_t > uint32_vector;
269+ typedef std::vector< ::uint64_t > uint32_vector;
270270 /* * Defines a vector of unsigned 32-bit ints (TODO: remove this def)
271271 */
272- typedef std::vector< ::uint32_t > uint_vector;
272+ typedef std::vector< ::uint64_t > uint_vector;
273273 /* * Defines a vector of unsigned 64-bit ints
274274 */
275275 typedef std::vector< ::uint64_t > uint64_vector;
276276 /* * Define a uint pointer to a uint array
277277 */
278- typedef ::uint32_t *uint_pointer_t ;
278+ typedef ::uint64_t *uint_pointer_t ;
279279 public:
280280 /* * Constructor
281281 */
@@ -358,7 +358,7 @@ namespace illumina { namespace interop { namespace model { namespace metrics
358358 *
359359 * @return q-score value of the histogram
360360 */
361- uint_t qscore_hist (const size_t n) const INTEROP_THROW_SPEC((model::index_out_of_bounds_exception))
361+ uint64_t qscore_hist (const size_t n) const INTEROP_THROW_SPEC((model::index_out_of_bounds_exception))
362362 {
363363 INTEROP_BOUNDS_CHECK (n, m_qscore_hist.size (), " Index out of bounds" );
364364 return m_qscore_hist[n];
@@ -386,9 +386,9 @@ namespace illumina { namespace interop { namespace model { namespace metrics
386386 *
387387 * @return q-score histogram sum
388388 */
389- uint_t sum_qscore () const
389+ uint64_t sum_qscore () const
390390 {
391- return std::accumulate (m_qscore_hist.begin (), m_qscore_hist.end (), 0 );
391+ return std::accumulate (m_qscore_hist.begin (), m_qscore_hist.end (), uint64_t ( 0 ) );
392392 }
393393
394394 /* * Sum the cumulative q-score histogram
@@ -416,10 +416,10 @@ namespace illumina { namespace interop { namespace model { namespace metrics
416416 * @param bins q-score histogram bins
417417 * @return total of clusters over the given q-score
418418 */
419- uint_t total_over_qscore (const uint_t qscore,
419+ uint64_t total_over_qscore (const uint_t qscore,
420420 const qscore_bin_vector_type &bins) const
421421 {
422- uint_t total_count = 0 ;
422+ uint64_t total_count = 0 ;
423423 for (size_t i = 0 ; i < bins.size (); i++)
424424 {
425425 if (bins[i].value () >= qscore)
@@ -439,11 +439,11 @@ namespace illumina { namespace interop { namespace model { namespace metrics
439439 * @param qscore_index index of the q-score (for unbinned 29 is Q30)
440440 * @return total of clusters over the given q-score
441441 */
442- uint_t total_over_qscore (const size_t qscore_index) const
442+ uint64_t total_over_qscore (const size_t qscore_index) const
443443 {
444- uint_t total_count = 0 ;
444+ uint64_t total_count = 0 ;
445445 if (qscore_index <= m_qscore_hist.size ())
446- total_count = std::accumulate (m_qscore_hist.begin () + qscore_index, m_qscore_hist.end (), 0 );
446+ total_count = std::accumulate (m_qscore_hist.begin () + qscore_index, m_qscore_hist.end (), uint64_t ( 0 ) );
447447 return total_count;
448448 }
449449
@@ -482,7 +482,7 @@ namespace illumina { namespace interop { namespace model { namespace metrics
482482 {
483483 const float total = static_cast <float >(sum_qscore ());
484484 if (total == 0 .0f ) return std::numeric_limits<float >::quiet_NaN ();
485- const uint_t total_count = total_over_qscore (qscore_index);
485+ const uint64_t total_count = total_over_qscore (qscore_index);
486486 return 100 * total_count / total;
487487 }
488488
@@ -548,7 +548,7 @@ namespace illumina { namespace interop { namespace model { namespace metrics
548548 {
549549 const float total = static_cast <float >(sum_qscore ());
550550 if (total == 0 .0f ) return std::numeric_limits<float >::quiet_NaN ();
551- const uint_t total_count = total_over_qscore (qscore_index, bins);
551+ const uint64_t total_count = total_over_qscore (qscore_index, bins);
552552 return 100 .0f * total_count / total;
553553 }
554554
@@ -584,12 +584,12 @@ namespace illumina { namespace interop { namespace model { namespace metrics
584584 * @param bins header bins
585585 * @return median q-score
586586 */
587- uint_t median (const qscore_bin_vector_type &bins = qscore_bin_vector_type()) const
587+ uint64_t median (const qscore_bin_vector_type &bins = qscore_bin_vector_type()) const
588588 {
589- const uint_t total = sum_qscore ();
590- const uint_t position = total % 2 == 0 ? total / 2 + 1 : (total + 1 ) / 2 ;
589+ const uint64_t total = sum_qscore ();
590+ const uint64_t position = total % 2 == 0 ? total / 2 + 1 : (total + 1 ) / 2 ;
591591 uint_t i = 0 ;
592- uint_t sum = 0 ;
592+ uint64_t sum = 0 ;
593593 for (; i < m_qscore_hist.size (); i++)
594594 {
595595 sum += m_qscore_hist[i];
@@ -600,7 +600,7 @@ namespace illumina { namespace interop { namespace model { namespace metrics
600600 break ;
601601 }
602602 }
603- return std::numeric_limits<uint_t >::max ();
603+ return std::numeric_limits<uint64_t >::max ();
604604 }
605605
606606 /* * Check if the cumulative histogram has not been populated
@@ -665,7 +665,7 @@ namespace illumina { namespace interop { namespace model { namespace metrics
665665 * @deprecated Will be removed in 1.1.x (use qscore_hist instead)
666666 * @return q-score value of the histogram
667667 */
668- uint_t qscoreHist (const size_t n) const
668+ uint64_t qscoreHist (const size_t n) const
669669 {
670670 INTEROP_ASSERT (n < m_qscore_hist.size ());
671671 return m_qscore_hist[n];
0 commit comments