]> git.donarmstrong.com Git - mothur.git/commitdiff
added mothurOutJustToScreen function and changed all counter outputs to use it.
authorSarahsWork <sarahswork@imac.westcotts.net>
Fri, 19 Apr 2013 18:19:00 +0000 (14:19 -0400)
committerSarahsWork <sarahswork@imac.westcotts.net>
Fri, 19 Apr 2013 18:19:00 +0000 (14:19 -0400)
33 files changed:
aligncommand.cpp
aligncommand.h
chimeraccodecommand.cpp
chimeracheckcommand.cpp
chimeraperseuscommand.cpp
chimeraperseuscommand.h
chimerapintailcommand.cpp
chimeraslayercommand.cpp
chimeraslayercommand.h
classifyseqscommand.cpp
classifyseqscommand.h
clusterfragmentscommand.cpp
distancecommand.cpp
distancecommand.h
filterseqscommand.cpp
filterseqscommand.h
matrixoutputcommand.cpp
mothurout.cpp
mothurout.h
myseqdist.cpp
pairwiseseqscommand.cpp
pairwiseseqscommand.h
pcrseqscommand.h
prcseqscommand.cpp
preclustercommand.cpp
preclustercommand.h
screenseqscommand.cpp
screenseqscommand.h
seqerrorcommand.cpp
seqsummarycommand.cpp
shhhercommand.cpp
unifracunweightedcommand.cpp
unifracweightedcommand.cpp

index fc98c10924138a3aa168dabbc609f64bfb89f3e4..f9c0436c62874864279e533a3258d72bf2f6cf2d 100644 (file)
@@ -644,11 +644,11 @@ int AlignCommand::driver(linePair* filePos, string alignFName, string reportFNam
                        #endif
                        
                        //report progress
-                       if((count) % 100 == 0){ m->mothurOut(toString(count)); m->mothurOutEndLine();           }
+                       if((count) % 100 == 0){ m->mothurOutJustToScreen(toString(count) + "\n");               }
                        
                }
                //report progress
-               if((count) % 100 != 0){ m->mothurOut(toString(count)); m->mothurOutEndLine();           }
+               if((count) % 100 != 0){ m->mothurOutJustToScreen(toString(count) + "\n");               }
                
                delete alignment;
                alignmentFile.close();
index e5e9601781fdff5e35125b49de6ba452e180f9a2..4e1b8d39f81dc067c60575d1938a21fd1de8dee0 100644 (file)
@@ -245,11 +245,11 @@ static DWORD WINAPI MyAlignThreadFunction(LPVOID lpParam){
                        delete candidateSeq;
                        
                        //report progress
-                       if((pDataArray->count) % 100 == 0){     pDataArray->m->mothurOut(toString(pDataArray->count)); pDataArray->m->mothurOutEndLine();               }
+                       if((pDataArray->count) % 100 == 0){     pDataArray->m->mothurOutJustToScreen(toString(pDataArray->count)+"\n");         }
                        
                }
                //report progress
-               if((pDataArray->count) % 100 != 0){     pDataArray->m->mothurOut(toString(pDataArray->count)); pDataArray->m->mothurOutEndLine();               }
+               if((pDataArray->count) % 100 != 0){     pDataArray->m->mothurOutJustToScreen(toString(pDataArray->count)+"\n");         }
                
                delete alignment;
                delete templateDB;
index 7adf82814ee5447edef7e203bbb046ad61c51b07..627f3a950f69bec32971b65b96d7eba89942558a 100644 (file)
@@ -548,10 +548,10 @@ int ChimeraCcodeCommand::driver(linePair* filePos, string outputFName, string fi
                        #endif
                        
                        //report progress
-                       if((count) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine();         }
+                       if((count) % 100 == 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count) + "\n");             }
                }
                //report progress
-               if((count) % 100 != 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine();         }
+               if((count) % 100 != 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count) + "\n");     }
                
                out.close();
                out2.close();
index 6caa606dc10ee387cd2eb829d264a7d17f0ee670..31a36f73c6d0339d775dd6a1a4efa8e523c0f14f 100644 (file)
@@ -547,11 +547,10 @@ int ChimeraCheckCommand::driver(linePair* filePos, string outputFName, string fi
                        #endif
                        
                        //report progress
-                       if((count) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine();         }
-            count++;
+                       if((count) % 100 == 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count) + "\n");             }
                }
                //report progress
-               if((count) % 100 != 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine();         }
+               if((count) % 100 != 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count) + "\n");     }
                
                out.close();
                inFASTA.close();
@@ -599,10 +598,10 @@ int ChimeraCheckCommand::driverMPI(int start, int num, MPI_File& inMPI, MPI_File
                        delete candidateSeq;
                        
                        //report progress
-                       if((i+1) % 100 == 0){  cout << "Processing sequence: " << (i+1) << endl;        m->mothurOutJustToLog("Processing sequence: " + toString(i+1) + "\n");          }
+                       if((i+1) % 100 == 0){  cout << "Processing sequence: " << (i+1) << endl;                }
                }
                //report progress
-               if(num % 100 != 0){             cout << "Processing sequence: " << num << endl; m->mothurOutJustToLog("Processing sequence: " + toString(num) + "\n");  }
+               if(num % 100 != 0){             cout << "Processing sequence: " << num << endl;         }
                
                return 0;
        }
index f7dc597cf8ca514712bf06f29f2010982d6c03c9..fd94fcab7e289590da462eef7f03fc7069ab551f 100644 (file)
@@ -1046,10 +1046,10 @@ int ChimeraPerseusCommand::driver(string chimeraFileName, vector<seqData>& seque
                        }
        
                        //report progress
