X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sffinfocommand.cpp;h=4e53f69cb3e7dd51c3d4b30c10a09d76339b6f2c;hb=8f7164a88df624fd0a8d1eddbb3d744463cc9ecb;hp=0e860db9df44f7c5a4380469ff823c0bd999c82b;hpb=afed323beddfc099c365104b9071600aea9731bd;p=mothur.git diff --git a/sffinfocommand.cpp b/sffinfocommand.cpp index 0e860db..4e53f69 100644 --- a/sffinfocommand.cpp +++ b/sffinfocommand.cpp @@ -587,7 +587,10 @@ int SffInfoCommand::printFastaSeqData(ofstream& out, seqRead& read, Header& head string seq = read.bases; if (trim) { - if((header.clipQualRight != 0) && ((header.clipQualRight-header.clipQualLeft) >= 0)){ + if(header.clipQualRight < header.clipQualLeft){ + seq = "NNNN"; + } + else if((header.clipQualRight != 0) && ((header.clipQualRight-header.clipQualLeft) >= 0)){ seq = seq.substr((header.clipQualLeft-1), (header.clipQualRight-header.clipQualLeft)); } else { @@ -620,7 +623,10 @@ int SffInfoCommand::printQualSeqData(ofstream& out, seqRead& read, Header& heade try { if (trim) { - if((header.clipQualRight != 0) && ((header.clipQualRight-header.clipQualLeft) >= 0)){ + if(header.clipQualRight < header.clipQualLeft){ + out << "0\t0\t0\t0"; + } + else if((header.clipQualRight != 0) && ((header.clipQualRight-header.clipQualLeft) >= 0)){ out << ">" << header.name << " length=" << (header.clipQualRight-header.clipQualLeft) << endl; for (int i = (header.clipQualLeft-1); i < (header.clipQualRight-1); i++) { out << read.qualScores[i] << '\t'; } }