Skip to content

Commit

Permalink
Shuffle NAMs even for paired ends
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelm committed Nov 16, 2023
1 parent 2ecdd00 commit 57fe7df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/aln.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,8 @@ void align_PE_read(
const MappingParameters &map_param,
const IndexParameters& index_parameters,
const References& references,
const StrobemerIndex& index
const StrobemerIndex& index,
std::minstd_rand& random_engine
) {
std::array<Details, 2> details;
std::array<std::vector<Nam>, 2> nams_pair;
Expand Down Expand Up @@ -1014,6 +1015,7 @@ void align_PE_read(
details[is_revcomp].nams = nams.size();
Timer nam_sort_timer;
std::sort(nams.begin(), nams.end(), by_score<Nam>);
shuffle_top_nams(nams, random_engine);
statistics.tot_sort_nams += nam_sort_timer.duration();
nams_pair[is_revcomp] = nams;
}
Expand Down
3 changes: 2 additions & 1 deletion src/aln.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ void align_PE_read(
const MappingParameters& map_param,
const IndexParameters& index_parameters,
const References& references,
const StrobemerIndex& index
const StrobemerIndex& index,
std::minstd_rand& random_engine
);

void align_SE_read(
Expand Down
2 changes: 1 addition & 1 deletion src/pc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void perform_task(
to_uppercase(record1.seq);
to_uppercase(record2.seq);
align_PE_read(record1, record2, sam, sam_out, statistics, isize_est, aligner,
map_param, index_parameters, references, index);
map_param, index_parameters, references, index, random_engine);
statistics.n_reads += 2;
}
for (size_t i = 0; i < records3.size(); ++i) {
Expand Down

0 comments on commit 57fe7df

Please sign in to comment.