-                       if((i+1) % 100 == 0){   m->mothurOut("Processing sequence: " + toString(i+1) + "\n");           }
+                       if((i+1) % 100 == 0){   m->mothurOutJustToScreen("Processing sequence: " + toString(i+1) + "\n");               }
                }
                
-               if((numSeqs) % 100 != 0){       m->mothurOut("Processing sequence: " + toString(numSeqs) + "\n");               }
+               if((numSeqs) % 100 != 0){       m->mothurOutJustToScreen("Processing sequence: " + toString(numSeqs) + "\n");           }
                
                chimeraFile.close();
                accnosFile.close();
index 4fa4cfff55e9582ffd699d5a66409717df8fbd36..99a66f8838e4ccbbe10fe72ef66135be7dfda869 100644 (file)
@@ -343,10 +343,10 @@ static DWORD WINAPI MyPerseusThreadFunction(LPVOID lpParam){
                                        chimeraFile << j << '\t' << sequences[j].seqName << "\t0\t0\tNull\t0\t0\t0\tNull\tNull\t0.0\t0.0\t0.0\t0\t0\t0\t0.0\t0.0\tgood" << endl;
                                }
                                //report progress
-                               if((j+1) % 100 == 0){   pDataArray->m->mothurOut("Processing sequence: " + toString(j+1) + "\n");               }
+                               if((j+1) % 100 == 0){   pDataArray->m->mothurOutJustToScreen("Processing sequence: " + toString(j+1) + "\n");           }
                        }
                        
-                       if((numSeqs) % 100 != 0){       pDataArray->m->mothurOut("Processing sequence: " + toString(numSeqs) + "\n");           }
+                       if((numSeqs) % 100 != 0){       pDataArray->m->mothurOutJustToScreen("Processing sequence: " + toString(numSeqs) + "\n");               }
                        
                        chimeraFile.close();
                        accnosFile.close();
index d2b73998da9e0319880a8baf5948ed15a6132ae6..9d492afe950713cefd4d1fad7fcd72a6da74640c 100644 (file)
@@ -636,10 +636,10 @@ int ChimeraPintailCommand::driver(linePair* filePos, string outputFName, string
                        #endif
                        
                        //report progress
-                       if((count) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine();         }
+                       if((count) % 100 == 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count) + "\n");             }
                }
                //report progress
-               if((count) % 100 != 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine();         }
+               if((count) % 100 != 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count) + "\n");             }
                
                out.close();
                out2.close();
@@ -695,10 +695,10 @@ int ChimeraPintailCommand::driverMPI(int start, int num, MPI_File& inMPI, MPI_Fi
                        delete candidateSeq;
                        
                        //report progress
-                       if((i+1) % 100 == 0){  cout << "Processing sequence: " << (i+1) << endl;        m->mothurOutJustToLog("Processing sequence: " + toString(i+1) + "\n");          }
+                       if((i+1) % 100 == 0){  cout << "Processing sequence: " << (i+1) << endl;                        }
                }
                //report progress
-               if(num % 100 != 0){             cout << "Processing sequence: " << num << endl; m->mothurOutJustToLog("Processing sequence: " + toString(num) + "\n");  }
+               if(num % 100 != 0){             cout << "Processing sequence: " << num << endl;         }
                
                                
                return 0;
index d16843c8d612fac2bde8c03db8e45ce68e869412..e7003c4d88bfe40266dffcf0770e3037cb39f38f 100644 (file)
@@ -1823,10 +1823,10 @@ int ChimeraSlayerCommand::driver(linePair filePos, string outputFName, string fi
                        
                        delete candidateSeq;
                        //report progress
-                       if((count) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine();         }
+                       if((count) % 100 == 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count) + "\n");             }
                }
                //report progress
-               if((count) % 100 != 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine();         }
+               if((count) % 100 != 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count)+ "\n");              }
                
                int numNoParents = chimera->getNumNoParents();
                if (numNoParents == count) { m->mothurOut("[WARNING]: megablast returned 0 potential parents for all your sequences. This could be due to formatdb.exe not being setup properly, please check formatdb.log for errors."); m->mothurOutEndLine(); } 
@@ -1973,10 +1973,10 @@ int ChimeraSlayerCommand::driverMPI(int start, int num, MPI_File& inMPI, MPI_Fil
                        delete candidateSeq;
                        
                        //report progress
-                       if((i+1) % 100 == 0){  cout << "Processing sequence: " << (i+1) << endl;        m->mothurOutJustToLog("Processing sequence: " + toString(i+1) + "\n");          }
+                       if((i+1) % 100 == 0){  cout << "Processing sequence: " << (i+1) << endl;                }
                }
                //report progress
-               if(num % 100 != 0){             cout << "Processing sequence: " << num << endl; m->mothurOutJustToLog("Processing sequence: " + toString(num) + "\n");  }
+               if(num % 100 != 0){             cout << "Processing sequence: " << num << endl;         }
                
                int numNoParents = chimera->getNumNoParents();
                if (numNoParents == num) { cout << "[WARNING]: megablast returned 0 potential parents for all your sequences. This could be due to formatdb.exe not being setup properly, please check formatdb.log for errors." << endl; }
