]> git.donarmstrong.com Git - mothur.git/commitdiff
working on testing for 1.13
authorwestcott <westcott>
Sat, 4 Sep 2010 00:24:30 +0000 (00:24 +0000)
committerwestcott <westcott>
Sat, 4 Sep 2010 00:24:30 +0000 (00:24 +0000)
chopseqscommand.cpp
degapseqscommand.cpp
makegroupcommand.cpp
treegroupscommand.cpp
trimseqscommand.cpp

index 12e48f4ad34720a449a7dd7e2c197fe57faa4f64..b2810741ae7b2b6591a7f0aa8e3b52b143dcfe3d 100644 (file)
@@ -35,9 +35,6 @@ ChopSeqsCommand::ChopSeqsCommand(string option)  {
                                if (validParameter.isValidParameter(it->first, myArray, it->second) != true) {  abort = true;  }
                        }
                        
-                       //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 = "";         }
-                       
                        //if the user changes the input directory command factory will send this info to us in the output parameter 
                        string inputDir = validParameter.validFile(parameters, "inputdir", false);              
                        if (inputDir == "not found"){   inputDir = "";          }
@@ -57,6 +54,9 @@ ChopSeqsCommand::ChopSeqsCommand(string option)  {
                        if (fastafile == "not open") { abort = true; }
                        else if (fastafile == "not found") {  m->mothurOut("You must provide a fasta file."); m->mothurOutEndLine(); abort = true; }    
                        
+                       //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);      }
+                       
                        string temp = validParameter.validFile(parameters, "numbases", false);  if (temp == "not found") { temp = "0"; } 
                        convert(temp, numbases);   
                        
index 6a9c25eb74d240404b16f2677ec30b047781a159..e475727cb68dd0a28c27ffb64f699a9e633229f8 100644 (file)
@@ -131,7 +131,9 @@ int DegapSeqsCommand::execute(){
                        m->openInputFile(fastaFileNames[s], inFASTA);
                        
                        ofstream outFASTA;
-                       string degapFile = outputDir + m->getRootName(m->getSimpleName(fastaFileNames[s])) + "ng.fasta";
+                       string tempOutputDir = outputDir;
+                       if (outputDir == "") { tempOutputDir = m->hasPath(fastaFileNames[s]); }
+                       string degapFile = tempOutputDir + m->getRootName(m->getSimpleName(fastaFileNames[s])) + "ng.fasta";
                        m->openOutputFile(degapFile, outFASTA);
                        
                        while(!inFASTA.eof()){
index 1a2ffe65fd17c79cc28c6a1e7106012ad2e987c7..41762ab3619979fb98c33a3974cddf40d5d2deaf 100644 (file)
@@ -37,10 +37,6 @@ MakeGroupCommand::MakeGroupCommand(string option)  {
                                if (validParameter.isValidParameter(it->first, myArray, it->second) != true) {  abort = true;  }
                        }
 
-                       //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 = "";         }
-                       
-
                        //if the user changes the input directory command factory will send this info to us in the output parameter 
                        string inputDir = validParameter.validFile(parameters, "inputdir", false);              
                        if (inputDir == "not found"){   inputDir = "";          }
@@ -88,6 +84,9 @@ MakeGroupCommand::MakeGroupCommand(string option)  {
                                if (fastaFileNames.size() == 0) { m->mothurOut("no valid files."); m->mothurOutEndLine(); abort = true; }
                        }
                        
+                       //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 = "";         }
+                       
                        groups = validParameter.validFile(parameters, "groups", false);                 
                        if (groups == "not found") { m->mothurOut("groups is a required parameter for the make.group command."); m->mothurOutEndLine(); abort = true;  }
                        else { m->splitAtDash(groups, groupsNames);     }
@@ -130,6 +129,10 @@ int MakeGroupCommand::execute(){
        try {
                if (abort == true) {    return 0;       }
                
+               if (outputDir == "") { outputDir = m->hasPath(fastaFileNames[0]); }
+               
+               filename = outputDir + filename;
+               
                ofstream out;
                m->openOutputFile(filename, out);
                
index 637eccedfc77e74556de6bf3f201270b28874d96..3403b9934dfb9366d066a64ed5552484b2e4275c 100644 (file)
@@ -50,8 +50,6 @@ TreeGroupCommand::TreeGroupCommand(string option)  {
                                if (validParameter.isValidParameter(it->first, myArray, it->second) != true) {  abort = true;  }
                        }
                        
-                       globaldata->newRead();
-                       
                        //if the user changes the input directory command factory will send this info to us in the output parameter 
                        string inputDir = validParameter.validFile(parameters, "inputdir", false);              
                        if (inputDir == "not found"){   inputDir = "";          }
@@ -88,12 +86,12 @@ TreeGroupCommand::TreeGroupCommand(string option)  {
                        phylipfile = validParameter.validFile(parameters, "phylip", true);
                        if (phylipfile == "not open") { abort = true; }
                        else if (phylipfile == "not found") { phylipfile = ""; }        
-                       else {  format = "phylip";  globaldata->setPhylipFile(phylipfile);      }
+                       else {  globaldata->newRead(); format = "phylip";  globaldata->setPhylipFile(phylipfile);       }
                        
                        columnfile = validParameter.validFile(parameters, "column", true);
                        if (columnfile == "not open") { abort = true; } 
                        else if (columnfile == "not found") { columnfile = ""; }
-                       else {  format = "column"; globaldata->setColumnFile(columnfile);       }
+                       else {  globaldata->newRead(); format = "column"; globaldata->setColumnFile(columnfile);        }
                        
                        namefile = validParameter.validFile(parameters, "name", true);
                        if (namefile == "not open") { abort = true; }   
index acdf475a17ccc544c96e6d519d58867cf50b3374..e47e71d581d9a24f5b4c5ced4ac1875a94b1d269 100644 (file)
@@ -224,9 +224,8 @@ int TrimSeqsCommand::execute(){
                string scrapSeqFile = outputDir + m->getRootName(m->getSimpleName(fastaFile)) + "scrap.fasta";
                outputNames.push_back(scrapSeqFile);
                string trimQualFile = outputDir + m->getRootName(m->getSimpleName(fastaFile)) + "trim.qual";
-               outputNames.push_back(trimQualFile);
                string scrapQualFile = outputDir + m->getRootName(m->getSimpleName(fastaFile)) + "scrap.qual";
-               outputNames.push_back(scrapQualFile);
+               if (qFileName != "") {  outputNames.push_back(trimQualFile); outputNames.push_back(scrapQualFile);  }
                string groupFile = outputDir + m->getRootName(m->getSimpleName(fastaFile)) + "groups";
                
                vector<string> fastaFileNames;