- //if the user has not entered specific groups to analyze then do them all
- if (globaldata->Groups.size() != 0) {
- if (globaldata->Groups[0] != "all") {
- //check that groups are valid
- for (int i = 0; i < globaldata->Groups.size(); i++) {
- if (globaldata->gGroupmap->isValidGroup(globaldata->Groups[i]) != true) {
- cout << globaldata->Groups[i] << " is not a valid group, and will be disregarded." << endl;
- // erase the invalid group from globaldata->Groups
- globaldata->Groups.erase(globaldata->Groups.begin()+i);
- }
- }
-
- //if the user only entered invalid groups
- if (globaldata->Groups.size() == 0) {
- cout << "When using the groups parameter you must have at least 1 valid groups. I will run the command using all the groups in your groupfile." << endl;
- for (int i = 0; i < globaldata->gGroupmap->namesOfGroups.size(); i++) {
- globaldata->Groups.push_back(globaldata->gGroupmap->namesOfGroups[i]);
- }
- }
- }else{//user has enter "all" and wants the default groups
- globaldata->Groups.clear();
- for (int i = 0; i < globaldata->gGroupmap->namesOfGroups.size(); i++) {
- globaldata->Groups.push_back(globaldata->gGroupmap->namesOfGroups[i]);
- }
- globaldata->setGroups("");
+ //copy lookup and then clear it to refill with sorted.
+ //loop though lookup and determine if they are shared
+ //if they are then insert in the front
+ //if not push to back
+
+ bool shared;
+ vector<SharedRAbundVector*> looktemp;
+
+ //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());