+ if (m->groupMode == "group") {
+ groupmap = new GroupMap(m->getGroupFile());
+ groupmap->readMap();
+ }else {
+ countTable = new CountTable();
+ countTable->readTable(m->getCountTableFile(), true, false);
+ }
+
+ int hold;
+
+ //are we at the beginning of the file??
+ if (m->saveNextLabel == "") {
+ f >> label;
+
+ //is this a shared file that has headers
+ if (label == "label") {
+
+ //gets "numOtus"
+ f >> label; m->gobble(f);
+
+ //eat rest of line
+ label = m->getline(f); m->gobble(f);
+
+ //parse labels to save
+ istringstream iStringStream(label);
+ m->listBinLabelsInFile.clear();
+ while(!iStringStream.eof()){
+ if (m->control_pressed) { break; }
+ string temp;
+ iStringStream >> temp; m->gobble(iStringStream);
+
+ m->listBinLabelsInFile.push_back(temp);
+ }
+
+ f >> label >> hold;
+ }else {
+ //read in first row
+ f >> hold;
+
+ //make binlabels because we don't have any
+ string snumBins = toString(hold);
+ m->listBinLabelsInFile.clear();
+ for (int i = 0; i < hold; i++) {
+ //if there is a bin label use it otherwise make one
+ string binLabel = "Otu";
+ string sbinNumber = toString(i+1);
+ if (sbinNumber.length() < snumBins.length()) {
+ int diff = snumBins.length() - sbinNumber.length();
+ for (int h = 0; h < diff; h++) { binLabel += "0"; }
+ }
+ binLabel += sbinNumber;
+ m->listBinLabelsInFile.push_back(binLabel);
+ }
+ }
+ m->saveNextLabel = label;
+ }else {
+ f >> label >> hold;
+ m->saveNextLabel = label;
+ }
+
+ binLabels.assign(m->listBinLabelsInFile.begin(), m->listBinLabelsInFile.begin()+hold);
+