From 01b7dae5525a480d31a1de5bc273692726da8570 Mon Sep 17 00:00:00 2001 From: westcott Date: Wed, 30 Mar 2011 13:33:57 +0000 Subject: [PATCH] fixed problem with sffinfo that caused a file mismatch when the trimming trimmed the entire sequence. in trim.seqs checked for blank primer name to remove extra . --- sffinfocommand.cpp | 5 ++++- sffinfocommand.h | 1 + trimseqscommand.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sffinfocommand.cpp b/sffinfocommand.cpp index 2caad96..f9f6db6 100644 --- a/sffinfocommand.cpp +++ b/sffinfocommand.cpp @@ -356,8 +356,9 @@ int SffInfoCommand::extractSffInfo(string input, string accnos){ CommonHeader header; readCommonHeader(in, header); - + int count = 0; + mycount = 0; //check magic number and version if (header.magicNumber != 779314790) { m->mothurOut("Magic Number is not correct, not a valid .sff file"); m->mothurOutEndLine(); return count; } @@ -392,6 +393,7 @@ int SffInfoCommand::extractSffInfo(string input, string accnos){ } count++; + mycount++; //report progress if((count+1) % 10000 == 0){ m->mothurOut(toString(count+1)); m->mothurOutEndLine(); } @@ -788,6 +790,7 @@ int SffInfoCommand::printQualSeqData(ofstream& out, seqRead& read, Header& heade if (trim) { if(header.clipQualRight < header.clipQualLeft){ + out << ">" << header.name << " xy=" << header.xy << endl; out << "0\t0\t0\t0"; } else if((header.clipQualRight != 0) && ((header.clipQualRight-header.clipQualLeft) >= 0)){ diff --git a/sffinfocommand.h b/sffinfocommand.h index d98edbd..0fdf6fc 100644 --- a/sffinfocommand.h +++ b/sffinfocommand.h @@ -76,6 +76,7 @@ private: string sffFilename, sfftxtFilename, outputDir, accnosName; vector filenames, outputNames, accnosFileNames; bool abort, fasta, qual, trim, flow, sfftxt, hasAccnos; + int mycount; set seqNames; map > outputTypes; diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index 0734a88..6924ffc 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -597,7 +597,7 @@ int TrimSeqsCommand::driverCreateTrim(string filename, string qFileName, string if(barcodes.size() != 0){ string thisGroup = barcodeNameVector[barcodeIndex]; - if (primers.size() != 0) { thisGroup += "." + primerNameVector[primerIndex]; } + if (primers.size() != 0) { if (primerNameVector[primerIndex] != "") { thisGroup += "." + primerNameVector[primerIndex]; } } outGroupsFile << currSeq.getName() << '\t' << thisGroup << endl; -- 2.39.2