index 68e03b8f881930fd919fc36b2283cc4024d3a2b0..e8afc61a5b32e5379d8c02a47a9a965eb3d1606d 100644 (file)
@@ -327,10 +327,10 @@ static DWORD WINAPI MySlayerThreadFunction(LPVOID lpParam){
                        
                        delete candidateSeq;
                        //report progress
-                       if((pDataArray->count) % 100 == 0){     pDataArray->m->mothurOut("Processing sequence: " + toString(pDataArray->count)); pDataArray->m->mothurOutEndLine();             }
+                       if((pDataArray->count) % 100 == 0){     pDataArray->m->mothurOutJustToScreen("Processing sequence: " + toString(pDataArray->count) +"\n");      }
                }
                //report progress
-               if((pDataArray->count) % 100 != 0){     pDataArray->m->mothurOut("Processing sequence: " + toString(pDataArray->count)); pDataArray->m->mothurOutEndLine();             }
+               if((pDataArray->count) % 100 != 0){     pDataArray->m->mothurOutJustToScreen("Processing sequence: " + toString(pDataArray->count)+"\n");               }
                
                pDataArray->numNoParents = chimera->getNumNoParents();
                if (pDataArray->numNoParents == pDataArray->count) {    pDataArray->m->mothurOut("[WARNING]: megablast returned 0 potential parents for all your sequences. This could be due to formatdb.exe not being setup properly, please check formatdb.log for errors.\n"); }
@@ -506,10 +506,10 @@ static DWORD WINAPI MySlayerGroupThreadFunction(LPVOID lpParam){
                                if (inFASTA.eof()) { break; }
                                
                                //report progress
-                               if((numSeqs) % 100 == 0){       pDataArray->m->mothurOut("Processing sequence: " + toString(numSeqs)); pDataArray->m->mothurOutEndLine();               }
+                               if((numSeqs) % 100 == 0){       pDataArray->m->mothurOutJustToScreen("Processing sequence: " + toString(numSeqs)+"\n"); pDataArray->m->mothurOutEndLine();              }
                        }
                        //report progress
-                       if((numSeqs) % 100 != 0){       pDataArray->m->mothurOut("Processing sequence: " + toString(numSeqs)); pDataArray->m->mothurOutEndLine();               }
+                       if((numSeqs) % 100 != 0){       pDataArray->m->mothurOutJustToScreen("Processing sequence: " + toString(numSeqs)+"\n");                 }
                        
                        pDataArray->numNoParents = chimera->getNumNoParents();
                        if (pDataArray->numNoParents == numSeqs) {      pDataArray->m->mothurOut("[WARNING]: megablast returned 0 potential parents for all your sequences. This could be due to formatdb.exe not being setup properly, please check formatdb.log for errors.\n"); }
index 8b6a77b4936b0095741747cb255e143a1cd78e64..edbd4c466bfa500bcaa72b1f8266f3dd40185ae9 100644 (file)
@@ -1151,11 +1151,11 @@ int ClassifySeqsCommand::driver(linePair* filePos, string taxFName, string tempT
                        #endif
                        
                        //report progress
-                       if((count) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine();         }
+                       if((count) % 100 == 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count) +"\n");              }
                        
                }
                //report progress
-               if((count) % 100 != 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine();         }
+               if((count) % 100 != 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count)+"\n");               }
                        
                inFASTA.close();
                outTax.close();
index f8a820dcf6347aa39432d461c78f6f8613ae6acf..59d9ee275800195255961639d77fb6c57d97f417 100644 (file)
@@ -211,11 +211,11 @@ static DWORD WINAPI MyClassThreadFunction(LPVOID lpParam){
                        }
                        delete candidateSeq;
                        //report progress
-                       if((pDataArray->count) % 100 == 0){     pDataArray->m->mothurOut("Processing sequence: " + toString(pDataArray->count)); pDataArray->m->mothurOutEndLine();             }
+                       if((pDataArray->count) % 100 == 0){     pDataArray->m->mothurOutJustToScreen("Processing sequence: " + toString(pDataArray->count)+"\n");       }
                        
                }
                //report progress
-               if((pDataArray->count) % 100 != 0){     pDataArray->m->mothurOut("Processing sequence: " + toString(pDataArray->count)); pDataArray->m->mothurOutEndLine();             }
+               if((pDataArray->count) % 100 != 0){     pDataArray->m->mothurOutJustToScreen("Processing sequence: " + toString(pDataArray->count)+"\n");               }
                
                delete myclassify;
                inFASTA.close();
index ef199ccdf0a11efba99eaf0299ff50413b70b89f..1b8cc71706710a3c80d53f6ff2fd877d07d98103 100644 (file)
@@ -262,10 +262,10 @@ int ClusterFragmentsCommand::execute(){
                                alignSeqs[i].active = 0;
                                
                        }//end if active i
-                       if(i % 100 == 0)        { m->mothurOut(toString(i) + "\t" + toString(numSeqs - count) + "\t" + toString(count)); m->mothurOutEndLine(); }
+                       if(i % 100 == 0)        { m->mothurOutJustToScreen(toString(i) + "\t" + toString(numSeqs - count) + "\t" + toString(count)+"\n");       }
                }
                
-               if(numSeqs % 100 != 0)  { m->mothurOut(toString(numSeqs) + "\t" + toString(numSeqs - count) + "\t" + toString(count)); m->mothurOutEndLine();   }
+               if(numSeqs % 100 != 0)  { m->mothurOutJustToScreen(toString(numSeqs) + "\t" + toString(numSeqs - count) + "\t" + toString(count)+"\n"); }
        
                
                string fileroot = outputDir + m->getRootName(m->getSimpleName(fastafile));
index 19094e9e76ee76981b9d5bd501df3876d401b387..9243df3873a9687d43da9da940b32da1ce9a5091 100644 (file)
@@ -675,11 +675,11 @@ int DistanceCommand::driver(int startLine, int endLine, string dFileName, float
                        if (output == "lt") { outFile << endl; }
                        
                        if(i % 100 == 0){
-                               m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine();
+                               m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n"); 
                        }
                        
                }
