Skip to content

Commit

Permalink
slack
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelm committed Aug 29, 2023
1 parent 978cf94 commit 3d96321
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ std::vector<Nam> merge_hits_into_nams(
for (auto& o : open_nams) {

// Extend NAM
if ((o.query_start < h.query_start) && (h.query_start <= o.query_end ) && (o.ref_start < h.ref_start) && (h.ref_start <= o.ref_end) ){
if ((o.query_start < h.query_start) && (h.query_start <= o.query_end + 10) && (o.ref_start < h.ref_start) && (h.ref_start <= o.ref_end + 10) ){
if ((h.query_end > o.query_end) && (h.ref_end > o.ref_end)) {
o.query_end = h.query_end;
o.ref_end = h.ref_end;
Expand Down

1 comment on commit 3d96321

@ksahlin
Copy link
Owner

Choose a reason for hiding this comment

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

I noticed through my own investigations that for the "slack" (set to 10 above) to have the intended effect as implemented above, that is, to join nearby NAMs, it needs to be coupled with if (n.query_end + slack < h.query_start) { and auto c = h.query_start - slack; on lines 114 and 1126 in this commit, respectively. This is to avoid these open NAMs get filtered out before they have a chance to be joined.

I also set int slack = read_length/3; at the start of the function (passing in read length as parameter).

I should also note that I didn't implement any of the previous commits on this branch, I only tested the 'slack' idea.

With my additional changes, I did some local benchmarking on a small test dataset and I cannot observe a clear benefit as of now for any of the read lengths. Accuracy typically an increase or decrease in 0.01 percent points. Although, my tests were coupled with other changes such as asymmetric seeds, no rescue and only benchmarking on chrX+Y.

Please sign in to comment.