- if (updatePlace == true) {
- //move place holders below where you entered up to "make space" for you entry
- for (it = place.begin(); it!= place.end(); it++) {
- if (it->first < count) { it->second++; }
- }
+ binCount temp(i, total);
+
+ totals.push_back(temp);
+ }
+
+ sort(totals.begin(), totals.end(), comparebinCounts);
+
+ //fill place
+ for (int i = 0; i < totals.size(); i++) { place[totals[i].bin] = i; }
+
+ return place;
+
+ }
+ catch(exception& e) {
+ m->errorOut(e, "HeatMap", "orderTopOtu");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+map<int, int> HeatMap::orderTopGroup(vector<SharedRAbundVector*>& lookup){
+ try {
+
+ 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 < vector<binCount> > totals; //totals[0] = bin totals for group 0, totals[1] = bin totals for group 1, ...
+ totals.resize(lookup.size());
+
+ //for each bin
+ for (int i = 0; i < lookup[0]->size(); i++) {
+ for (int j = 0; j < lookup.size(); j++) {
+ binCount temp(i, (lookup[j]->getAbundance(i)));
+ totals[j].push_back(temp);