-               m->mothurOut(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine();
+               m->mothurOutJustToScreen(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)+"\n");
                
                outFile.close();
                delete distCalculator;
@@ -745,11 +745,11 @@ int DistanceCommand::driver(int startLine, int endLine, string dFileName, string
                        outFile << endl; 
                        
                        if(i % 100 == 0){
-                               m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine();
+                               m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n");
                        }
                        
                }
-               m->mothurOut(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine();
+               m->mothurOutJustToScreen(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)+"\n");
                
                outFile.close();
                delete distCalculator;
@@ -812,8 +812,7 @@ int DistanceCommand::driverMPI(int startLine, int endLine, MPI_File& outMPI, flo
                        }
                        
                        if(i % 100 == 0){
-                               m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine();
-                               cout << i << '\t' << (time(NULL) - startTime) << endl;
+                               m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n"); 
                        }
                        
                         
@@ -829,8 +828,7 @@ int DistanceCommand::driverMPI(int startLine, int endLine, MPI_File& outMPI, flo
                        
                }
                
-               m->mothurOut(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine();
-               cout << (endLine-1) << '\t' << (time(NULL) - startTime) << endl;        
+               m->mothurOutJustToScreen(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)+"\n");
                delete distCalculator;
                return 1;
        }
@@ -907,9 +905,7 @@ int DistanceCommand::driverMPI(int startLine, int endLine, string file, unsigned
 
                
                        if(i % 100 == 0){
-                               m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine();
-                               cout << i << '\t' << (time(NULL) - startTime) << endl;
-                       }
+                               m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n");                   }
                        
                        
                        //send results to parent
@@ -923,8 +919,8 @@ int DistanceCommand::driverMPI(int startLine, int endLine, string file, unsigned
                        delete buf;
                }
                
-               m->mothurOut(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine();
-               cout << (endLine-1) << '\t' << (time(NULL) - startTime) << endl;
+               m->mothurOutJustToScreen(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)+"\n");
+               
                MPI_File_close(&outMPI);
                delete distCalculator;
                
@@ -1002,8 +998,7 @@ int DistanceCommand::driverMPI(int startLine, int endLine, string file, unsigned
 
                
                        if(i % 100 == 0){
-                               m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine();
-                               cout << i << '\t' << (time(NULL) - startTime) << endl;
+                               m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n"); 
                        }
                        
                        
@@ -1018,8 +1013,8 @@ int DistanceCommand::driverMPI(int startLine, int endLine, string file, unsigned
                        delete buf;
                }
                
-               m->mothurOut(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine();
-               cout << (endLine-1) << '\t' << (time(NULL) - startTime) << endl;
+               m->mothurOutJustToScreen(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)+"\n");
+               
                MPI_File_close(&outMPI);
                delete distCalculator;
                return 1;
index af55406b372dbf0f56a546be4de2bc87f5072614..2f53232b5943d835e8c27adf7374a5e3a8ce168f 100644 (file)
@@ -119,11 +119,10 @@ static DWORD WINAPI MyDistThreadFunction(LPVOID lpParam){
                                if (pDataArray->output == "lt") { outFile << endl; }
                                
                                if(i % 100 == 0){
-                                       pDataArray->m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine();
-                               }
+                                       pDataArray->m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n");                               }
                                pDataArray->count++;
                        }
-                       pDataArray->m->mothurOut(toString(pDataArray->count) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine();
+                       pDataArray->m->mothurOutJustToScreen(toString(pDataArray->count) + "\t" + toString(time(NULL) - startTime)+"\n");
                }else{
                        if(pDataArray->startLine == 0){ outFile << pDataArray->alignDB.getNumSeqs() << endl;    }
                        
@@ -148,11 +147,11 @@ static DWORD WINAPI MyDistThreadFunction(LPVOID lpParam){
                                outFile << endl; 
                                
                                if(i % 100 == 0){
-                                       pDataArray->m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine();
+                                       pDataArray->m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n"); 
                                }
                                pDataArray->count++;
                        }
-                       pDataArray->m->mothurOut(toString(pDataArray->count) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine();
+                       pDataArray->m->mothurOutJustToScreen(toString(pDataArray->count) + "\t" + toString(time(NULL) - startTime)+"\n"); 
                }
                
                outFile.close();
index b17d9ed6799d9c8287664cf63241b0fde01bf40e..8b68988884acb408d0e72c5c3fa407a7b9f241b6 100644 (file)
@@ -558,7 +558,7 @@ int FilterSeqsCommand::driverMPIRun(int start, int num, MPI_File& inMPI, MPI_Fil
 
                        }
                        
-                       if((i+1) % 100 == 0){   cout << (i+1) << endl;   m->mothurOutJustToLog(toString(i+1) + "\n");   }
+                       if((i+1) % 100 == 0){   cout << (i+1) << endl;          }
                }
                
                if(outputString != ""){ //output to file 
@@ -572,7 +572,7 @@ int FilterSeqsCommand::driverMPIRun(int start, int num, MPI_File& inMPI, MPI_Fil
                        delete buf;
                }
                
-               if((num) % 100 != 0){   cout << (num) << endl;   m->mothurOutJustToLog(toString(num) + "\n");   }
+               if((num) % 100 != 0){   cout << (num) << endl;          }
                        
                return 0;
        }
@@ -623,10 +623,10 @@ int FilterSeqsCommand::driverRunFilter(string F, string outputFilename, string i
                        #endif
                        
                        //report progress
-                       if((count) % 100 == 0){ m->mothurOut(toString(count)); m->mothurOutEndLine();           }
+                       if((count) % 100 == 0){ m->mothurOutJustToScreen(toString(count)+"\n");         }
                }
                //report progress
-               if((count) % 100 != 0){ m->mothurOut(toString(count)); m->mothurOutEndLine();           }
+               if((count) % 100 != 0){ m->mothurOutJustToScreen(toString(count)+"\n");                 }
                
                
                out.close();
@@ -1006,10 +1006,10 @@ int FilterSeqsCommand::driverCreateFilter(Filters& F, string filename, linePair*
                        #endif
                        
                        //report progress
-                       if((count) % 100 == 0){ m->mothurOut(toString(count)); m->mothurOutEndLine();           }
+                       if((count) % 100 == 0){ m->mothurOutJustToScreen(toString(count)+"\n");                 }
                }
                //report progress
-               if((count) % 100 != 0){ m->mothurOut(toString(count)); m->mothurOutEndLine();           }
+               if((count) % 100 != 0){ m->mothurOutJustToScreen(toString(count)+"\n");         }
                in.close();
                
                return count;
@@ -1052,11 +1052,11 @@ int FilterSeqsCommand::MPICreateFilter(int start, int num, Filters& F, MPI_File&
                        cout.flush();
                                                
                        //report progress
-                       if((i+1) % 100 == 0){   cout << (i+1) << endl;   m->mothurOutJustToLog(toString(i+1) + "\n");   }
+                       if((i+1) % 100 == 0){   cout << (i+1) << endl;          }
                }
                
                //report progress
-               if((num) % 100 != 0){   cout << num << endl; m->mothurOutJustToLog(toString(num) + "\n");       }
+               if((num) % 100 != 0){   cout << num << endl;    }
                
                return 0;
        }
index 90c13f8ee82722570d129d74874b519cc4ee9a60..ed7cfd1f98ddb6f44c8c7f690447d8dea1d4f6f0 100644 (file)
@@ -168,10 +168,10 @@ static DWORD WINAPI MyCreateFilterThreadFunction(LPVOID lpParam){
                        }\r
             pDataArray->count++;\r
             //report progress\r
-                       if((i) % 100 == 0){     pDataArray->m->mothurOut(toString(i)); pDataArray->m->mothurOutEndLine();               }\r
+                       if((i) % 100 == 0){     pDataArray->m->mothurOutJustToScreen(toString(i)+"\n");                 }\r
                }\r
                \r
