]> git.donarmstrong.com Git - mothur.git/commitdiff
working on current change
authorwestcott <westcott>
Tue, 14 Jun 2011 14:22:10 +0000 (14:22 +0000)
committerwestcott <westcott>
Tue, 14 Jun 2011 14:22:10 +0000 (14:22 +0000)
39 files changed:
aligncommand.cpp
amovacommand.cpp
anosimcommand.cpp
binsequencecommand.cpp
bootstrapsharedcommand.cpp
catchallcommand.cpp
chimerabellerophoncommand.cpp
chimeraccodecommand.cpp
chimeracheckcommand.cpp
chimerapintailcommand.cpp
chimeraslayercommand.cpp
chimerauchimecommand.cpp
chopseqscommand.cpp
classifyotucommand.cpp
classifyseqscommand.cpp
clearcutcommand.cpp
clustercommand.cpp
clusterdoturcommand.cpp
clusterfragmentscommand.cpp
clustersplitcommand.cpp
collectcommand.cpp
collectsharedcommand.cpp
consensusseqscommand.cpp
corraxescommand.cpp
countseqscommand.cpp
deconvolutecommand.cpp
degapseqscommand.cpp
deuniqueseqscommand.cpp
deuniquetreecommand.cpp
distancecommand.cpp
filterseqscommand.cpp
getcommandinfocommand.cpp
getgroupcommand.cpp
qualityscores.cpp
seqerrorcommand.cpp
seqerrorcommand.h
sffinfocommand.cpp
systemcommand.cpp
trimseqscommand.cpp

index 95604fc4ff4f738dc780de23b01ab65d4f473fe7..5da0ee8d0f091b8ce07acdedd48d2069e53ec1e9 100644 (file)
@@ -224,6 +224,8 @@ AlignCommand::AlignCommand(string option)  {
                                                        //erase from file list
                                                        candidateFileNames.erase(candidateFileNames.begin()+i);
                                                        i--;
+                                               }else {
+                                                       m->setFastaFile(candidateFileNames[i]);
                                                }
                                        }
                                }
index ad5823b15e108396ee1b0e0977167c8e4f1fbb22..141673375fb8bb1a37e67980df9708fe6d2da126 100644 (file)
@@ -122,17 +122,17 @@ AmovaCommand::AmovaCommand(string option) {
                                phylipFileName = m->getPhylipFile(); 
                                if (phylipFileName != "") { m->mothurOut("Using " + phylipFileName + " as input file for the phylip parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current phylip file and the phylip parameter is required."); m->mothurOutEndLine(); abort = true; }
-                       }       
+                       }else { m->setPhylipFile(phylipFileName); }
                        
                        //check for required parameters
                        designFileName = validParameter.validFile(parameters, "design", true);
-                       if (designFileName == "not open") { abort = true; }
+                       if (designFileName == "not open") { designFileName = ""; abort = true; }
                        else if (designFileName == "not found") {
                                //if there is a current design file, use it
                                designFileName = m->getDesignFile(); 
                                if (designFileName != "") { m->mothurOut("Using " + designFileName + " as input file for the design parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current design file and the design parameter is required."); m->mothurOutEndLine(); abort = true; }                           
-                       }       
+                       }else { m->setDesignFile(designFileName); }     
 
                        string temp = validParameter.validFile(parameters, "iters", false);
                        if (temp == "not found") { temp = "1000"; }
index 6f9e53839200ce251b0f607f0b776e075a4dffd4..c5cb4d60c751d6614b82cd961c29d9e645fcbaa8 100644 (file)
@@ -124,17 +124,17 @@ AnosimCommand::AnosimCommand(string option) {
                                if (phylipFileName != "") { m->mothurOut("Using " + phylipFileName + " as input file for the phylip parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current phylip file and the phylip parameter is required."); m->mothurOutEndLine(); abort = true; }
                                
-                       }       
+                       }else { m->setPhylipFile(phylipFileName); }     
                        
                        //check for required parameters
                        designFileName = validParameter.validFile(parameters, "design", true);
-                       if (designFileName == "not open") { abort = true; }
+                       if (designFileName == "not open") { designFileName = ""; abort = true; }
                        else if (designFileName == "not found") {
                                //if there is a current design file, use it
                                designFileName = m->getDesignFile(); 
                                if (designFileName != "") { m->mothurOut("Using " + designFileName + " as input file for the design parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current design file and the design parameter is required."); m->mothurOutEndLine(); abort = true; }                                                           
-                       }       
+                       }else { m->setDesignFile(designFileName); }     
                        
                        string temp = validParameter.validFile(parameters, "iters", false);
                        if (temp == "not found") { temp = "1000"; }
