]> git.donarmstrong.com Git - mothur.git/blobdiff - getsharedotucommand.cpp
added oligos class. added check orient parameter to trim.flows, sffinfo, fastq.info...
[mothur.git] / getsharedotucommand.cpp
index 1074d323e9aaeae08b69a2d546fdb8cae544d330..cfa7a645dfe7859552d5e22bfe929f03b852ae28 100644 (file)
@@ -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<string> 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<SharedRAbundVector*>& 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") {