-        if((pDataArray->count) % 100 != 0){    pDataArray->m->mothurOut(toString(pDataArray->count)); pDataArray->m->mothurOutEndLine();               }\r
+        if((pDataArray->count) % 100 != 0){    pDataArray->m->mothurOutJustToScreen(toString(pDataArray->count)+"\n");                 }\r
         \r
                in.close();\r
                \r
@@ -223,10 +223,10 @@ static DWORD WINAPI MyRunFilterThreadFunction(LPVOID lpParam){
             }\r
             pDataArray->count++;\r
             //report progress\r
-                       if((i) % 100 == 0){     pDataArray->m->mothurOut(toString(i)); pDataArray->m->mothurOutEndLine();               }\r
+                       if((i) % 100 == 0){     pDataArray->m->mothurOutJustToScreen(toString(i)+"\n");                 }\r
                }\r
                \r
-        if((pDataArray->count) % 100 != 0){    pDataArray->m->mothurOut(toString(pDataArray->count)); pDataArray->m->mothurOutEndLine();               }\r
+        if((pDataArray->count) % 100 != 0){    pDataArray->m->mothurOutJustToScreen(toString(pDataArray->count)+"\n");                 }\r
         \r
                in.close();\r
         out.close();\r
index 310e32bf23e048c73ae37579ac2e8e2d1cb8b0ff..a53a3dcb92837f112771f44ef39219d9e36a277a 100644 (file)
@@ -652,7 +652,7 @@ int MatrixOutputCommand::process(vector<SharedRAbundVector*> thisLookup){
             }
             
             if (subsample && (thisIter != 0)) {  
-                if((thisIter) % 100 == 0){     m->mothurOut(toString(thisIter)); m->mothurOutEndLine();                }
+                if((thisIter) % 100 == 0){     m->mothurOutJustToScreen(toString(thisIter)+"\n");              }
                 calcDistsTotals.push_back(calcDists);
                 for (int i = 0; i < calcDists.size(); i++) {
                     for (int j = 0; j < calcDists[i].size(); j++) {
index 0efa551565c6e18001cd6ed53e0643a50f525f37..fc16d204b142e5a6f55783f56bc52aafb8e6a4d1 100644 (file)
@@ -348,6 +348,27 @@ void MothurOut::mothurOut(string output) {
        }
 }
 /*********************************************************************************************/
+void MothurOut::mothurOutJustToScreen(string output) {
+       try {
+               
+#ifdef USE_MPI
+        int pid;
+        MPI_Comm_rank(MPI_COMM_WORLD, &pid);
+        
+        if (pid == 0) { //only one process should output to screen
+#endif
+            logger() << output;
+            
+#ifdef USE_MPI
+        }
+#endif
+       }
+       catch(exception& e) {
+               errorOut(e, "MothurOut", "MothurOut");
+               exit(1);
+       }
+}
+/*********************************************************************************************/
 void MothurOut::mothurOutEndLine() {
        try {
                #ifdef USE_MPI
index 4a46e051b67bb08caee8c4d97f3947c366d01926..643ecd58a149aebc1ac88f500d4658de98d5e145 100644 (file)
@@ -40,6 +40,7 @@ class MothurOut {
                void mothurOutEndLine(); //writes to cout and the logfile
                void mothurOut(string, ofstream&); //writes to the ofstream, cout and the logfile
                void mothurOutEndLine(ofstream&); //writes to the ofstream, cout and the logfile
+        void mothurOutJustToScreen(string); //writes to cout
                void mothurOutJustToLog(string);
                void errorOut(exception&, string, string);
                void closeLog();
index 78255d8f73d894c7cb4032d925b684843094bee7..28538959a80d8b2a600c33a4c1ff0ed0a77fb75c 100644 (file)
@@ -219,11 +219,11 @@ int correctDist::driver(int start, int end, string distFileName){
                        }
                        distFile << endl;
                        
-                       if(i % 100 == 0){ m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine(); }
+                       if(i % 100 == 0){ m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n"); }
                }
                distFile.close();
                
-               if((end-1) % 100 != 0){ m->mothurOut(toString(end-1) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine(); }
+               if((end-1) % 100 != 0){ m->mothurOutJustToScreen(toString(end-1) + "\t" + toString(time(NULL) - startTime)+"\n"); }
                m->mothurOut("Done.\n");
                
                return 0;
index c9e5ecfdfda727427793e98aaed0270cdcd6e046..7d96e31d1eefb534729e421b266092db1536aa46 100644 (file)
@@ -689,11 +689,11 @@ int PairwiseSeqsCommand::driver(int startLine, int endLine, string dFileName, fl
                        if (output == "lt") { outFile << endl; }
                        
                        if(i % 100 == 0){
-                               m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine();
+                               m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n");
                        }
                        
                }
-               m->mothurOut(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine();
+               m->mothurOutJustToScreen(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)+"\n");
                
                outFile.close();
         delete alignment;
@@ -783,11 +783,11 @@ int PairwiseSeqsCommand::driver(int startLine, int endLine, string dFileName, st
                        outFile << endl; 
                        
                        if(i % 100 == 0){
-                               m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine();
+                               m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n"); 
                        }
                        
                }
-               m->mothurOut(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)); m->mothurOutEndLine();
+               m->mothurOutJustToScreen(toString(endLine-1) + "\t" + toString(time(NULL) - startTime)+"\n");
                
                outFile.close();
         delete alignment;
index defccb5227104798667b49c879617bf9d1811200..cb68e7fa8ef44ce231284e11f3f9a669396d6a44 100644 (file)
@@ -199,11 +199,11 @@ static DWORD WINAPI MyPairwiseSquareThreadFunction(LPVOID lpParam){
                        outFile << endl; 
                        
                        if(i % 100 == 0){
-                               pDataArray->m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine();
+                               pDataArray->m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n"); 
                        }
                        
                }
-               pDataArray->m->mothurOut(toString(pDataArray->count) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine();
+               pDataArray->m->mothurOutJustToScreen(toString(pDataArray->count) + "\t" + toString(time(NULL) - startTime)+"\n");
                
                outFile.close();
         delete alignment;
@@ -302,11 +302,11 @@ static DWORD WINAPI MyPairwiseThreadFunction(LPVOID lpParam){
                        if (pDataArray->output == "lt") { outFile << endl; }
                        
                        if(i % 100 == 0){
-                               pDataArray->m->mothurOut(toString(i) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine();
+                               pDataArray->m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - startTime)+"\n"); 
                        }
                        
                }
-               pDataArray->m->mothurOut(toString(pDataArray->end-1) + "\t" + toString(time(NULL) - startTime)); pDataArray->m->mothurOutEndLine();
+               pDataArray->m->mothurOutJustToScreen(toString(pDataArray->end-1) + "\t" + toString(time(NULL) - startTime)+"\n");
                
                outFile.close();
         delete alignment;
index 16c1e29be5f9cbba00180a55a746bbe923b3cbdb..581675efa046b400b547e46ab64988e83a199714 100644 (file)
@@ -265,10 +265,10 @@ static DWORD WINAPI MyPcrThreadFunction(LPVOID lpParam){
                        }
                                                
                        //report progress
-                       if((i+1) % 100 == 0){   pDataArray->m->mothurOut("Processing sequence: " + toString(i+1)); pDataArray->m->mothurOutEndLine();           }
+                       if((i+1) % 100 == 0){   pDataArray->m->mothurOutJustToScreen("Processing sequence: " + toString(i+1)+"\n");     }
                }
                //report progress
-               if((pDataArray->count) % 100 != 0){     pDataArray->m->mothurOut("Thread Processing sequence: " + toString(pDataArray->count)); pDataArray->m->mothurOutEndLine();              }
+               if((pDataArray->count) % 100 != 0){     pDataArray->m->mothurOutJustToScreen("Thread Processing sequence: " + toString(pDataArray->count)+"\n");                }
                
                goodFile.close();
                inFASTA.close();
index cf93cb796104aa90428e5466546c9839789216f7..8db6c24ff05ce4a5a23bc11a9021b208f5e65d55 100644 (file)
@@ -696,10 +696,10 @@ int PcrSeqsCommand::driverPcr(string filename, string goodFasta, string badFasta
 #endif
                        
                        //report progress
-                       if((count) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine();         }
+                       if((count) % 100 == 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count)+"\n");               }
                }
                //report progress
-               if((count) % 100 != 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine();         }
+               if((count) % 100 != 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count)+"\n");       }
                
         badFile.close();
                goodFile.close();
