- //grab data for each group
- for (map<string, string>::iterator itFileNameGroup = thisTypesFiles.begin(); itFileNameGroup != thisTypesFiles.end(); itFileNameGroup++) {
-
- string thisfilename = itFileNameGroup->first;
- map<int, int>::iterator itLine = lineToNumber.find(k);
- if (itLine != lineToNumber.end()) {
- string output = toString(itLine->second);
- if (k < files[thisfilename].size()) {
- string line = files[thisfilename][k];
- output = line.substr(0, line.find_first_of('\t'));
- output += '\t' + files[thisfilename][0] + '\t' + line.substr(line.find_first_of('\t'));
- }else{
- output += '\t' + files[thisfilename][0] + '\t';
- for (int h = 0; h < numColumns; h++) {
- output += "NA\t";
- }
- }
- out << output << endl;
- }else { m->mothurOut("[ERROR]: parsing results, cant find " + toString(k)); m->mothurOutEndLine(); }
- }
+ out << (*itNumSampled) << '\t';
+
+ if (m->control_pressed) { break; }
+
+ for (int k = 1; k < fileLabels[combineFileName].size(); k++) { //each chunk
+ //grab data for each group
+ for (map<string, map<int, vector< vector<string> > > >::iterator itFileNameGroup = files.begin(); itFileNameGroup != files.end(); itFileNameGroup++) {
+
+ string group = itFileNameGroup->first;
+
+ map<int, vector< vector<string> > >::iterator itLine = files[group].find(*itNumSampled);
+ if (itLine != files[group].end()) {
+ for (int l = 0; l < (itLine->second)[k].size(); l++) {
+ out << (itLine->second)[k][l] << '\t';
+
+ }
+ }else {
+ for (int l = 0; l < fileLabels[combineFileName][k].size(); l++) {
+ out << "NA" << '\t';
+ }
+ }
+ }
+ }
+ out << endl;