index c4ef741f80c22bc784df4e6916f4a214fb2feacd..8e8ec2bc51362d8b8876d6e3cbb10ef9ff5e167e 100644 (file)
@@ -138,6 +138,7 @@ BinSeqCommand::BinSeqCommand(string option) {
                                else {  m->mothurOut("You have no current fasta file and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; }
                        }
                        else if (fastafile == "not open") { abort = true; }     
+                       else { m->setFastaFile(fastafile); }
                        
                        listfile = validParameter.validFile(parameters, "list", true);
                        if (listfile == "not found") {                  
@@ -146,6 +147,7 @@ BinSeqCommand::BinSeqCommand(string option) {
                                else {  m->mothurOut("You have no current list file and the list parameter is required."); m->mothurOutEndLine(); abort = true; }
                        }
                        else if (listfile == "not open") { listfile = ""; abort = true; }       
+                       else { m->setListFile(listfile); }
                        
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
                        outputDir = validParameter.validFile(parameters, "outputdir", false);           if (outputDir == "not found"){  
@@ -167,10 +169,12 @@ BinSeqCommand::BinSeqCommand(string option) {
                        namesfile = validParameter.validFile(parameters, "name", true);
                        if (namesfile == "not open") { abort = true; }  
                        else if (namesfile == "not found") { namesfile = ""; }
+                       else {  m->setNameFile(namesfile); }
 
                        groupfile = validParameter.validFile(parameters, "group", true);
                        if (groupfile == "not open") { abort = true; }
                        else if (groupfile == "not found") { groupfile = ""; }
+                       else { m->setGroupFile(groupfile); }
                        
                }
        }
index f63f2f496d05ac403cc7584db343067771e5ebb7..478821ec861e7b537e6f15b8c44bdab86a8d2c9f 100644 (file)
@@ -113,8 +113,13 @@ BootSharedCommand::BootSharedCommand(string option) {
                        }
                        
                        sharedfile = validParameter.validFile(parameters, "shared", true);
-                       if (sharedfile == "not found") { m->mothurOut("shared is a required parameter.");  m->mothurOutEndLine(); sharedfile = ""; abort = true; }
+                       if (sharedfile == "not found") { 
+                               sharedfile = m->getSharedFile(); 
+                               if (sharedfile != "") { m->mothurOut("Using " + sharedfile + " as input file for the shared parameter."); m->mothurOutEndLine(); }
+                               else {  m->mothurOut("You have no current shared file and the shared parameter is required."); m->mothurOutEndLine(); abort = true; }
+                       }       
                        else if (sharedfile == "not open") { sharedfile = ""; abort = true; }
+                       else { m->setSharedFile(sharedfile); }
                
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
                        outputDir = validParameter.validFile(parameters, "outputdir", false);           if (outputDir == "not found"){  
index 29f2220dcc512d7a5db58bfee3c3767418ff7aa7..fd51664a21ffa6373ebf9fd46d0fe5f586eb288c 100644 (file)
@@ -119,10 +119,12 @@ CatchAllCommand::CatchAllCommand(string option)  {
                        sabundfile = validParameter.validFile(parameters, "sabund", true);
                        if (sabundfile == "not open") { sabundfile = ""; abort = true; }
                        else if (sabundfile == "not found") { sabundfile = "";  }
+                       else { m->setSabundFile(sabundfile); }
                        
                        sharedfile = validParameter.validFile(parameters, "shared", true);
                        if (sharedfile == "not open") { sharedfile = ""; abort = true; }
                        else if (sharedfile == "not found") { sharedfile = "";   }
+                       else { m->setSharedFile(sharedfile); }
                        
                        string label = validParameter.validFile(parameters, "label", false);                    
                        if (label == "not found") { label = ""; }
index 7a62d5bb447c3c20d155b15a5edf5f6b71b19b37..0031acb15b750823bb8cb3afed79d79f9a07d399 100644 (file)
@@ -171,6 +171,8 @@ ChimeraBellerophonCommand::ChimeraBellerophonCommand(string option)  {
                                                        //erase from file list
                                                        fastaFileNames.erase(fastaFileNames.begin()+i);
                                                        i--;
+                                               }else {
+                                                       m->setFastaFile(fastaFileNames[i]);
                                                }
                                        }
                                }
index df4e67db118462e1115857331c7adcc4551a272c..bc96e0530993e63cf099381a1ccd8829f9cc7714 100644 (file)
@@ -185,6 +185,8 @@ ChimeraCcodeCommand::ChimeraCcodeCommand(string option)  {
                                                        //erase from file list
                                                        fastaFileNames.erase(fastaFileNames.begin()+i);
                                                        i--;
+                                               }else {
+                                                       m->setFastaFile(fastaFileNames[i]);
                                                }
                                        }
                                }
index d82a84a1b86ab5643e0416d8d73091ce16b29e23..5b249d7ff6892a53ce0493c3fa5319468681a8bd 100644 (file)
@@ -183,6 +183,8 @@ ChimeraCheckCommand::ChimeraCheckCommand(string option)  {
                                                        //erase from file list
                                                        fastaFileNames.erase(fastaFileNames.begin()+i);
                                                        i--;
+                                               }else {
+                                                       m->setFastaFile(fastaFileNames[i]);
                                                }
                                        }
                                }
@@ -262,6 +264,8 @@ ChimeraCheckCommand::ChimeraCheckCommand(string option)  {
                                                        //erase from file list
                                                        nameFileNames.erase(nameFileNames.begin()+i);
                                                        i--;
+                                               }else {
+                                                       m->setNameFile(nameFileNames[i]);
                                                }
                                        }
                                }
index 94c2bf5c1a392a8f12398db3806a503cd099f3bc..482bf7b5c2a67e57aaefc4cf4fc93c76a2b78611 100644 (file)
@@ -205,6 +205,8 @@ ChimeraPintailCommand::ChimeraPintailCommand(string option)  {
                                                        //erase from file list
                                                        fastaFileNames.erase(fastaFileNames.begin()+i);
                                                        i--;
+                                               }else {
+                                                       m->setFastaFile(fastaFileNames[i]);
                                                }
                                        }
                                }