index c2564c1f769a835fd85559f10811672eb6a34e0d..bbf8df27ac5ee691f091f150638b781f85486a11 100644 (file)
@@ -597,7 +597,7 @@ int PreClusterCommand::process(string newMapFile){
                     out << "ideal_seq_" << (i+1) << '\t' << alignSeqs[i].numIdentical << endl << chunk << endl;;
                     
                 }//end if active i
-                if(i % 100 == 0)       { m->mothurOut(toString(i) + "\t" + toString(numSeqs - count) + "\t" + toString(count)); m->mothurOutEndLine(); }
+                if(i % 100 == 0)       { m->mothurOutJustToScreen(toString(i) + "\t" + toString(numSeqs - count) + "\t" + toString(count)+"\n");       }
             }
         }else {
             map<int, string> mapFile;
@@ -632,7 +632,7 @@ int PreClusterCommand::process(string newMapFile){
                     }//end abundance check
                 }//end for loop j
                 
-                if(i % 100 == 0)       { m->mothurOut(toString(i) + "\t" + toString(numSeqs - count) + "\t" + toString(count)); m->mothurOutEndLine(); }
+                if(i % 100 == 0)       { m->mothurOutJustToScreen(toString(i) + "\t" + toString(numSeqs - count) + "\t" + toString(count)+"\n");       }
             }
             
             for (int i = 0; i < numSeqs; i++) {
index 12dd2d2556fcef245794ff178171920f7f5f0b37..2b93328e64a038695a3abbd10cfe9be1165b783d 100644 (file)
@@ -301,7 +301,7 @@ static DWORD WINAPI MyPreclusterThreadFunction(LPVOID lpParam){
                         out << "ideal_seq_" << (i+1) << '\t' << alignSeqs[i].numIdentical << endl << chunk << endl;
                         
                     }//end if active i
-                    if(i % 100 == 0)   { pDataArray->m->mothurOut(toString(i) + "\t" + toString(numSeqs - count) + "\t" + toString(count)); pDataArray->m->mothurOutEndLine(); }
+                    if(i % 100 == 0)   { pDataArray->m->mothurOutJustToScreen(toString(i) + "\t" + toString(numSeqs - count) + "\t" + toString(count)+"\n");   }
                 }
                 
             }else {
@@ -344,7 +344,7 @@ static DWORD WINAPI MyPreclusterThreadFunction(LPVOID lpParam){
                         }//end abundance check
                     }//end for loop j
                     
