Skip to content

Commit

Permalink
Sort minimizers by score in Giraffe single-end mode
Browse files Browse the repository at this point in the history
Apparently in 40bf613 I meant to keep the minimizers sorted by score in single-end mapping mode, but when #3810 actually merged it changed the order that find_minimizers returns results in to read order and added a score sort to the paired-end non-chaining codepath but not the single-end non-chaining codepath.

This should restore the vg 1.44.0 behavior of taking or not taking identical minimizers all across the read, and also of prioritizing minimizers to take by score, in single-end mode.
  • Loading branch information
adamnovak authored Jul 17, 2024
1 parent c1bcdef commit a0e8e8a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/minimizer_mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,10 +589,13 @@ vector<Alignment> MinimizerMapper::map_from_extensions(Alignment& aln) {
return aln.sequence();
});


// Minimizers sorted by score in descending order.
std::vector<Minimizer> minimizers = this->find_minimizers(aln.sequence(), funnel);

// Minimizers sorted by position
std::vector<Minimizer> minimizers_in_read = this->find_minimizers(aln.sequence(), funnel);
// Indexes of minimizers, sorted into score order, best score first
std::vector<size_t> minimizer_score_order = sort_minimizers_by_score(minimizers_in_read);
// Minimizers sorted by best score first
VectorView<Minimizer> minimizers{minimizers_in_read, minimizer_score_order};

// Find the seeds and mark the minimizers that were located.
vector<Seed> seeds = this->find_seeds(minimizers, aln, funnel);

Expand Down

1 comment on commit a0e8e8a

@adamnovak
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vg CI tests complete for branch single-end-minimizer-order. View the full report here.

16 tests passed, 0 tests failed and 0 tests skipped in 17326 seconds

Please sign in to comment.