]> git.donarmstrong.com Git - mothur.git/blobdiff - removeseqscommand.cpp
working on testing
[mothur.git] / removeseqscommand.cpp
index b77e69f665b078c0bf52956099f455833eb81749..0ab181b411738d38b769a0255baeaf5968308d35 100644 (file)
@@ -210,8 +210,10 @@ int RemoveSeqsCommand::execute(){
 //**********************************************************************************************************************
 int RemoveSeqsCommand::readFasta(){
        try {
-               if (outputDir == "") {  outputDir += m->hasPath(fastafile);  }
-               string outputFileName = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "pick" + m->getExtension(fastafile);
+               string thisOutputDir = outputDir;
+               if (outputDir == "") {  thisOutputDir += m->hasPath(fastafile);  }
+               string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(fastafile)) + "pick" + m->getExtension(fastafile);
+               
                ofstream out;
                m->openOutputFile(outputFileName, out);
                
@@ -254,8 +256,10 @@ int RemoveSeqsCommand::readFasta(){
 //**********************************************************************************************************************
 int RemoveSeqsCommand::readList(){
        try {
-               if (outputDir == "") {  outputDir += m->hasPath(listfile);  }
-               string outputFileName = outputDir + m->getRootName(m->getSimpleName(listfile)) + "pick" +  m->getExtension(listfile);
+               string thisOutputDir = outputDir;
+               if (outputDir == "") {  thisOutputDir += m->hasPath(listfile);  }
+               string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(listfile)) + "pick" +  m->getExtension(listfile);
+               
                ofstream out;
                m->openOutputFile(outputFileName, out);
                
@@ -323,8 +327,9 @@ int RemoveSeqsCommand::readList(){
 //**********************************************************************************************************************
 int RemoveSeqsCommand::readName(){
        try {
-               if (outputDir == "") {  outputDir += m->hasPath(namefile);  }
-               string outputFileName = outputDir + m->getRootName(m->getSimpleName(namefile)) + "pick" + m->getExtension(namefile);
+               string thisOutputDir = outputDir;
+               if (outputDir == "") {  thisOutputDir += m->hasPath(namefile);  }
+               string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(namefile)) + "pick" + m->getExtension(namefile);
 
                ofstream out;
                m->openOutputFile(outputFileName, out);
@@ -408,8 +413,10 @@ int RemoveSeqsCommand::readName(){
 //**********************************************************************************************************************
 int RemoveSeqsCommand::readGroup(){
        try {
-               if (outputDir == "") {  outputDir += m->hasPath(groupfile);  }
-               string outputFileName = outputDir + m->getRootName(m->getSimpleName(groupfile)) + "pick" + m->getExtension(groupfile);
+               string thisOutputDir = outputDir;
+               if (outputDir == "") {  thisOutputDir += m->hasPath(groupfile);  }
+               string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(groupfile)) + "pick" + m->getExtension(groupfile);
+               
                ofstream out;
                m->openOutputFile(outputFileName, out);
 
@@ -449,8 +456,9 @@ int RemoveSeqsCommand::readGroup(){
 //**********************************************************************************************************************
 int RemoveSeqsCommand::readTax(){
        try {
-               if (outputDir == "") {  outputDir += m->hasPath(taxfile);  }
-               string outputFileName = outputDir + m->getRootName(m->getSimpleName(taxfile)) + "pick" + m->getExtension(taxfile);
+               string thisOutputDir = outputDir;
+               if (outputDir == "") {  thisOutputDir += m->hasPath(taxfile);  }
+               string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(taxfile)) + "pick" + m->getExtension(taxfile);
                ofstream out;
                m->openOutputFile(outputFileName, out);
 
@@ -491,8 +499,10 @@ int RemoveSeqsCommand::readTax(){
 //alignreport file has a column header line then all other lines contain 16 columns.  we just want the first column since that contains the name
 int RemoveSeqsCommand::readAlign(){
        try {
-               if (outputDir == "") {  outputDir += m->hasPath(alignfile);  }
-               string outputFileName = outputDir + m->getRootName(m->getSimpleName(alignfile)) + "pick.align.report";
+               string thisOutputDir = outputDir;
+               if (outputDir == "") {  thisOutputDir += m->hasPath(alignfile);  }
+               string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(alignfile)) + "pick.align.report";
+               
                ofstream out;
                m->openOutputFile(outputFileName, out);