]> git.donarmstrong.com Git - mothur.git/blobdiff - bellerophon.cpp
added set.dir command and modified commands to redirect input and output, removed...
[mothur.git] / bellerophon.cpp
index a60a838f0139e741c92db8c1b5edafbdb158ca02..7c64d4703a4bd3700e0757052c392639f16aa7eb 100644 (file)
 
 //***************************************************************************************************************
 
-Bellerophon::Bellerophon(string name) {
+Bellerophon::Bellerophon(string name, string o)  {
        try {
                fastafile = name;
+               outputDir = o;
        }
        catch(exception& e) {
                errorOut(e, "Bellerophon", "Bellerophon");
@@ -81,12 +82,16 @@ int Bellerophon::getChimeras() {
                //do soft filter
                if (filter)  {
                        string optionString = "fasta=" + fastafile + ", soft=50";
+                       if (outputDir != "") { optionString += ", outputdir=" + outputDir; }
+                       
                        filterSeqs = new FilterSeqsCommand(optionString);
                        filterSeqs->execute();
                        delete filterSeqs;
                        
                        //reset fastafile to filtered file
-                       fastafile = getRootName(fastafile) + "filter.fasta";
+                       if (outputDir == "") { fastafile = getRootName(fastafile) + "filter.fasta"; }
+                       else                             { fastafile = outputDir + getRootName(getSimpleName(fastafile)) + "filter.fasta"; }
+                       
                }
                
                distCalculator = new eachGapDist();