int currentSeqsDiffs = 0;
Sequence currSeq(inFASTA); m->gobble(inFASTA);
-
QualityScores currQual;
if(qFileName != ""){
currQual = QualityScores(qFile); m->gobble(qFile);
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
unsigned long int pos = inFASTA.tellg();
if ((pos == -1) || (pos >= line->end)) { break; }
+
#else
if (inFASTA.eof()) { break; }
#endif
-
+
//report progress
if((count) % 1000 == 0){ m->mothurOut(toString(count)); m->mothurOutEndLine(); }
}
//report progress
if((count) % 1000 != 0){ m->mothurOut(toString(count)); m->mothurOutEndLine(); }
-
+
inFASTA.close();
trimFASTAFile.close();
qLines[process]);
//pass groupCounts to parent
- ofstream out;
- string tempFile = filename + toString(getpid()) + ".num.temp";
- m->openOutputFile(tempFile, out);
- for (map<string, int>::iterator it = groupCounts.begin(); it != groupCounts.end(); it++) {
- out << it->first << '\t' << it->second << endl;
+ if(oligoFile != ""){
+ ofstream out;
+ string tempFile = filename + toString(getpid()) + ".num.temp";
+ m->openOutputFile(tempFile, out);
+
+ out << groupCounts.size() << endl;
+
+ for (map<string, int>::iterator it = groupCounts.begin(); it != groupCounts.end(); it++) {
+ out << it->first << '\t' << it->second << endl;
+ }
+ out.close();
}
- out.close();
-
exit(0);
}else {
m->mothurOut("[ERROR]: unable to spawn the necessary processes."); m->mothurOutEndLine();
remove((scrapNameFileName + toString(processIDS[i]) + ".temp").c_str());
}
- m->appendFiles((groupFile + toString(processIDS[i]) + ".temp"), groupFile);
- remove((groupFile + toString(processIDS[i]) + ".temp").c_str());
+ if(oligoFile != ""){
+ m->appendFiles((groupFile + toString(processIDS[i]) + ".temp"), groupFile);
+ remove((groupFile + toString(processIDS[i]) + ".temp").c_str());
+ }
if(allFiles){
}
}
- ifstream in;
- string tempFile = filename + toString(processIDS[i]) + ".num.temp";
- m->openInputFile(tempFile, in);
- int tempNum;
- string group;
- while (!in.eof()) {
- in >> group >> tempNum; m->gobble(in);
+ if(oligoFile != ""){
+ ifstream in;
+ string tempFile = filename + toString(processIDS[i]) + ".num.temp";
+ m->openInputFile(tempFile, in);
+ int tempNum;
+ string group;
- map<string, int>::iterator it = groupCounts.find(group);
- if (it == groupCounts.end()) { groupCounts[group] = tempNum; }
- else { groupCounts[it->first] += tempNum; }
+ in >> tempNum; m->gobble(in);
+
+ if (tempNum != 0) {
+ while (!in.eof()) {
+ in >> group >> tempNum; m->gobble(in);
+
+ map<string, int>::iterator it = groupCounts.find(group);
+ if (it == groupCounts.end()) { groupCounts[group] = tempNum; }
+ else { groupCounts[it->first] += tempNum; }
+ }
+ }
+ in.close(); remove(tempFile.c_str());
}
- in.close(); remove(tempFile.c_str());
}