- string newLine = labels.substr(0, labels.find_first_of('\t'));
-
- newLine += "\tGroup" + labels.substr(labels.find_first_of('\t'));
-
- temp[outputNames[i]] = file2Group[i];
- typesFiles[extension] = temp;
-
- string combineFileName = outputDir + m->getRootName(m->getSimpleName(sharedfile)) + "groups" + extension;
-
- //print headers
- ofstream out;
- m->openOutputFile(combineFileName, out);
- out << newLine << endl;
- out.close();
-
+
+ istringstream iss (labels,istringstream::in);
+ string newLabel = ""; vector<string> theseLabels;
+ while(!iss.eof()) { iss >> newLabel; m->gobble(iss); theseLabels.push_back(newLabel); }
+ vector< vector<string> > allLabels;
+ vector<string> thisSet; thisSet.push_back(theseLabels[0]); allLabels.push_back(thisSet); thisSet.clear(); //makes "numSampled" its own grouping
+ for (int j = 1; j < theseLabels.size()-1; j++) {
+ if (theseLabels[j+1] == "lci") {
+ thisSet.push_back(theseLabels[j]);
+ thisSet.push_back(theseLabels[j+1]);
+ thisSet.push_back(theseLabels[j+2]);
+ j++; j++;
+ }else{ //no lci or hci for this calc.
+ thisSet.push_back(theseLabels[j]);
+ }
+ allLabels.push_back(thisSet);
+ thisSet.clear();
+ }
+ fileLabels[combineFileName] = allLabels;
+
+ map<string, map<string, string> >::iterator itfind = typesFiles.find(extension);
+ if (itfind != typesFiles.end()) {
+ (itfind->second)[outputNames[i]] = file2Group[i];
+ }else {
+ map<string, string> temp;
+ temp[outputNames[i]] = file2Group[i];
+ typesFiles[extension] = temp;
+ }
+ if (!(m->inUsersGroups(file2Group[i], groupNames))) { groupNames.push_back(file2Group[i]); }