From ae4fe29de1575c54f44069e1f54b2b780da8dbe5 Mon Sep 17 00:00:00 2001 From: Marcel Martin Date: Wed, 28 Feb 2024 22:02:28 +0100 Subject: [PATCH] Swap order of rescues --- src/aln.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/aln.cpp b/src/aln.cpp index cf242425..e8594dfa 100644 --- a/src/aln.cpp +++ b/src/aln.cpp @@ -973,10 +973,6 @@ void align_or_map_paired( Timer nam_timer; auto [nonrepetitive_fraction, nams] = find_nams(query_randstrobes, index); - if (nams.empty()) { - query_randstrobes = randstrobes_query_rescue(record.seq, index_parameters); - std::tie(nonrepetitive_fraction, nams) = find_nams(query_randstrobes, index); - } statistics.tot_find_nams += nam_timer.duration(); if (map_param.rescue_level > 1) { @@ -984,6 +980,10 @@ void align_or_map_paired( if (nams.empty() || nonrepetitive_fraction < 0.7) { nams = find_nams_rescue(query_randstrobes, index, map_param.rescue_cutoff); details[is_revcomp].nam_rescue = true; + if (nams.empty()) { + query_randstrobes = randstrobes_query_rescue(record.seq, index_parameters); + std::tie(nonrepetitive_fraction, nams) = find_nams(query_randstrobes, index); + } } statistics.tot_time_rescue += rescue_timer.duration(); } @@ -1098,11 +1098,6 @@ void align_or_map_single( Timer nam_timer; auto [nonrepetitive_fraction, nams] = find_nams(query_randstrobes, index); - if (nams.empty()) { - query_randstrobes = randstrobes_query_rescue(record.seq, index_parameters); - std::tie(nonrepetitive_fraction, nams) = find_nams(query_randstrobes, index); - } - statistics.tot_find_nams += nam_timer.duration(); if (map_param.rescue_level > 1) { @@ -1110,6 +1105,10 @@ void align_or_map_single( if (nams.empty() || nonrepetitive_fraction < 0.7) { details.nam_rescue = true; nams = find_nams_rescue(query_randstrobes, index, map_param.rescue_cutoff); + if (nams.empty()) { + query_randstrobes = randstrobes_query_rescue(record.seq, index_parameters); + std::tie(nonrepetitive_fraction, nams) = find_nams(query_randstrobes, index); + } } statistics.tot_time_rescue += rescue_timer.duration(); }