+
+ vector<SharedRAbundVector*> looktemp;
+ 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;
+
+ /****************** find order of otus **********************/
+ if (sorted == "shared") {
+ place = orderShared(lookup);
+ }else if (sorted == "topotu") {
+ place = orderTopOtu(lookup);
+ }else if (sorted == "topgroup") {
+ place = orderTopGroup(lookup);
+ }else { m->mothurOut("Error: invalid sort option."); m->mothurOutEndLine(); return 1; }
+
+
+ /******************* create copy of lookup *********************/
+ //create and initialize looktemp as a copy of lookup
+ for (int i = 0; i < lookup.size(); i++) {
+ SharedRAbundVector* temp = new SharedRAbundVector(lookup[i]->getNumBins());
+ temp->setLabel(lookup[i]->getLabel());
+ temp->setGroup(lookup[i]->getGroup());
+ //copy lookup i's info
+ for (int j = 0; j < lookup[i]->size(); j++) {
+ temp->set(j, lookup[i]->getAbundance(j), lookup[i]->getGroup());
+ }
+ looktemp.push_back(temp);
+ }