]> git.donarmstrong.com Git - mothur.git/blobdiff - pintail.cpp
added modify names parameter to set.dir
[mothur.git] / pintail.cpp
index 2fa1ca7cec9c27fa68af9c9ed07c6e438eff0531..b9f2434d19d4cc842bfac1dce4f6de5a0d1b742d 100644 (file)
@@ -74,7 +74,7 @@ int Pintail::doPrep() {
        #ifdef USE_MPI
                //do nothing
        #else
-               #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+               #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
                        //find breakup of templatefile for quantiles
                        if (processors == 1) {   templateLines.push_back(new linePair(0, templateSeqs.size()));  }
                        else { 
@@ -170,13 +170,13 @@ int Pintail::doPrep() {
                        string noOutliers, outliers;
                        
                        if ((!filter) && (seqMask == "")) {
-                               noOutliers = templateFileName + "pintail.quan";
+                               noOutliers = m->getRootName(m->getSimpleName(templateFileName)) + "pintail.quan";
                        }else if ((!filter) && (seqMask != "")) { 
-                               noOutliers =templateFileName + "pintail.masked.quan";
+                               noOutliers =m->getRootName(m->getSimpleName(templateFileName)) + "pintail.masked.quan";
                        }else if ((filter) && (seqMask != "")) { 
-                               noOutliers = templateFileName + "pintail.filtered." + m->getSimpleName(m->getRootName(fastafile)) + "masked.quan";
+                               noOutliers = m->getRootName(m->getSimpleName(templateFileName)) + "pintail.filtered." + m->getSimpleName(m->getRootName(fastafile)) + "masked.quan";
                        }else if ((filter) && (seqMask == "")) { 
-                               noOutliers = templateFileName + "pintail.filtered." + m->getSimpleName(m->getRootName(fastafile)) + "quan";
+                               noOutliers = m->getRootName(m->getSimpleName(templateFileName)) + "pintail.filtered." + m->getSimpleName(m->getRootName(fastafile)) + "quan";
                        }
 
                        decalc->removeObviousOutliers(quantilesMembers, templateSeqs.size());
@@ -249,8 +249,9 @@ int Pintail::doPrep() {
        }
 }
 //***************************************************************************************************************
-int Pintail::print(ostream& out, ostream& outAcc) {
+Sequence Pintail::print(ostream& out, ostream& outAcc) {
        try {
+               
                int index = ceil(deviation);
                
                //is your DE value higher than the 95%
@@ -279,7 +280,7 @@ int Pintail::print(ostream& out, ostream& outAcc) {
                for (int m = 0; m < expectedDistance.size(); m++) {  out << expectedDistance[m] << '\t';  }
                out << endl;
                
-               return 0;
+               return *querySeq;
                
        }
        catch(exception& e) {
@@ -289,9 +290,9 @@ int Pintail::print(ostream& out, ostream& outAcc) {
 }
 #ifdef USE_MPI
 //***************************************************************************************************************
-int Pintail::print(MPI_File& out, MPI_File& outAcc) {
+Sequence Pintail::print(MPI_File& out, MPI_File& outAcc) {
        try {
-               bool results = false;
+               
                string outputString = "";
                int index = ceil(deviation);
                
@@ -319,7 +320,7 @@ int Pintail::print(MPI_File& out, MPI_File& outAcc) {
                        MPI_File_write_shared(outAcc, buf, length, MPI_CHAR, &statusAcc);
                        delete buf;
 
-                       results = true;
+                       return *querySeq;
                }
                outputString += "Observed\t";
                
@@ -339,7 +340,7 @@ int Pintail::print(MPI_File& out, MPI_File& outAcc) {
                MPI_File_write_shared(out, buf2, length, MPI_CHAR, &status);
                delete buf2;
                
-               return results;
+               return *querySeq;
        }
        catch(exception& e) {
                m->errorOut(e, "Pintail", "print");
@@ -528,7 +529,7 @@ Sequence* Pintail::findPairs(Sequence* q) {
 //**************************************************************************************************
 void Pintail::createProcessesQuan() {
        try {
-#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix)
                int process = 1;
                vector<int> processIDS;
                                
@@ -611,7 +612,7 @@ void Pintail::createProcessesQuan() {
                        }
                                        
                        in.close();
-                       remove(s.c_str());
+                       m->mothurRemove(s);
                }
 
 #else