]> git.donarmstrong.com Git - mothur.git/blobdiff - subsamplecommand.cpp
added save parameter to align.seqs, chimera commands, classify.seqs, and seq.error...
[mothur.git] / subsamplecommand.cpp
index a055e81a1a1f6228ee069ad38760868c7cbaf082..95a0442d6c970bd74a383c1e13765af305eeac57 100644 (file)
@@ -88,6 +88,7 @@ SubSampleCommand::SubSampleCommand(string option) {
                
                //allow user to run help
                if(option == "help") { help(); abort = true; calledHelp = true; }
+               else if(option == "citation") { citation(); abort = true; calledHelp = true;}
                
                else {
                        vector<string> myArray = setParameters();
@@ -181,32 +182,38 @@ SubSampleCommand::SubSampleCommand(string option) {
                        //check for required parameters
                        listfile = validParameter.validFile(parameters, "list", true);
                        if (listfile == "not open") { listfile = ""; abort = true; }
-                       else if (listfile == "not found") { listfile = ""; }    
+                       else if (listfile == "not found") { listfile = ""; }
+                       else { m->setListFile(listfile); }
                        
                        sabundfile = validParameter.validFile(parameters, "sabund", true);
                        if (sabundfile == "not open") { sabundfile = ""; abort = true; }        
                        else if (sabundfile == "not found") { sabundfile = ""; }
+                       else { m->setSabundFile(sabundfile); }
                        
                        rabundfile = validParameter.validFile(parameters, "rabund", true);
                        if (rabundfile == "not open") { rabundfile = ""; abort = true; }        
                        else if (rabundfile == "not found") { rabundfile = ""; }
+                       else { m->setRabundFile(rabundfile); }
                        
                        fastafile = validParameter.validFile(parameters, "fasta", true);
                        if (fastafile == "not open") { fastafile = ""; abort = true; }  
                        else if (fastafile == "not found") { fastafile = ""; }
+                       else { m->setFastaFile(fastafile); }
                        
                        sharedfile = validParameter.validFile(parameters, "shared", true);
                        if (sharedfile == "not open") { sharedfile = ""; abort = true; }        
                        else if (sharedfile == "not found") { sharedfile = ""; }
+                       else { m->setSharedFile(sharedfile); }
                        
                        namefile = validParameter.validFile(parameters, "name", true);
                        if (namefile == "not open") { namefile = ""; abort = true; }    
                        else if (namefile == "not found") { namefile = ""; }
+                       else { m->setNameFile(namefile); }
                        
                        groupfile = validParameter.validFile(parameters, "group", true);
                        if (groupfile == "not open") { groupfile = ""; abort = true; }  
                        else if (groupfile == "not found") { groupfile = ""; }
-                       
+                       else { m->setGroupFile(groupfile); }
                        
                        //check for optional parameter and set defaults
                        // ...at some point should added some additional type checking...
@@ -701,6 +708,7 @@ int SubSampleCommand::getSubSampleShared() {
                                
                                m->mothurOut(lookup[0]->getLabel()); m->mothurOutEndLine();
                                
+                               if (!m->printedHeaders) { lookup[0]->printHeaders(out); }
                                processShared(lookup, out);
                                
                                processedLabels.insert(lookup[0]->getLabel());
@@ -715,6 +723,7 @@ int SubSampleCommand::getSubSampleShared() {
                                lookup = input->getSharedRAbundVectors(lastLabel);
                                m->mothurOut(lookup[0]->getLabel()); m->mothurOutEndLine();
                                
+                               if (!m->printedHeaders) { lookup[0]->printHeaders(out); }
                                processShared(lookup, out);
                                
                                processedLabels.insert(lookup[0]->getLabel());
@@ -755,6 +764,7 @@ int SubSampleCommand::getSubSampleShared() {
                        
                        m->mothurOut(lookup[0]->getLabel()); m->mothurOutEndLine();
                        
+                       if (!m->printedHeaders) { lookup[0]->printHeaders(out); }
                        processShared(lookup, out);
                        
                        for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  }
@@ -1146,7 +1156,7 @@ int SubSampleCommand::processList(ListVector*& list, ofstream& out, set<string>&
                                        individual += binnames[j];
                                }
                        }
-                       if (subset.count(individual) != 0) {  newNames += individual;  }
+                       if (subset.count(individual) != 0) {  newNames += individual + ",";  }
                        
                        
                        //if there are names in this bin add to new list