+ m->errorOut(e, "CorrAxesCommand", "readAxes");
+ exit(1);
+ }
+}
+/*****************************************************************/
+int CorrAxesCommand::getMetadata(){
+ try {
+ vector<string> groupNames;
+
+ ifstream in;
+ m->openInputFile(axesfile, in);
+
+ string headerLine = m->getline(in); m->gobble(in);
+ istringstream iss (headerLine,istringstream::in);
+
+ //read the first label, because it refers to the groups
+ string columnLabel;
+ iss >> columnLabel; m->gobble(iss);
+
+ //save names of columns you are reading
+ while (!iss.eof()) {
+ iss >> columnLabel; m->gobble(iss);
+ metadataLabels.push_back(columnLabel);
+ }
+ int count = metadataLabels.size();
+
+ //read rest of file
+ while (!in.eof()) {
+
+ if (m->control_pressed) { in.close(); return 0; }
+
+ string group = "";
+ in >> group; m->gobble(in);
+ groupNames.push_back(group);
+
+ SharedRAbundFloatVector* tempLookup = new SharedRAbundFloatVector();
+ tempLookup->setGroup(group);
+ tempLookup->setLabel("1");
+
+ for (int i = 0; i < count; i++) {
+ float temp = 0.0;
+ in >> temp;
+
+ tempLookup->push_back(temp, group);
+ }
+
+ lookupFloat.push_back(tempLookup);
+
+ m->gobble(in);
+ }
+ in.close();
+
+ //remove any groups the user does not want, and set globaldata->groups with only valid groups
+ SharedUtil* util;
+ util = new SharedUtil();
+
+ util->setGroups(globaldata->Groups, groupNames);
+
+ for (int i = 0; i < lookupFloat.size(); i++) {
+ //if this sharedrabund is not from a group the user wants then delete it.
+ if (util->isValidGroup(lookupFloat[i]->getGroup(), globaldata->Groups) == false) {
+ delete lookupFloat[i]; lookupFloat[i] = NULL;
+ lookupFloat.erase(lookupFloat.begin()+i);
+ i--;
+ }
+ }
+
+ delete util;
+
+ return 0;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "CorrAxesCommand", "getMetadata");