-
- rename((trimSeqFile + toString(processIDS[0]) + ".temp").c_str(), trimSeqFile.c_str());
- rename((scrapSeqFile + toString(processIDS[0]) + ".temp").c_str(), scrapSeqFile.c_str());
- rename((groupFile + toString(processIDS[0]) + ".temp").c_str(), groupFile.c_str());
-
- if(qFileName != ""){
- rename((trimQualFile + toString(processIDS[0]) + ".temp").c_str(), trimQualFile.c_str());
- rename((scrapQualFile + toString(processIDS[0]) + ".temp").c_str(), scrapQualFile.c_str());
- }
-
-
- for (int j = 0; j < fastaFileNames.size(); j++) {
- rename((fastaFileNames[j] + toString(processIDS[0]) + ".temp").c_str(), fastaFileNames[j].c_str());
- }
- if(qFileName != ""){
- for (int j = 0; j < qualFileNames.size(); j++) {
- rename((qualFileNames[j] + toString(getpid()) + ".temp").c_str(), qualFileNames[j].c_str());
- }
- }
-
- //append files
- for(int i=1;i<processors;i++){
- m->appendFiles((trimSeqFile + toString(processIDS[i]) + ".temp"), trimSeqFile);
- remove((trimSeqFile + toString(processIDS[i]) + ".temp").c_str());
- m->appendFiles((scrapSeqFile + toString(processIDS[i]) + ".temp"), scrapSeqFile);
- remove((scrapSeqFile + toString(processIDS[i]) + ".temp").c_str());
-
- m->appendFiles((trimQualFile + toString(processIDS[i]) + ".temp"), trimQualFile);
- remove((trimQualFile + toString(processIDS[i]) + ".temp").c_str());
- m->appendFiles((scrapQualFile + toString(processIDS[i]) + ".temp"), scrapQualFile);
- remove((scrapQualFile + toString(processIDS[i]) + ".temp").c_str());
-
- m->appendFiles((groupFile + toString(processIDS[i]) + ".temp"), groupFile);
- remove((groupFile + toString(processIDS[i]) + ".temp").c_str());
- for (int j = 0; j < fastaFileNames.size(); j++) {
- m->appendFiles((fastaFileNames[j] + toString(processIDS[i]) + ".temp"), fastaFileNames[j]);
- remove((fastaFileNames[j] + toString(processIDS[i]) + ".temp").c_str());
- }
-
- if(qFileName != ""){
- for (int j = 0; j < qualFileNames.size(); j++) {
- m->appendFiles((qualFileNames[j] + toString(processIDS[i]) + ".temp"), qualFileNames[j]);
- remove((qualFileNames[j] + toString(processIDS[i]) + ".temp").c_str());
- }
- }
-
-
- }
- }
-
- if (m->control_pressed) { return 0; }