-                    if(i % 100 == 0)   { pDataArray->m->mothurOut(toString(i) + "\t" + toString(numSeqs - count) + "\t" + toString(count)); pDataArray->m->mothurOutEndLine(); }
+                    if(i % 100 == 0)   { pDataArray->m->mothurOutJustToScreen(toString(i) + "\t" + toString(numSeqs - count) + "\t" + toString(count)+"\n");   }
                 }
                 
                 for (int i = 0; i < numSeqs; i++) {
index 3718c9a9c0cf843d9f91311b8b7b3cdee814f455..d2fbe935356a2f0752efa683a893a5892e1b2eb2 100644 (file)
@@ -2409,10 +2409,10 @@ int ScreenSeqsCommand::driver(linePair filePos, string goodFName, string badAccn
                        #endif
                        
                        //report progress
-                       if((count) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine();         }
+                       if((count) % 100 == 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count)+"\n");               }
                }
                //report progress
-               if((count) % 100 != 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine();         }
+               if((count) % 100 != 0){ m->mothurOutJustToScreen("Processing sequence: " + toString(count)+"\n");       }
                
                        
                goodFile.close();
@@ -2504,7 +2504,7 @@ int ScreenSeqsCommand::driverMPI(int start, int num, MPI_File& inMPI, MPI_File&
                        }
                        
                        //report progress
-                       if((i) % 100 == 0){     m->mothurOut("Processing sequence: " + toString(i)); m->mothurOutEndLine();             }
+                       if((i) % 100 == 0){     m->mothurOutJustToScreen("Processing sequence: " + toString(i)+"\n");           }
                }
                                
                return 1;
index e2906900980ac7d1897b9e0976435401fb35c8be..aeaddae1300207aff7ef713858e9ee760be52e12 100644 (file)
@@ -449,10 +449,10 @@ static DWORD WINAPI MySumScreenThreadFunction(LPVOID lpParam){
     
                        }               
             //report progress
-                       if((i+1) % 100 == 0){   pDataArray->m->mothurOut("Processing sequence: " + toString(i+1)); pDataArray->m->mothurOutEndLine();           }
+                       if((i+1) % 100 == 0){   pDataArray->m->mothurOutJustToScreen("Processing sequence: " + toString(i+1)+"\n");             }
                }
                //report progress
-               if((pDataArray->count) % 100 != 0){     pDataArray->m->mothurOut("Processing sequence: " + toString(pDataArray->count)); pDataArray->m->mothurOutEndLine();             }
+               if((pDataArray->count) % 100 != 0){     pDataArray->m->mothurOutJustToScreen("Processing sequence: " + toString(pDataArray->count)+"\n");               }
                
 
                
index 2bd7054afc33c4f0600683a1b8ebe50a2fd338c4..203a71ede5544a3d1c5e2eba73072fa825445aac 100644 (file)
@@ -881,7 +881,7 @@ int SeqErrorCommand::driver(string filename, string qFileName, string rFileName,
                                if (queryFile.eof()) { break; }
                        #endif
                        
-                       if(index % 100 == 0){   m->mothurOut(toString(index));  m->mothurOutEndLine(); }
+                       if(index % 100 == 0){   m->mothurOutJustToScreen(toString(index)+"\n");  }
                }
                queryFile.close();
                outChimeraReport.close();