index fed36135db3116567dea8b323f9ec0803cd29da8..636e17536a024f04476fc04ce431bb6524e29839 100644 (file)
@@ -205,6 +205,8 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option)  {
                                                        //erase from file list
                                                        fastaFileNames.erase(fastaFileNames.begin()+i);
                                                        i--;
+                                               }else {
+                                                       m->setFastaFile(fastaFileNames[i]);
                                                }
                                        }
                                }
@@ -279,6 +281,8 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option)  {
                                                        //erase from file list
                                                        nameFileNames.erase(nameFileNames.begin()+i);
                                                        i--;
+                                               }else {
+                                                       m->setNameFile(nameFileNames[i]);
                                                }
                                        }
                                }
index 33b48bd184ba95f1db5e1db2117a32a64254c664..375964c306651e93c07966d464b02cf24acb187c 100644 (file)
@@ -209,6 +209,8 @@ ChimeraUchimeCommand::ChimeraUchimeCommand(string option)  {
                                                        //erase from file list
                                                        fastaFileNames.erase(fastaFileNames.begin()+i);
                                                        i--;
+                                               }else {
+                                                       m->setFastaFile(fastaFileNames[i]);
                                                }
                                        }
                                }
@@ -283,6 +285,8 @@ ChimeraUchimeCommand::ChimeraUchimeCommand(string option)  {
                                                        //erase from file list
                                                        nameFileNames.erase(nameFileNames.begin()+i);
                                                        i--;
+                                               }else {
+                                                       m->setNameFile(nameFileNames[i]);
                                                }
                                        }
                                }
index 0e500d4982d372c95436b99e1ead81cb3c02a9c5..fc4327f210d04241b5c1e7a6056759525998c738 100644 (file)
@@ -115,7 +115,7 @@ ChopSeqsCommand::ChopSeqsCommand(string option)  {
                                fastafile = m->getFastaFile(); 
                                if (fastafile != "") { m->mothurOut("Using " + fastafile + " as input file for the fasta parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current fastafile and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; }
-                       }       
+                       }else { m->setFastaFile(fastafile); }   
                        
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
                        outputDir = validParameter.validFile(parameters, "outputdir", false);           if (outputDir == "not found"){  outputDir = m->hasPath(fastafile);      }
index eaf8cc206cebfe6eb1a60b40ff7042ede86ef6bd..d065b3a37c5ac41f9c6c3b59eb9ca3832f8697a9 100644 (file)
@@ -166,6 +166,7 @@ ClassifyOtuCommand::ClassifyOtuCommand(string option)  {
                                else {  m->mothurOut("You have no current listfile and the list parameter is required."); m->mothurOutEndLine(); abort = true; }
                        }
                        else if (listfile == "not open") { abort = true; }      
+                       else { m->setListFile(listfile); }
                        
                        taxfile = validParameter.validFile(parameters, "taxonomy", true);
                        if (taxfile == "not found") {  //if there is a current list file, use it
@@ -174,6 +175,7 @@ ClassifyOtuCommand::ClassifyOtuCommand(string option)  {
                                else {  m->mothurOut("You have no current taxonomy file and the taxonomy parameter is required."); m->mothurOutEndLine(); abort = true; }
                        }
                        else if (taxfile == "not open") { abort = true; }
+                       else { m->setTaxonomyFile(taxfile); }
                        
                        refTaxonomy = validParameter.validFile(parameters, "reftaxonomy", true);
                        if (refTaxonomy == "not found") { refTaxonomy = ""; m->mothurOut("reftaxonomy is not required, but if given will keep the rankIDs in the summary file static."); m->mothurOutEndLine(); }
@@ -182,10 +184,12 @@ ClassifyOtuCommand::ClassifyOtuCommand(string option)  {
                        namefile = validParameter.validFile(parameters, "name", true);
                        if (namefile == "not open") { abort = true; }   
                        else if (namefile == "not found") { namefile = ""; }
+                       else { m->setNameFile(namefile); }
                        
                        groupfile = validParameter.validFile(parameters, "group", true);
                        if (groupfile == "not open") { 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...
index 0d5ef61bbf939ce103d38f2ef36473abb01d3efa..72ca1d00fed7815ef68a8f1dc321c8c911eaeff0 100644 (file)
@@ -239,6 +239,8 @@ ClassifySeqsCommand::ClassifySeqsCommand(string option)  {
                                                        //erase from file list
                                                        fastaFileNames.erase(fastaFileNames.begin()+i);
                                                        i--;
+                                               }else {
+                                                       m->setFastaFile(fastaFileNames[i]);
                                                }
                                        }
                                        
@@ -319,6 +321,8 @@ ClassifySeqsCommand::ClassifySeqsCommand(string option)  {
                                                        //erase from file list
                                                        namefileNames.erase(namefileNames.begin()+i);
                                                        i--;
+                                               }else {
+                                                       m->setNameFile(namefileNames[i]);
                                                }
                                        }
                                }
@@ -375,6 +379,8 @@ ClassifySeqsCommand::ClassifySeqsCommand(string option)  {
                                                //erase from file list
                                                groupfileNames.erase(groupfileNames.begin()+i);
                                                i--;
+                                       }else {
+                                               m->setGroupFile(groupfileNames[i]);
                                        }
                                }
                        }
