X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=trimseqscommand.cpp;h=9f8fafb24e14a807baa8dd5a981c93556c46e3b7;hb=8a0b2fd6644dee848b262fcdea73b912a6054fed;hp=5d4eb39d16f3bdc575a3ee41125705c90da9824f;hpb=57b3c96832667c1b70d4d526331f52e3d49e8237;p=mothur.git diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index 5d4eb39..9f8fafb 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -329,6 +329,8 @@ int TrimSeqsCommand::execute(){ numFPrimers = 0; //this needs to be initialized numRPrimers = 0; + numSpacers = 0; + numLinkers = 0; createGroup = false; vector > fastaFileNames; vector > qualFileNames; @@ -435,6 +437,17 @@ int TrimSeqsCommand::execute(){ Sequence currSeq(in); m->gobble(in); out << currSeq.getName() << '\t' << it->second << endl; + + if (nameFile != "") { + map::iterator itName = nameMap.find(currSeq.getName()); + if (itName != nameMap.end()) { + vector thisSeqsNames; + m->splitAtChar(itName->second, thisSeqsNames, ','); + for (int k = 1; k < thisSeqsNames.size(); k++) { //start at 1 to skip self + out << thisSeqsNames[k] << '\t' << it->second << endl; + } + }else { m->mothurOut("[ERROR]: " + currSeq.getName() + " is not in your namefile, please correct."); m->mothurOutEndLine(); } + } } in.close(); out.close(); @@ -1177,9 +1190,8 @@ int TrimSeqsCommand::setLines(string filename, string qfilename) { cout << fastaFilePos[startIndex] << '\t' << numSeqsPerProcessor << endl; if (qfilename != "") { qLines.push_back(linePair(qfileFilePos[startIndex], numSeqsPerProcessor)); } } - - if(qfilename == "") { qLines = lines; } //files with duds } + if(qfilename == "") { qLines = lines; } //files with duds return 1; #endif