}
//for each bin
+ vector<string> newBinLabels;
for (int i = 0; i < thislookup[0]->getNumBins(); i++) {
if (m->control_pressed) { for (int j = 0; j < newLookup.size(); j++) { delete newLookup[j]; } return 0; }
for (int j = 0; j < thislookup.size(); j++) {
newLookup[j]->push_back(thislookup[j]->getAbundance(i), thislookup[j]->getGroup());
}
+
+ //if there is a bin label use it otherwise make one
+ string binLabel = "Otu" + toString(i+1);
+ if (i < m->currentBinLabels.size()) { binLabel = m->currentBinLabels[i]; }
+
+ newBinLabels.push_back(binLabel);
}
}
for (int j = 0; j < thislookup.size(); j++) { delete thislookup[j]; }
thislookup = newLookup;
+ m->currentBinLabels = newBinLabels;
return 0;
//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()) {
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);
}