Skip to content

Commit 836022a

Browse files
authored
Bug fix for NovaSeqX 25B flow cells and QByLane (#365)
* Bug fix for NovaSeqX 25B flow cells and certain plotting logic using QByLane * Ensure proper uint64 support * Try to fix windows warnings * Fix another warning * Try more fixes * Add more fixes * Fix swig * Fix bug in test * Fix bug in test
1 parent 36601f4 commit 836022a

File tree

13 files changed

+570
-72
lines changed

13 files changed

+570
-72
lines changed

docs/src/changes.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changes {#changes}
22

3+
## v1.7.0
4+
5+
| Date | Description |
6+
|------------|------------------------------------------------------------------------------|
7+
| 2025-11-19 | Add support for QMetrics v8 and v9 as well as QByLane v8 and v9 |
8+
| 2025-11-19 | Bug fix for NovaSeqX 25B flow cells and certain plotting logic using QByLane |
9+
310
## v1.6.0
411

512
| Date | Description |

interop/model/metrics/q_by_lane_metric.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace illumina { namespace interop { namespace model { namespace metrics
2626
/** Unique type code for metric */
2727
TYPE = constants::QByLane,
2828
/** Latest version of the InterOp format */
29-
LATEST_VERSION = 6
29+
LATEST_VERSION = 9
3030
};
3131
/** Define the base type */
3232
typedef constants::base_lane_t base_t;

interop/model/metrics/q_collapsed_metric.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ namespace illumina { namespace interop { namespace model { namespace metrics {
105105
q_collapsed_metric(const uint_t lane,
106106
const uint_t tile,
107107
const uint_t cycle,
108-
const uint_t q20,
109-
const uint_t q30,
110-
const uint_t total,
111-
const uint_t median_qscore) :
108+
const uint64_t q20,
109+
const uint64_t q30,
110+
const uint64_t total,
111+
const uint64_t median_qscore) :
112112
metric_base::base_cycle_metric(lane, tile, cycle),
113113
m_q20(q20),
114114
m_q30(q30),
@@ -135,31 +135,31 @@ namespace illumina { namespace interop { namespace model { namespace metrics {
135135
*
136136
* @return number of q20 clusters
137137
*/
138-
uint_t q20()const
138+
uint64_t q20()const
139139
{
140140
return m_q20;
141141
}
142142
/** Number of Q30 clusters
143143
*
144144
* @return number of q30 clusters
145145
*/
146-
uint_t q30()const
146+
uint64_t q30()const
147147
{
148148
return m_q30;
149149
}
150150
/** Total number of q-scored clusters
151151
*
152152
* @return total number of q-scored clusters
153153
*/
154-
uint_t total()const
154+
uint64_t total()const
155155
{
156156
return m_total;
157157
}
158158
/** Median q-score for tile
159159
*
160160
* @return median q-score
161161
*/
162-
uint_t median_qscore()const
162+
uint64_t median_qscore()const
163163
{
164164
return m_median_qscore;
165165
}
@@ -261,10 +261,10 @@ namespace illumina { namespace interop { namespace model { namespace metrics {
261261
static const char* suffix(){return "2030";}
262262

263263
private:
264-
uint_t m_q20;
265-
uint_t m_q30;
266-
uint_t m_total;
267-
uint_t m_median_qscore;
264+
uint64_t m_q20;
265+
uint64_t m_q30;
266+
uint64_t m_total;
267+
uint64_t m_median_qscore;
268268
ulong_t m_cumulative_q20;
269269
ulong_t m_cumulative_q30;
270270
ulong_t m_cumulative_total;

interop/model/metrics/q_metric.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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];

src/ext/python/core.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -775,12 +775,6 @@ def read(run, valid_to_load=None, requires=None, search_paths=None, **extra):
775775
...
776776
interop.py_interop_run.xml_file_not_found_exception: cannot open file some/non/existing/run_folder_name/RunInfo.xml
777777
778-
Read from a None object
779-
>>> metrics = read(None)
780-
Traceback (most recent call last):
781-
...
782-
ValueError: invalid null reference in method 'run_metrics_read', argument 2 of type 'std::string const &'
783-
784778
:param run: string path including name of run folder (or run_metrics object)
785779
:param valid_to_load: list of strings containing InterOp metric names (Default: None, load everything)
786780
:param requires: list of required metric (Default: None, check nothing)

src/ext/swig/table.i

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
%import "src/ext/swig/metrics.i"
1717
%import "src/ext/swig/run_metrics.i"
1818

19+
%ignore operator<<;
20+
%ignore operator>>;
21+
%ignore *::operator<<;
22+
%ignore *::operator>>;
23+
%ignore illumina::interop::model::table::operator<<;
24+
%ignore illumina::interop::model::table::operator>>;
1925

2026
// Ensure all the modules import the shared namespace
2127
%pragma(csharp) moduleimports=%{

src/interop/logic/metric/q_metric.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@ namespace illumina { namespace interop { namespace logic { namespace metric
198198
collapsed.set_version(model::metrics::q_collapsed_metric::LATEST_VERSION);
199199
for(const_iterator beg = metric_set.begin(), end = metric_set.end();beg != end;++beg)
200200
{
201-
const uint_t q20 = beg->total_over_qscore(q20_idx);
202-
const uint_t q30 = beg->total_over_qscore(q30_idx);
203-
const uint_t total = beg->sum_qscore();
204-
const uint_t median = beg->median(metric_set.get_bins());
201+
const uint64_t q20 = beg->total_over_qscore(q20_idx);
202+
const uint64_t q30 = beg->total_over_qscore(q30_idx);
203+
const uint64_t total = beg->sum_qscore();
204+
const uint64_t median = beg->median(metric_set.get_bins());
205205
collapsed.insert(model::metrics::q_collapsed_metric(beg->lane(),
206206
beg->tile(),
207207
beg->cycle(),

0 commit comments

Comments
 (0)