- globaldata = GlobalData::getInstance();
- vector<SharedRAbundVector*> lookup;
- vector<string> chosenGroups = globaldata->sharedGroups;
-
- //create and initialize vector of sharedvectors, one for each group
- for (int i = 0; i < globaldata->gGroupmap->getNumGroups(); i++) {
- SharedRAbundVector* temp = new SharedRAbundVector(sharedorder->getNumBins());
- temp->setLabel(sharedorder->getLabel());
- temp->setGroup(globaldata->gGroupmap->namesOfGroups[i]);
- temp->setGroupIndex(globaldata->gGroupmap->groupIndex[globaldata->gGroupmap->namesOfGroups[i]]);
- lookup.push_back(temp);
- }
-
- SharedCollectorsCurveData* ccd = new SharedCollectorsCurveData();
+ globaldata = GlobalData::getInstance();
+ vector<SharedRAbundVector*> lookup;
+ vector<SharedRAbundVector*> subset;
+
+ //create and initialize vector of sharedvectors, one for each group
+ for (int i = 0; i < globaldata->Groups.size(); i++) {
+ SharedRAbundVector* temp = new SharedRAbundVector(sharedorder->getNumBins());
+ temp->setLabel(sharedorder->getLabel());
+ temp->setGroup(globaldata->Groups[i]);
+ temp->setGroupIndex(globaldata->gGroupmap->groupIndex[globaldata->Groups[i]]);
+ lookup.push_back(temp);
+ }
+
+ SharedCollectorsCurveData* ccd = new SharedCollectorsCurveData();
+
+ //initialize labels for output
+ //makes 'uniqueAB uniqueAC uniqueBC' if your groups are A, B, C
+ getGroupComb();
+
+ for(int i=0;i<displays.size();i++){
+ ccd->registerDisplay(displays[i]); //adds a display[i] to cdd
+ bool hasLciHci = displays[i]->hasLciHci();
+ groupLabel = "";
+ for (int s = 0; s < groupComb.size(); s++) {
+ if (hasLciHci) { groupLabel = groupLabel + label + groupComb[s] + "\t" + label + groupComb[s] + "lci\t" + label + groupComb[s] + "hci\t"; }
+ else{ groupLabel = groupLabel + label + groupComb[s] + "\t"; }
+ }
+
+ string groupLabelAll = groupLabel + label + "all\t";
+ if ((displays[i]->isCalcMultiple() == true) && (displays[i]->getAll() == true)) { displays[i]->init(groupLabelAll); }
+ else { displays[i]->init(groupLabel); }
+ }
+
+ //convert freq percentage to number
+ int increment = 1;
+ if (percentFreq < 1.0) { increment = numSeqs * percentFreq; }
+ else { increment = percentFreq; }
+
+ //sample all the members
+ for(int i=0;i<numSeqs;i++){
+
+ if (m->control_pressed) { for (int j = 0; j < lookup.size(); j++) { delete lookup[j]; } delete ccd; return 1; }
+
+ //get first sample
+ individual chosen = sharedorder->get(i);
+ int abundance;
+
+ //set info for sharedvector in chosens group
+ for (int j = 0; j < lookup.size(); j++) {
+ if (chosen.group == lookup[j]->getGroup()) {
+ abundance = lookup[j]->getAbundance(chosen.bin);
+ lookup[j]->set(chosen.bin, (abundance + 1), chosen.group);
+ break;
+ }
+ }