+}
+/***********************************************************************/
+vector<SharedRAbundVector*> SharedListVector::getSharedRAbundVector() {
+ try {
+ SharedUtil* util;
+ util = new SharedUtil();
+ vector<SharedRAbundVector*> lookup; //contains just the groups the user selected
+ map<string, SharedRAbundVector*> finder; //contains all groups in groupmap
+ string group, names, name;
+
+ util->setGroups(globaldata->Groups, globaldata->gGroupmap->namesOfGroups);
+ delete util;
+
+ for (int i = 0; i < globaldata->gGroupmap->namesOfGroups.size(); i++) {
+ SharedRAbundVector* temp = new SharedRAbundVector(data.size());
+ finder[globaldata->gGroupmap->namesOfGroups[i]] = temp;
+ finder[globaldata->gGroupmap->namesOfGroups[i]]->setLabel(label);
+ finder[globaldata->gGroupmap->namesOfGroups[i]]->setGroup(globaldata->gGroupmap->namesOfGroups[i]);
+ if (inVector(globaldata->gGroupmap->namesOfGroups[i], globaldata->Groups)) { //if this group is in user groups
+ lookup.push_back(finder[globaldata->gGroupmap->namesOfGroups[i]]);
+ }
+ }
+
+ //fill vectors
+ for(int i=0;i<numBins;i++){
+ names = get(i);
+ while (names.find_first_of(',') != -1) {
+ name = names.substr(0,names.find_first_of(','));
+ names = names.substr(names.find_first_of(',')+1, names.length());
+ group = groupmap->getGroup(name);
+ if(group == "not found") { m->mothurOut("Error: Sequence '" + name + "' was not found in the group file, please correct."); m->mothurOutEndLine(); exit(1); }
+ finder[group]->set(i, finder[group]->getAbundance(i) + 1, group); //i represents what bin you are in
+ }
+
+ //get last name
+ group = groupmap->getGroup(names);
+ if(group == "not found") { m->mothurOut("Error: Sequence '" + names + "' was not found in the group file, please correct."); m->mothurOutEndLine(); exit(1); }
+ finder[group]->set(i, finder[group]->getAbundance(i) + 1, group); //i represents what bin you are in
+
+ }
+
+ return lookup;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "SharedListVector", "getSharedRAbundVector");