Skip to content

Commit 89ef6ef

Browse files
committed
fix
1 parent 221a0f3 commit 89ef6ef

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

func_tests/runtests.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,5 +442,13 @@ checkcmdoutput "$splitcode --unmask $test_dir/test_unmasked.1.fa $test_dir/test_
442442
checkcmdoutput "$splitcode --trim-only -x \"0:1<^AAA^umi[3]>\" -p $test_dir/test_bound.fa" 5827f14f608ed69bd38b12602c8fdeea
443443
checkcmdoutput "$splitcode --trim-only -x \"0:1<~^^CGC^^umi[3]>\" -p $test_dir/test_bound.fa" 20b95054c5a91cfeb8585c550570bbe1
444444

445+
# Check early termination (fixes a bug when maxFindsG is not set for certain groups)
446+
447+
echo "@rNYBot1_StgOdd2Bo1Part
448+
TATTATGGTCCCCCCCCTTCGTGGAATCTAGCAAAAAATGACTTGAGCTGGGGGGGGGG
449+
+
450+
TATTATGGTCCCCCCCCTTCGTGGAATCTAGCTGACTTGTGACTAGCTDGGGGGGGGGG" > $test_dir/test_term.fq
451+
452+
checkcmdoutput "$splitcode --assign -m /dev/null --mod-names -g PART,RPM,RPM,ODD,Y -i Part,RTBC2,RTBC4,Odd2Bo1,NYBot1_Stg -b TGACTTG,TTTTTTT,GGGGGGG,TTCGTGGAATCTAGC,TATTATGGT --maxFindsG=Y:1 -p $test_dir/test_term.fq" 79ad1ca9184b274e1396b5f2220cbade
445453

446454

src/SplitCode.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,19 @@ struct SplitCode {
829829
if (do_qc) {
830830
qc.resize(names.size());
831831
}
832+
833+
// Double check the early termination
834+
for (int i = 0; i < group_names.size(); i++) {
835+
if (max_finds_group_map.find(i) == max_finds_group_map.end()) {
836+
early_termination_maxFindsG = -2;
837+
break;
838+
}
839+
if (max_finds_group_map[i] == 0) {
840+
early_termination_maxFindsG = -2;
841+
break;
842+
}
843+
}
844+
832845
init = true;
833846
}
834847

0 commit comments

Comments
 (0)