X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=seqerrorcommand.cpp;h=ecd6f0ceb723290337f5856f724710eff7a751ee;hb=7d9e2bc58855132983da7ac9342880bc95055f77;hp=67e43aa0d4b7f6a6ff251bc45a8254ca49b8b162;hpb=20071b183e619c122bf9f63b4bb42722507c4e4a;p=mothur.git diff --git a/seqerrorcommand.cpp b/seqerrorcommand.cpp index 67e43aa..ecd6f0c 100644 --- a/seqerrorcommand.cpp +++ b/seqerrorcommand.cpp @@ -407,6 +407,13 @@ int SeqErrorCommand::execute(){ m->mothurOut("It took " + toString(time(NULL) - start) + " secs to check " + toString(numSeqs) + " sequences."); m->mothurOutEndLine(); + //set fasta file as new current fastafile + string current = ""; + itTypes = outputTypes.find("errorseq"); + if (itTypes != outputTypes.end()) { + if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setFastaFile(current); } + } + m->mothurOutEndLine(); m->mothurOut("Output File Names: "); m->mothurOutEndLine(); for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); } @@ -673,10 +680,10 @@ int SeqErrorCommand::driver(string filename, string qFileName, string rFileName, int numSeqs = 0; map::iterator it; - qScoreErrorMap['m'].assign(41, 0); - qScoreErrorMap['s'].assign(41, 0); - qScoreErrorMap['i'].assign(41, 0); - qScoreErrorMap['a'].assign(41, 0); + qScoreErrorMap['m'].assign(101, 0); + qScoreErrorMap['s'].assign(101, 0); + qScoreErrorMap['i'].assign(101, 0); + qScoreErrorMap['a'].assign(101, 0); errorForward['m'].assign(maxLength,0); errorForward['s'].assign(maxLength,0); @@ -712,8 +719,8 @@ int SeqErrorCommand::driver(string filename, string qFileName, string rFileName, qualForwardMap.resize(maxLength); qualReverseMap.resize(maxLength); for(int i=0;i > qScoreErrorMap){ outputNames.push_back(errorQualityFileName); outputTypes["errorquality"].push_back(errorQualityFileName); errorQualityFile << "qscore\tmatches\tsubstitutions\tinsertions\tambiguous" << endl; - for(int i=0;i<41;i++){ + for(int i=0;i<101;i++){ errorQualityFile << i << '\t' << qScoreErrorMap['m'][i] << '\t' << qScoreErrorMap['s'][i] << '\t' << qScoreErrorMap['i'][i] << '\t'<< qScoreErrorMap['a'][i] << endl; } errorQualityFile.close(); @@ -1381,6 +1388,10 @@ int SeqErrorCommand::setLines(string filename, string qfilename, string rfilenam string sname = ""; nameStream >> sname; sname = sname.substr(1); + + for (int i = 0; i < sname.length(); i++) { + if (sname[i] == ':') { sname[i] = '_'; m->changedSeqNames = true; } + } map::iterator it = firstSeqNames.find(sname); @@ -1441,6 +1452,10 @@ int SeqErrorCommand::setLines(string filename, string qfilename, string rfilenam istringstream nameStream(input); string sname = ""; nameStream >> sname; + for (int i = 0; i < sname.length(); i++) { + if (sname[i] == ':') { sname[i] = '_'; m->changedSeqNames = true; } + } + map::iterator it = firstSeqNamesReport.find(sname); if(it != firstSeqNamesReport.end()) { //this is the start of a new chunk