From 9d12cc8e9b84a38116a6521e374a23c1f19f47bf Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Fri, 11 Apr 2014 11:38:52 -0700 Subject: [PATCH] skip cases where scores.size is less than the base map --- makecontigscommand.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makecontigscommand.cpp b/makecontigscommand.cpp index 15f002b..e633a9c 100644 --- a/makecontigscommand.cpp +++ b/makecontigscommand.cpp @@ -1059,7 +1059,8 @@ int MakeContigsCommand::driver(vector files, string outputFasta, string }else { contig += seq1[i]; } //with no quality info, then we keep it? }else if (((seq1[i] != '-') && (seq1[i] != '.')) && ((seq2[i] != '-') && (seq2[i] != '.'))) { //both bases choose one with better quality if (thisfqualfile != "") { - if (abs(scores1[ABaseMap[i]] - scores2[BBaseMap[i]]) >= deltaq) { //is the difference in qual scores >= deltaq, if yes choose base with higher score + if (ABaseMap[i] <= scores1.size() && BBaseMap[i] <= scores2.size() && // this check is dumb; we should determine this earlier + abs(scores1[ABaseMap[i]] - scores2[BBaseMap[i]]) >= deltaq) { //is the difference in qual scores >= deltaq, if yes choose base with higher score char c = seq1[i]; if (scores1[ABaseMap[i]] < scores2[BBaseMap[i]]) { c = seq2[i]; } contig += c; -- 2.39.2