}
//sort lookup so shared bins are on top
- vector<string> sortedLabels = m->currentBinLabels;
+ vector<string> sortedLabels = m->currentSharedBinLabels;
if (sorted != "none") { sortedLabels = sortSharedVectors(lookup); }
vector<vector<string> > scaleRelAbund;
if (lookup[i]->getAbundance(j) != 0) { //don't want log value of 0.
if (scaler == "log10") {
- scaleRelAbund[i][j] = toHex(int(255 * log10(relAbund) / log10(maxRelAbund[i]))) + "0000";
+ if (maxRelAbund[i] == 1) { maxRelAbund[i] -= 0.001; }
+ if (relAbund == 1) { relAbund -= 0.001; }
+ scaleRelAbund[i][j] = toHex(int(255 * log10(relAbund) / log10(maxRelAbund[i]))) + "0000";
}else if (scaler == "log2") {
+ if (maxRelAbund[i] == 1) { maxRelAbund[i] -= 0.001; }
+ if (relAbund == 1) { relAbund -= 0.001; }
scaleRelAbund[i][j] = toHex(int(255 * log2(relAbund) / log2(maxRelAbund[i]))) + "0000";
}else if (scaler == "linear") {
- scaleRelAbund[i][j] = toHex(int(255 * relAbund / maxRelAbund[i])) + "0000";
+ scaleRelAbund[i][j] = toHex(int(255 * relAbund / maxRelAbund[i])) + "0000";
}else { //if user enters invalid scaler option.
+ if (maxRelAbund[i] == 1) { maxRelAbund[i] += 0.001; }
scaleRelAbund[i][j] = toHex(int(255 * log10(relAbund / log10(maxRelAbund[i])))) + "0000";
}
}else { scaleRelAbund[i][j] = "FFFFFF"; }
map<int, int> place; //spot in lookup where you insert shared by, ie, 3 -> 2 if they are shared by 3 inset into location 2.
map<int, int>::iterator it;
- vector<string> sortedLabels = m->currentBinLabels;
+ vector<string> sortedLabels = m->currentSharedBinLabels;
/****************** find order of otus **********************/
if (sorted == "shared") {
int newAbund = looktemp[j]->getAbundance(i); // 1 -> 3
lookup[j]->set(place[i], newAbund, looktemp[j]->getGroup()); //binNumber, abundance, group
}
- sortedLabels[place[i]] = m->currentBinLabels[i];
+ sortedLabels[place[i]] = m->currentSharedBinLabels[i];
}
//delete looktemp -- Sarah look at - this is causing segmentation faults
}
//sort lookup so shared bins are on top
- vector<string> sortedLabels = m->currentBinLabels;
+ vector<string> sortedLabels = m->currentSharedBinLabels;
if (sorted != "none") { sortedLabels = sortSharedVectors(lookup); }
vector<vector<string> > scaleRelAbund;
if (lookup[i]->getAbundance(j) != 0) { //don't want log value of 0.
if (scaler == "log10") {
+ if (maxRelAbund[i] == 1) { maxRelAbund[i] -= 0.001; }
+ if (relAbund == 1) { relAbund -= 0.001; }
scaleRelAbund[i][j] = toHex(int(255 * log10(relAbund) / log10(maxRelAbund[i]))) + "0000";
}else if (scaler == "log2") {
+ if (maxRelAbund[i] == 1) { maxRelAbund[i] -= 0.001; }
+ if (relAbund == 1) { relAbund -= 0.001; }
scaleRelAbund[i][j] = toHex(int(255 * log2(relAbund) / log2(maxRelAbund[i]))) + "0000";
}else if (scaler == "linear") {
- scaleRelAbund[i][j] = toHex(int(255 * relAbund / maxRelAbund[i])) + "0000";
+ scaleRelAbund[i][j] = toHex(int(255 * relAbund / maxRelAbund[i])) + "0000";
}else { //if user enters invalid scaler option.
scaleRelAbund[i][j] = toHex(int(255 * log10(relAbund / log10(maxRelAbund[i])))) + "0000";
}
map<int, int> place; //spot in lookup where you insert shared by, ie, 3 -> 2 if they are shared by 3 inset into location 2.
map<int, int>::iterator it;
- vector<string> sortedLabels = m->currentBinLabels;
+ vector<string> sortedLabels = m->currentSharedBinLabels;
/****************** find order of otus **********************/
if (sorted == "shared") {
for (int j = 0; j < looktemp.size(); j++) { // 3 -> 2
float newAbund = looktemp[j]->getAbundance(i); // 1 -> 3
lookup[j]->set(place[i], newAbund, looktemp[j]->getGroup()); //binNumber, abundance, group
- sortedLabels[place[i]] = m->currentBinLabels[i];
+ sortedLabels[place[i]] = m->currentSharedBinLabels[i];
}
}