@@ -892,7 +892,7 @@ int SeqErrorCommand::driver(string filename, string qFileName, string rFileName,
                else if(qFileName != "" && aligned == false){   qualFile.close();                       }
         
                //report progress
-               m->mothurOut(toString(index));  m->mothurOutEndLine();
+               m->mothurOutJustToScreen(toString(index)+"\n"); 
                
                return index;
        }
index 90a66f8f633212cf69a2930914a1911c5bca1cb1..6d8336cb40217a9547791e69765230dff0dabe62 100644 (file)
@@ -494,13 +494,8 @@ int SeqSummaryCommand::driverCreateSummary(vector<int>& startPosition, vector<in
                        #else
                                if (in.eof()) { break; }
                        #endif
-                       
-                       //report progress
-                       //if((count) % 100 == 0){       m->mothurOut(toString(count)); m->mothurOutEndLine();           }
                }
-               //report progress
-               //if((count) % 100 != 0){       m->mothurOut(toString(count)); m->mothurOutEndLine();           }
-               
+                               
                in.close();
                
                return count;
index 63157820390d18e1ef598a8bf58932964cc6f369..e970bab34f9276a680bce6e29faa9cf829684e12 100644 (file)
@@ -858,7 +858,7 @@ string ShhherCommand::flowDistMPI(int startSeq, int stopSeq){
                                }
                        }
                        if(i % 100 == 0){
-                               m->mothurOut(toString(i) + '\t' + toString(time(NULL) - begTime) + '\t' + toString((clock()-begClock)/CLOCKS_PER_SEC) + '\n');
+                               m->mothurOutJustToScreen(toString(i) + '\t' + toString(time(NULL) - begTime) + '\t' + toString((clock()-begClock)/CLOCKS_PER_SEC) + '\n');
                        }
                }
                
@@ -867,7 +867,7 @@ string ShhherCommand::flowDistMPI(int startSeq, int stopSeq){
                
                if (m->control_pressed) { return fDistFileName; }
                
-               m->mothurOut(toString(stopSeq) + '\t' + toString(time(NULL) - begTime) + '\t' + toString((clock()-begClock)/CLOCKS_PER_SEC) + '\n');
+               m->mothurOutJustToScreen(toString(stopSeq) + '\t' + toString(time(NULL) - begTime) + '\t' + toString((clock()-begClock)/CLOCKS_PER_SEC) + '\n');
 
                ofstream distFile(fDistFileName.c_str());
                distFile << outStream.str();            
@@ -2545,9 +2545,8 @@ int ShhherCommand::flowDistParentFork(int numFlowCells, string distFileName, int
                                }
                        }
                        if(i % 100 == 0){
-                               m->mothurOut(toString(i) + "\t" + toString(time(NULL) - begTime));
-                               m->mothurOut("\t" + toString((clock()-begClock)/CLOCKS_PER_SEC));
-                               m->mothurOutEndLine();
+                               m->mothurOutJustToScreen(toString(i) + "\t" + toString(time(NULL) - begTime));
+                               m->mothurOutJustToScreen("\t" + toString((clock()-begClock)/CLOCKS_PER_SEC)+"\n");
                        }
                }
                
@@ -2557,9 +2556,8 @@ int ShhherCommand::flowDistParentFork(int numFlowCells, string distFileName, int
                
                if (m->control_pressed) {}
                else {
-                       m->mothurOut(toString(stopSeq-1) + "\t" + toString(time(NULL) - begTime));
-                       m->mothurOut("\t" + toString((clock()-begClock)/CLOCKS_PER_SEC));
-                       m->mothurOutEndLine();
+                       m->mothurOutJustToScreen(toString(stopSeq-1) + "\t" + toString(time(NULL) - begTime));
+                       m->mothurOutJustToScreen("\t" + toString((clock()-begClock)/CLOCKS_PER_SEC)+"\n");
                }
         
         return 0;
index ab8afd07ffd96728e6204d2f9b2bbd2adc719787..272ae8255b6566e0f2c0ff04489580a9a36acdfd 100644 (file)
@@ -421,7 +421,7 @@ int UnifracUnweightedCommand::execute() {
                 delete newCt;
                 delete subSampleTree;
                 
-                if((thisIter+1) % 100 == 0){   m->mothurOut(toString(thisIter+1)); m->mothurOutEndLine();              }
+                if((thisIter+1) % 100 == 0){   m->mothurOutJustToScreen(toString(thisIter+1)+"\n");            }
             }
             if (subsample) { m->mothurOut("It took " + toString(time(NULL) - startSubsample) + " secs to run the subsampling."); m->mothurOutEndLine(); }
             
index 81ea326e67665cb006500ed8d04f273b15fca2b4..3b0c53b7437111cfe5045663a8c78370274b939e 100644 (file)
@@ -408,7 +408,7 @@ int UnifracWeightedCommand::execute() {
                 delete newCt;
                 delete subSampleTree;
                 
-                if((thisIter+1) % 100 == 0){   m->mothurOut(toString(thisIter+1)); m->mothurOutEndLine();              }
+                if((thisIter+1) % 100 == 0){   m->mothurOutJustToScreen(toString(thisIter+1)+"\n");    }
             }
             
             if (m->control_pressed) { delete ct; for (int i = 0; i < T.size(); i++) { delete T[i]; } if (random) { delete output; } outSum.close(); for (int i = 0; i < outputNames.size(); i++) {     m->mothurRemove(outputNames[i]);  } return 0; }