-//**********************************************************************************************************************
-void HeatMap::getSharedVectors(SharedOrderVector* order){
- try {
-
- //delete lookup
- for (int j = 0; j < lookup.size(); j++) {
- delete lookup[j];
- }
-
- lookup.clear();
-
- groupComb = "";
-
- //create and initialize vector of sharedvectors, one for each group
- for (int i = 0; i < globaldata->Groups.size(); i++) {
- SharedRAbundVector* temp = new SharedRAbundVector(order->getNumBins());
- temp->setLabel(order->getLabel());
- temp->setGroup(globaldata->Groups[i]);
- groupComb += globaldata->Groups[i];
- lookup.push_back(temp);
- }
-
- int numSeqs = order->size();
- //sample all the members
- for(int i=0;i<numSeqs;i++){
- //get first sample
- individual chosen = order->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;
- }
- }
- }
-
- }
- catch(exception& e) {
- cout << "Standard Error: " << e.what() << " has occurred in the HeatMap class Function getSharedVectors. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
- catch(...) {
- cout << "An unknown error has occurred in the HeatMap class function getSharedVectors. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
- exit(1);
- }
-
-}
-