Skip to content

Commit

Permalink
Merge branch 'smalton/DOR-960-either-end-demux' into 'master'
Browse files Browse the repository at this point in the history
[DOR-960] Demux either end

Closes DOR-960

See merge request machine-learning/dorado!1272
  • Loading branch information
malton-ont committed Nov 21, 2024
2 parents dac076d + 9b60e31 commit 35da003
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions dorado/demux/BarcodeClassifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -888,14 +888,16 @@ BarcodeScoreResult BarcodeClassifier::find_best_barcode(
// to the top window and the best barcode according to the bottom window
// are the same. If they suggest different barcodes confidently, then
// consider the read unclassified.
auto best_top_result = std::min_element(
results.begin(), results.end(),
const auto best_top_result = std::min_element(
results.cbegin(), results.cend(),
[](const auto& l, const auto& r) { return l.top_penalty < r.top_penalty; });
auto best_bottom_result = std::min_element(
results.begin(), results.end(),
const auto best_bottom_result = std::min_element(
results.cbegin(), results.cend(),
[](const auto& l, const auto& r) { return l.bottom_penalty < r.bottom_penalty; });
auto max_penalty = std::max(best_top_result->penalty, best_bottom_result->penalty);
auto penalty_dist = std::abs(best_top_result->penalty - best_bottom_result->penalty);
const auto max_penalty =
std::max(best_top_result->top_penalty, best_bottom_result->bottom_penalty);
const auto penalty_dist =
std::abs(best_top_result->top_penalty - best_bottom_result->bottom_penalty);
if ((max_penalty <= m_scoring_params.max_barcode_penalty) &&
(penalty_dist <= m_scoring_params.min_barcode_penalty_dist) &&
(best_top_result->barcode_name != best_bottom_result->barcode_name)) {
Expand Down

0 comments on commit 35da003

Please sign in to comment.