//append new header to reads\r
for (int i = 0; i < filehandles.size(); i++) {\r
for (int j = 0; j < filehandles[i].size(); j++) {\r
- m->appendBinaryFiles(filehandles[i][j], filehandlesHeaders[i][j]);\r
- m->renameFile(filehandlesHeaders[i][j], filehandles[i][j]);\r
- m->mothurRemove(filehandlesHeaders[i][j]);\r
- //cout << i << '\t' << '\t' << j << '\t' << filehandles[i][j] << " done appending headers and removing " << filehandlesHeaders[i][j] << endl;\r
- if (numSplitReads[i][j] == 0) { m->mothurRemove(filehandles[i][j]); }\r
+ if (filehandles[i][j] != "") {\r
+ m->appendBinaryFiles(filehandles[i][j], filehandlesHeaders[i][j]);\r
+ m->renameFile(filehandlesHeaders[i][j], filehandles[i][j]);\r
+ m->mothurRemove(filehandlesHeaders[i][j]);\r
+ //cout << i << '\t' << '\t' << j << '\t' << filehandles[i][j] << " done appending headers and removing " << filehandlesHeaders[i][j] << endl;\r
+ if (numSplitReads[i][j] == 0) { m->mothurRemove(filehandles[i][j]); }\r
+ }\r
}\r
}\r
//cout << "here3" << endl;\r
if(!success) { trashCode += 'r'; }\r
}\r
\r
+ if (trashCode.length() == 0) { //is this sequence in the ignore group\r
+ string thisGroup = "";\r
+ \r
+ if(barcodes.size() != 0){\r
+ thisGroup = barcodeNameVector[barcode];\r
+ if (numFPrimers != 0) {\r
+ if (primerNameVector[primer] != "") {\r
+ if(thisGroup != "") {\r
+ thisGroup += "." + primerNameVector[primer];\r
+ }else {\r
+ thisGroup = primerNameVector[primer];\r
+ }\r
+ }\r
+ }\r
+ }\r
+ \r
+ int pos = thisGroup.find("ignore");\r
+ if (pos != string::npos) { trashCode += "i"; }\r
+ }\r
\r
return trashCode.length();\r
}\r
string primerName = primerNameVector[itPrimer->second];\r
string barcodeName = barcodeNameVector[itBar->second];\r
\r
- string comboGroupName = "";\r
- string fastaFileName = "";\r
- string qualFileName = "";\r
- string nameFileName = "";\r
- \r
- if(primerName == ""){\r
- comboGroupName = barcodeNameVector[itBar->second];\r
- }\r
- else{\r
- if(barcodeName == ""){\r
- comboGroupName = primerNameVector[itPrimer->second];\r
- }\r
- else{\r
- comboGroupName = barcodeNameVector[itBar->second] + "." + primerNameVector[itPrimer->second];\r
- }\r
- }\r
- \r
- ofstream temp;\r
- map<string, string> variables;\r
- variables["[filename]"] = outputDir + m->getRootName(m->getSimpleName(currentFileName));\r
- variables["[group]"] = comboGroupName;\r
- string thisFilename = getOutputFileName("sff",variables);\r
- if (uniqueNames.count(thisFilename) == 0) {\r
- outputNames.push_back(thisFilename);\r
- outputTypes["sff"].push_back(thisFilename);\r
- uniqueNames.insert(thisFilename);\r
- }\r
- \r
- filehandles[itBar->second][itPrimer->second] = thisFilename;\r
- temp.open(thisFilename.c_str(), ios::binary); temp.close();\r
+ if ((primerName == "ignore") || (barcodeName == "ignore")) { } //do nothing\r
+ else {\r
+ string comboGroupName = "";\r
+ string fastaFileName = "";\r
+ string qualFileName = "";\r
+ string nameFileName = "";\r
+ \r
+ if(primerName == ""){\r
+ comboGroupName = barcodeNameVector[itBar->second];\r
+ }\r
+ else{\r
+ if(barcodeName == ""){\r
+ comboGroupName = primerNameVector[itPrimer->second];\r
+ }\r
+ else{\r
+ comboGroupName = barcodeNameVector[itBar->second] + "." + primerNameVector[itPrimer->second];\r
+ }\r
+ }\r
+ \r
+ ofstream temp;\r
+ map<string, string> variables;\r
+ variables["[filename]"] = outputDir + m->getRootName(m->getSimpleName(currentFileName));\r
+ variables["[group]"] = comboGroupName;\r
+ string thisFilename = getOutputFileName("sff",variables);\r
+ if (uniqueNames.count(thisFilename) == 0) {\r
+ outputNames.push_back(thisFilename);\r
+ outputTypes["sff"].push_back(thisFilename);\r
+ uniqueNames.insert(thisFilename);\r
+ }\r
+ \r
+ filehandles[itBar->second][itPrimer->second] = thisFilename;\r
+ temp.open(thisFilename.c_str(), ios::binary); temp.close();\r
+ }\r
}\r
}\r
}\r