From: Don Armstrong Date: Fri, 11 Apr 2014 18:38:52 +0000 (-0700) Subject: skip cases where scores.size is less than the base map X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9d12cc8e9b84a38116a6521e374a23c1f19f47bf;p=mothur.git skip cases where scores.size is less than the base map --- 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;