X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=getsharedotucommand.cpp;h=cfa7a645dfe7859552d5e22bfe929f03b852ae28;hb=a89c6295ae9a35fcaaab7fa50dcb68360dd543b0;hp=1074d323e9aaeae08b69a2d546fdb8cae544d330;hpb=e9845ee4c8db2e044e87d721cc2d94f8d609e03d;p=mothur.git diff --git a/getsharedotucommand.cpp b/getsharedotucommand.cpp index 1074d32..cfa7a64 100644 --- a/getsharedotucommand.cpp +++ b/getsharedotucommand.cpp @@ -233,6 +233,7 @@ GetSharedOTUCommand::GetSharedOTUCommand(string option) { else { userGroups = "unique." + groups; m->splitAtDash(groups, Groups); + if (Groups.size() > 4) { userGroups = "unique.selected_groups"; } //if too many groups then the filename becomes too big. } groups = validParameter.validFile(parameters, "sharedgroups", false); @@ -240,6 +241,7 @@ GetSharedOTUCommand::GetSharedOTUCommand(string option) { else { userGroups = groups; m->splitAtDash(groups, Groups); + if (Groups.size() > 4) { userGroups = "selected_groups"; } //if too many groups then the filename becomes too big. unique = false; } @@ -274,6 +276,7 @@ int GetSharedOTUCommand::execute(){ userGroups = "unique."; for(int i = 0; i < Groups.size(); i++) { userGroups += Groups[i] + "-"; } userGroups = userGroups.substr(0, userGroups.length()-1); + if (Groups.size() > 4) { userGroups = "unique.selected_groups"; } //if too many groups then the filename becomes too big. }else{ //sanity check for group names SharedUtil util; @@ -431,6 +434,7 @@ int GetSharedOTUCommand::process(ListVector* shared) { int num = 0; //go through each bin, find out if shared + vector binLabels = shared->getLabels(); for (int i = 0; i < shared->getNumBins(); i++) { if (m->control_pressed) { outNames.close(); m->mothurRemove(outputFileNames); return 0; } @@ -452,7 +456,7 @@ int GetSharedOTUCommand::process(ListVector* shared) { //find group string seqGroup = groupMap->getGroup(name); if (output != "accnos") { - namesOfSeqsInThisBin.push_back((name + "|" + seqGroup + "|" + toString(i+1))); + namesOfSeqsInThisBin.push_back((name + "|" + seqGroup + "|" + binLabels[i])); }else { namesOfSeqsInThisBin.push_back(name); } if (seqGroup == "not found") { m->mothurOut(name + " is not in your groupfile. Please correct."); m->mothurOutEndLine(); exit(1); } @@ -565,6 +569,7 @@ int GetSharedOTUCommand::runShared() { userGroups = "unique."; for(int i = 0; i < Groups.size(); i++) { userGroups += Groups[i] + "-"; } userGroups = userGroups.substr(0, userGroups.length()-1); + if (Groups.size() > 4) { userGroups = "unique.selected_groups"; } //if too many groups then the filename becomes too big. }else { //sanity check for group names SharedUtil util; @@ -691,7 +696,7 @@ int GetSharedOTUCommand::process(vector& lookup) { for(int j = 0; j < lookup.size(); j++) { string seqGroup = lookup[j]->getGroup(); - string name = m->currentBinLabels[i]; + string name = m->currentSharedBinLabels[i]; if (lookup[j]->getAbundance(i) != 0) { if (output != "accnos") {