index 04dbc79aa15d3c4b6913a2e8131283b849dd90b9..29a5d725ff121b47b5c8f3132f54776f3e8a34ff 100644 (file)
@@ -155,12 +155,12 @@ ClearcutCommand::ClearcutCommand(string option)  {
                        fastafile = validParameter.validFile(parameters, "fasta", true);
                        if (fastafile == "not open") { fastafile = ""; abort = true; }
                        else if (fastafile == "not found") { fastafile = ""; }  
-                       else { inputFile = fastafile;  }
+                       else { inputFile = fastafile;  m->setFastaFile(fastafile); }
                        
                        phylipfile = validParameter.validFile(parameters, "phylip", true);
                        if (phylipfile == "not open") { phylipfile = ""; abort = true; }
                        else if (phylipfile == "not found") { phylipfile = ""; }
-                       else { inputFile = phylipfile;  }
+                       else { inputFile = phylipfile;  m->setPhylipFile(phylipfile); }
                                
                        if ((phylipfile == "") && (fastafile == "")) {  
                                //is there are current file available for either of these?
index 16348c8d324a962ca336c82a2ad303f156cde9e3..fd1f841dacab7ea017f15400766f384f10789cf3 100644 (file)
@@ -135,16 +135,17 @@ ClusterCommand::ClusterCommand(string option)  {
                        phylipfile = validParameter.validFile(parameters, "phylip", true);
                        if (phylipfile == "not open") { phylipfile = ""; abort = true; }
                        else if (phylipfile == "not found") { phylipfile = ""; }        
-                       else {  distfile = phylipfile;  format = "phylip";      }
+                       else {  distfile = phylipfile;  format = "phylip";      m->setPhylipFile(phylipfile); }
                        
                        columnfile = validParameter.validFile(parameters, "column", true);
                        if (columnfile == "not open") { columnfile = ""; abort = true; }        
                        else if (columnfile == "not found") { columnfile = ""; }
-                       else {  distfile = columnfile; format = "column";       }
+                       else {  distfile = columnfile; format = "column"; m->setColumnFile(columnfile); }
                        
                        namefile = validParameter.validFile(parameters, "name", true);
                        if (namefile == "not open") { abort = true; }   
                        else if (namefile == "not found") { namefile = ""; }
+                       else { m->setNameFile(namefile); }
                        
                        if ((phylipfile == "") && (columnfile == "")) { 
                                //is there are current file available for either of these?
index 9f51a8cfd07d83887010f2612831f2eb72e323a7..3f629dc09af39d7c9785a18687d9aecb8bee5f58 100644 (file)
@@ -132,13 +132,14 @@ ClusterDoturCommand::ClusterDoturCommand(string option)  {
                                        m->mothurOut("You need to provide a phylip file with the cluster.classic command."); m->mothurOutEndLine(); 
                                        abort = true; 
                                }       
-                       }       
+                       }else { m->setPhylipFile(phylipfile); } 
 
                
                        //check for optional parameter and set defaults
                        namefile = validParameter.validFile(parameters, "name", true);
                        if (namefile == "not open") { abort = true; }   
                        else if (namefile == "not found") { namefile = ""; }
+                       else { m->setNameFile(namefile); }
                        
                        string temp;
                        temp = validParameter.validFile(parameters, "precision", false);
index 2e37e7caedc35b67609e7c27e263261abd6f88f9..71ce5eed4e6e21c63210be0e34eb9a6f72dac59b 100644 (file)
@@ -138,6 +138,7 @@ ClusterFragmentsCommand::ClusterFragmentsCommand(string option) {
                                else {  m->mothurOut("You have no current fastafile and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; }
                        }
                        else if (fastafile == "not open") { fastafile = ""; abort = true; }     
+                       else { m->setFastaFile(fastafile); }
                        
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
                        outputDir = validParameter.validFile(parameters, "outputdir", false);           if (outputDir == "not found"){  outputDir = m->hasPath(fastafile);      }
@@ -147,7 +148,7 @@ ClusterFragmentsCommand::ClusterFragmentsCommand(string option) {
                        namefile = validParameter.validFile(parameters, "name", true);
                        if (namefile == "not found") { namefile =  "";  }
                        else if (namefile == "not open") { abort = true; }      
-                       else {  readNameFile();  }
+                       else {  readNameFile(); m->setNameFile(namefile); }
                        
                        string temp;
                        temp = validParameter.validFile(parameters, "diffs", false);            if (temp == "not found"){       temp = "0";                             }
index bdc8075342de2f484238c4810ee4da5babb0356c..9999eb0fb81e461e9f168c2c81b7531a3774607a 100644 (file)
@@ -183,25 +183,27 @@ ClusterSplitCommand::ClusterSplitCommand(string option)  {
                        phylipfile = validParameter.validFile(parameters, "phylip", true);
                        if (phylipfile == "not open") { abort = true; }
                        else if (phylipfile == "not found") { phylipfile = ""; }        
-                       else {  distfile = phylipfile;  format = "phylip";      }
+                       else {  distfile = phylipfile;  format = "phylip";      m->setPhylipFile(phylipfile); }
                        
                        columnfile = validParameter.validFile(parameters, "column", true);
                        if (columnfile == "not open") { abort = true; } 
                        else if (columnfile == "not found") { columnfile = ""; }
-                       else {  distfile = columnfile; format = "column";       }
+                       else {  distfile = columnfile; format = "column";       m->setColumnFile(columnfile); }
                        
                        namefile = validParameter.validFile(parameters, "name", true);
                        if (namefile == "not open") { abort = true; }   
-                       else if (namefile == "not found") { namefile = ""; }
+                       else if (namefile == "not found") { namefile = "";  }
+                       else { m->setNameFile(namefile); }
                        
                        fastafile = validParameter.validFile(parameters, "fasta", true);
                        if (fastafile == "not open") { abort = true; }  
                        else if (fastafile == "not found") { fastafile = ""; }
-                       else { distfile = fastafile;  splitmethod = "fasta";  }
+                       else { distfile = fastafile;  splitmethod = "fasta";  m->setFastaFile(fastafile); }
                        
                        taxFile = validParameter.validFile(parameters, "taxonomy", true);
                        if (taxFile == "not open") { abort = true; }    
                        else if (taxFile == "not found") { taxFile = ""; }
+                       else {  m->setTaxonomyFile(taxFile); }
                        
                        if ((phylipfile == "") && (columnfile == "") && (fastafile == "")) { 
                                //is there are current file available for either of these?
index 7b8364b9b25d07e457508dbe5fe0153a4cc3a27f..5bd9fd75c474aeafdf632d8800b9c184916ccc83 100644 (file)
@@ -211,22 +211,22 @@ CollectCommand::CollectCommand(string option)  {
                        listfile = validParameter.validFile(parameters, "list", true);
                        if (listfile == "not open") { listfile = ""; abort = true; }
                        else if (listfile == "not found") { listfile = ""; }
-                       else {  format = "list"; inputfile = listfile; }
+                       else {  format = "list"; inputfile = listfile; m->setListFile(listfile); }
                        
                        sabundfile = validParameter.validFile(parameters, "sabund", true);
                        if (sabundfile == "not open") { sabundfile = ""; abort = true; }        
                        else if (sabundfile == "not found") { sabundfile = ""; }
-                       else {  format = "sabund"; inputfile = sabundfile; }
+                       else {  format = "sabund"; inputfile = sabundfile; m->setSabundFile(sabundfile); }
                        
                        rabundfile = validParameter.validFile(parameters, "rabund", true);
                        if (rabundfile == "not open") { rabundfile = ""; abort = true; }        
                        else if (rabundfile == "not found") { rabundfile = ""; }
-                       else {  format = "rabund"; inputfile = rabundfile; }
+                       else {  format = "rabund"; inputfile = rabundfile; m->setRabundFile(rabundfile); }
                        
                        sharedfile = validParameter.validFile(parameters, "shared", true);
                        if (sharedfile == "not open") { sharedfile = ""; abort = true; }        
                        else if (sharedfile == "not found") { sharedfile = ""; }
-                       else {  format = "sharedfile"; inputfile = sharedfile; }
+                       else {  format = "sharedfile"; inputfile = sharedfile; m->setSharedFile(sharedfile); }
                        
                        
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
index d72dd7139735f16b8fcd8b02aa39058a5f4a3110..202883e201561f8851d77c5e6569df33280143c3 100644 (file)
@@ -238,7 +238,7 @@ CollectSharedCommand::CollectSharedCommand(string option)  {
                                sharedfile = m->getSharedFile(); 
                                if (sharedfile != "") { m->mothurOut("Using " + sharedfile + " as input file for the shared parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current sharedfile and the shared parameter is required."); m->mothurOutEndLine(); abort = true; }
-                       }
+                       }else { m->setSharedFile(sharedfile); }
                        
                        
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
index 9d817a212cc2ad2ee3a330b982d96cffe251bdce..9172819bd78f39dfee97b94c4c4b24c79bd080ae 100644 (file)
@@ -139,15 +139,17 @@ ConsensusSeqsCommand::ConsensusSeqsCommand(string option)  {
                                fastafile = m->getFastaFile(); 
                                if (fastafile != "") { m->mothurOut("Using " + fastafile + " as input file for the fasta parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current fastafile and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; }
-                       }       
+                       }else { m->setFastaFile(fastafile); }   
                        
                        namefile = validParameter.validFile(parameters, "name", true);
                        if (namefile == "not open") { abort = true; }
-                       else if (namefile == "not found") { namefile = ""; }    
+                       else if (namefile == "not found") { namefile = ""; }
+                       else { m->setNameFile(namefile); }
                        
                        listfile = validParameter.validFile(parameters, "list", true);
                        if (listfile == "not open") { abort = true; }
                        else if (listfile == "not found") { listfile = "";  }   
+                       else { m->setListFile(listfile); }
                        
                        label = validParameter.validFile(parameters, "label", false);                   
                        if (label == "not found") { label = ""; }
index 791ec4978fd82d2fb692723fc105dfd5b6c041f0..cd188b8a921a33aaac255852b5ab22d6008f605e 100644 (file)
@@ -140,12 +140,12 @@ CorrAxesCommand::CorrAxesCommand(string option)  {
                        sharedfile = validParameter.validFile(parameters, "shared", true);
                        if (sharedfile == "not open") { abort = true; }
                        else if (sharedfile == "not found") { sharedfile = ""; }
-                       else { inputFileName = sharedfile; }
+                       else { inputFileName = sharedfile; m->setSharedFile(sharedfile); }
                        
                        relabundfile = validParameter.validFile(parameters, "relabund", true);
                        if (relabundfile == "not open") { abort = true; }
                        else if (relabundfile == "not found") { relabundfile = ""; }
-                       else { inputFileName = relabundfile; }
+                       else { inputFileName = relabundfile; m->setRelAbundFile(relabundfile); }
                        
                        metadatafile = validParameter.validFile(parameters, "metadata", true);
                        if (metadatafile == "not open") { abort = true; }
index a4464692607df14d08384f3cfdf112a4e18debb8..a9bffc6eca25d3ad78ce7b01d96e196ba6308bfb 100644 (file)
@@ -117,11 +117,12 @@ CountSeqsCommand::CountSeqsCommand(string option)  {
                                namefile = m->getNameFile(); 
                                if (namefile != "") { m->mothurOut("Using " + namefile + " as input file for the name parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current namefile and the name parameter is required."); m->mothurOutEndLine(); abort = true; }
-                       }
+                       }else { m->setNameFile(namefile); }
                        
                        groupfile = validParameter.validFile(parameters, "group", true);
                        if (groupfile == "not open") { abort = true; }
                        else if (groupfile == "not found") {  groupfile = "";  }        
+                       else { m->setGroupFile(groupfile); }
                        
                        groups = validParameter.validFile(parameters, "groups", false);                 
                        if (groups == "not found") { groups = "all"; }
index 6f7657f3da640514fb5125527b17cfd779a5cad0..5888feedcf5f6d6c01438d5acecc5e65ba897c54 100644 (file)
@@ -116,7 +116,7 @@ DeconvoluteCommand::DeconvoluteCommand(string option)  {
                                inFastaName = m->getFastaFile(); 
                                if (inFastaName != "") { m->mothurOut("Using " + inFastaName + " as input file for the fasta parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current fastafile and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; }
-                       }       
+                       }else { m->setFastaFile(inFastaName); } 
                        
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
                        outputDir = validParameter.validFile(parameters, "outputdir", false);           if (outputDir == "not found"){  
@@ -127,6 +127,7 @@ DeconvoluteCommand::DeconvoluteCommand(string option)  {
                        oldNameMapFName = validParameter.validFile(parameters, "name", true);
                        if (oldNameMapFName == "not open") { abort = true; }
                        else if (oldNameMapFName == "not found"){       oldNameMapFName = "";   }
+                       else { m->setNameFile(oldNameMapFName); }
                }
 
        }
index 940672c1bef7f6ab2004a9b374011cd1f8420e85..f590d8b3baaf67091f59a741a87a23e09c8873b0 100644 (file)
@@ -156,7 +156,7 @@ DegapSeqsCommand::DegapSeqsCommand(string option)  {
                                                        //erase from file list
                                                        fastaFileNames.erase(fastaFileNames.begin()+i);
                                                        i--;
-                                               }
+                                               }else { m->setFastaFile(fastaFileNames[i]); }
                                        }
                                }
                                
index aed53037c152ded2b13e00b1dfbf30ff739d341d..2ba6f3d2363d86cc49108e2cb3db71fddd1ae879 100644 (file)
@@ -114,7 +114,7 @@ DeUniqueSeqsCommand::DeUniqueSeqsCommand(string option)  {
                                fastaFile = m->getFastaFile(); 
                                if (fastaFile != "") { m->mothurOut("Using " + fastaFile + " as input file for the fasta parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current fastafile and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; }
-                       }       
+                       }else { m->setFastaFile(fastaFile); }   
                        
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
                        outputDir = validParameter.validFile(parameters, "outputdir", false);           if (outputDir == "not found"){  
@@ -128,7 +128,7 @@ DeUniqueSeqsCommand::DeUniqueSeqsCommand(string option)  {
                                nameFile = m->getNameFile(); 
                                if (nameFile != "") { m->mothurOut("Using " + nameFile + " as input file for the name parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current namefile and the name parameter is required."); m->mothurOutEndLine(); abort = true; }
-                       }
+                       }else { m->setNameFile(nameFile); }
                }
 
        }
index 7f33ad65e13a44ed77dc2fab585cbded550475ad..f39a182ed863893c66f9b22a25c4c6765c04d165 100644 (file)
@@ -116,7 +116,7 @@ DeuniqueTreeCommand::DeuniqueTreeCommand(string option)  {
                                treefile = m->getTreeFile(); 
                                if (treefile != "") { m->mothurOut("Using " + treefile + " as input file for the tree parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current tree file and the tree parameter is required."); m->mothurOutEndLine(); abort = true; }                                                               
-                       }       
+                       }else { m->setTreeFile(treefile); }     
                        
                        namefile = validParameter.validFile(parameters, "name", true);
                        if (namefile == "not open") { abort = true; }
@@ -124,7 +124,7 @@ DeuniqueTreeCommand::DeuniqueTreeCommand(string option)  {
                                namefile = m->getNameFile(); 
                                if (namefile != "") { m->mothurOut("Using " + namefile + " as input file for the name parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current name file and the name parameter is required."); m->mothurOutEndLine(); abort = true; }                                                               
-                       }
+                       }else { m->setNameFile(namefile); }
                        
                        outputDir = validParameter.validFile(parameters, "outputdir", false);           if (outputDir == "not found"){  outputDir = m->hasPath(treefile);       }
                }
index b73cd7c751176c386a95931b0887c6790f046583..4bdeaaeb5d9b388ac56fc2553f57dc10c0d598d9 100644 (file)
@@ -152,6 +152,7 @@ DistanceCommand::DistanceCommand(string option) {
                                m->openInputFile(fastafile, inFASTA);
                                alignDB = SequenceDB(inFASTA); 
                                inFASTA.close();
+                               m->setFastaFile(fastafile);
                        }
                        
                        oldfastafile = validParameter.validFile(parameters, "oldfasta", true);
@@ -161,6 +162,7 @@ DistanceCommand::DistanceCommand(string option) {
                        column = validParameter.validFile(parameters, "column", true);
                        if (column == "not found") { column = ""; }
                        else if (column == "not open") { abort = true; }        
+                       else { m->setColumnFile(column); }
                        
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
                        outputDir = validParameter.validFile(parameters, "outputdir", false);           if (outputDir == "not found"){  
index 167dd3ce835f071e70c187ba9507fb2931a2e548..1204663a52c73a3a98af34c42c4a93ec044e7200 100644 (file)
@@ -190,6 +190,7 @@ FilterSeqsCommand::FilterSeqsCommand(string option)  {
                                                }else{  
                                                        string simpleName = m->getSimpleName(fastafileNames[i]);
                                                        filterFileName += simpleName.substr(0, simpleName.find_first_of('.'));
+                                                       m->setFastaFile(fastafileNames[i]);
                                                }
                                                in.close();
                                        }
index 283cd405eed10282df0ded886c616cb003b7847a..52559b3c064f6437affcbdc5dcd3d0b174089b42 100644 (file)
@@ -113,6 +113,14 @@ int GetCommandInfoCommand::execute(){
                                }
                                out << "help=" << newHelpString << endl;
                                
+                               //remove /n from citation string since gui reads line by line
+                               string mycitationString = thisCommand->getCitation();
+                               string newCitationString = "";
+                               for (int i = 0; i < mycitationString.length(); i++) { 
+                                       if (mycitationString[i] != '\n') { newCitationString += mycitationString[i]; }
+                               }
+                               out << "citation=" << newCitationString << endl;
+                               
                                //outputTypes - makes something like outputTypes=fasta-name-qfile
                                map<string, vector<string> > thisOutputTypes = thisCommand->getOutputFiles();
                                map<string, vector<string> >::iterator itTypes;
index b39fb645154f97252e7d928c9862cde01553ab6b..1190f49d41036c3d3034d8555544725014ee49f0 100644 (file)
@@ -103,7 +103,7 @@ GetgroupCommand::GetgroupCommand(string option)  {
                                sharedfile = m->getSharedFile(); 
                                if (sharedfile != "") { m->mothurOut("Using " + sharedfile + " as input file for the shared parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("You have no current sharedfile and the shared parameter is required."); m->mothurOutEndLine(); abort = true; }
-                       }
+                       }else { m->setSharedFile(sharedfile); }
                        
                        
                        //if the user changes the output directory command factory will send this info to us in the output parameter 
index c9c65042843bffddf5c6d3d7acca4ab38754ac5e..520d0bb56eae9c66a936311ca71aa5330bf29aa1 100644 (file)
@@ -44,20 +44,22 @@ QualityScores::QualityScores(ifstream& qFile){
                else{
                        seqName = seqName.substr(1);
                }
+               
                string qScoreString = m->getline(qFile);
                while(qFile.peek() != '>' && qFile.peek() != EOF){
-                       qScoreString += ' ' + m->getline(qFile);
+                       qScoreString +=  ' ' + m->getline(qFile);
                }
                
                istringstream qScoreStringStream(qScoreString);
                int count = 0;
                while(!qScoreStringStream.eof()){
                        if (m->control_pressed) { break; }
-                       qScoreStringStream >> score;
+                       qScoreStringStream >> score;  m->gobble(qScoreStringStream);
+
                        qScores.push_back(score);
                        count++;
                }
-               qScores.pop_back();
+               //qScores.pop_back();
                
 //             string scores = "";
 //             
@@ -102,7 +104,7 @@ QualityScores::QualityScores(ifstream& qFile){
 //             qScores.pop_back();
 
                seqLength = qScores.size();
-               
+               //cout << "seqlenght = " <<     seqLength << '\t' << count << endl;
                
        }
        catch(exception& e) {
@@ -151,7 +153,10 @@ void QualityScores::printQScores(ofstream& qFile){
 void QualityScores::trimQScores(int start, int end){
        try {
                vector<int> hold;
-                       
+               
+
+               //cout << seqName << '\t' << start << '\t' << end << '\t' << qScores.size() << endl;
+               //for (int i = 0; i < qScores.size(); i++) { cout << qScores[i] << end; }
                if(end == -1){          
                        hold = vector<int>(qScores.begin()+start, qScores.end());
                        qScores = hold;         
index 5efb1ce78c659577c520defc124c48e60b848dc8..6ce944ef21189948519310e372907580d8ac1400 100644 (file)
@@ -24,7 +24,6 @@ vector<string> SeqErrorCommand::setParameters(){
                CommandParameter pignorechimeras("ignorechimeras", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(pignorechimeras);
                CommandParameter pthreshold("threshold", "Number", "", "1.0", "", "", "",false,false); parameters.push_back(pthreshold);
                CommandParameter pprocessors("processors", "Number", "", "1", "", "", "",false,false); parameters.push_back(pprocessors);
-               CommandParameter pfilter("filter", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(pfilter);
                CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir);
                CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir);
                
@@ -204,9 +203,6 @@ SeqErrorCommand::SeqErrorCommand(string option)  {
                        temp = validParameter.validFile(parameters, "ignorechimeras", false);   if (temp == "not found") { temp = "T"; }
                        ignoreChimeras = m->isTrue(temp);
                        
-                       temp = validParameter.validFile(parameters, "filter", false);   if (temp == "not found") { temp = "T"; }
-                       filter = m->isTrue(temp);  
-                       
                        temp = validParameter.validFile(parameters, "processors", false);       if (temp == "not found"){       temp = m->getProcessors();      }
                        m->setProcessors(temp);
                        convert(temp, processors); 
@@ -230,25 +226,6 @@ int SeqErrorCommand::execute(){
                maxLength = 2000;
                totalBases = 0;
                totalMatches = 0;
-
-               //run vertical filter on query and reference files.
-               if (filter) {
-                       string inputString = "fasta=" + queryFileName + "-" + referenceFileName;
-                       m->mothurOut("/******************************************/"); m->mothurOutEndLine(); 
-                       m->mothurOut("Running command: filter.seqs(" + inputString + ") to improve processing time."); m->mothurOutEndLine(); 
-                       
-                       Command* filterCommand = new FilterSeqsCommand(inputString);
-                       filterCommand->execute();
-                       
-                       map<string, vector<string> > filenames = filterCommand->getOutputFiles();
-                       
-                       delete filterCommand;
-                       
-                       m->mothurOut("/******************************************/"); m->mothurOutEndLine(); 
-                       
-                       queryFileName = filenames["fasta"][0];
-                       referenceFileName = filenames["fasta"][1];
-               }
                
                string errorSummaryFileName = queryFileName.substr(0,queryFileName.find_last_of('.')) + ".error.summary";
                outputNames.push_back(errorSummaryFileName); outputTypes["error.summary"].push_back(errorSummaryFileName);
index cb715ce05bc1edad8f2790cd78b67a356eafd7c3..3fdd66930a3078114b28d6f2f126de3da70f7da5 100644 (file)
@@ -84,7 +84,7 @@ private:
 
        string queryFileName, referenceFileName, qualFileName, reportFileName, namesFileName, outputDir;
        double threshold;
-       bool ignoreChimeras, filter;
+       bool ignoreChimeras;
        int numRefs, processors;
        int maxLength, totalBases, totalMatches;
        //ofstream errorSummaryFile, errorSeqFile;
index 765dc78e68a2ac12034853c008055b87d58abc03..77af9e647be61a96ba83bf4929156aa7554633e8 100644 (file)
@@ -283,7 +283,7 @@ SffInfoCommand::SffInfoCommand(string option)  {
                        }
                        
                        if ((sfftxtFilename == "") && (filenames.size() == 0)) {  
-                               //if there is a current fasta file, use it
+                               //if there is a current sff file, use it
                                string filename = m->getSFFFile(); 
                                if (filename != "") { filenames.push_back(filename); m->mothurOut("Using " + filename + " as input file for the sff parameter."); m->mothurOutEndLine(); }
                                else {  m->mothurOut("[ERROR]: you must provide a valid sff or sfftxt file."); m->mothurOutEndLine(); abort=true;  }
@@ -901,13 +901,20 @@ int SffInfoCommand::parseSffTxt() {
                //output file names
                ofstream outFasta, outQual, outFlow;
                string outFastaFileName, outQualFileName;
-               string outFlowFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "flow";
+               string fileRoot = m->getRootName(m->getSimpleName(sfftxtFilename));
+               if (fileRoot.length() > 0) {
+                       //rip off last .
+                       fileRoot = fileRoot.substr(0, fileRoot.length()-1);
+                       fileRoot = m->getRootName(fileRoot);
+               }
+               
+               string outFlowFileName = outputDir + fileRoot + "flow";
                if (trim) {
-                       outFastaFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "fasta";
-                       outQualFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "qual";
+                       outFastaFileName = outputDir + fileRoot + "fasta";
+                       outQualFileName = outputDir + fileRoot + "qual";
                }else{
-                       outFastaFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "raw.fasta";
-                       outQualFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "raw.qual";
+                       outFastaFileName = outputDir + fileRoot + "raw.fasta";
+                       outQualFileName = outputDir + fileRoot + "raw.qual";
                }
                
                if (fasta)      { m->openOutputFile(outFastaFileName, outFasta);        outputNames.push_back(outFastaFileName); outputTypes["fasta"].push_back(outFastaFileName); }
index 5ace75e3a2d152f27e6483aab2ad4a697f952c79..ab9674f6836cafb373af0b89e43f4f7519476ae4 100644 (file)
@@ -96,7 +96,7 @@ int SystemCommand::execute(){
                
                ifstream in;
                string filename = "./commandScreen.output";
-               m->openInputFile(filename, in);
+               m->openInputFile(filename, in, "no error");
                
                string output = "";
                while(char c = in.get()){
index 4d6b45da96664677f61908874d79b8d847f0e74c..6410c8f4cb39a32efad1f8a18e4876cec6080b9f 100644 (file)
@@ -559,7 +559,7 @@ int TrimSeqsCommand::driverCreateTrim(string filename, string qFileName, string
                        if(qFileName != ""){
                                currQual = QualityScores(qFile);  m->gobble(qFile);
                        }
-
+                       //cout << currSeq.getName() << '\t' << currSeq.getUnaligned().length() << endl;
                        string origSeq = currSeq.getUnaligned();
                        if (origSeq != "") {
                                
@@ -1316,7 +1316,7 @@ int TrimSeqsCommand::stripBarcode(Sequence& seq, QualityScores& qual, int& group
                        if (alignment != NULL) {  delete alignment;  }
                        
                }
-               
+       
                return success;
                
        }