]> git.donarmstrong.com Git - mothur.git/blobdiff - pintail.cpp
moved utilities out of mothur.h and into mothurOut class.
[mothur.git] / pintail.cpp
index 8a159ca381bd3378ee3f2f63d9dabdc692c1676d..4ad60c50742e36c630fbbc81a7f1f73ad527ec42 100644 (file)
@@ -92,7 +92,7 @@ int Pintail::doPrep() {
                m->mothurOut("Getting conservation... "); cout.flush();
                if (consfile == "") { 
                        m->mothurOut("Calculating probability of conservation for your template sequences.  This can take a while...  I will output the frequency of the highest base in each position to a .freq file so that you can input them using the conservation parameter next time you run this command.  Providing the .freq file will improve speed.    "); cout.flush();
-                       probabilityProfile = decalc->calcFreq(templateSeqs, outputDir + getSimpleName(templateFileName)); 
+                       probabilityProfile = decalc->calcFreq(templateSeqs, outputDir + m->getSimpleName(templateFileName)); 
                        if (m->control_pressed) {  return 0;  }
                        m->mothurOut("Done."); m->mothurOutEndLine();
                }else                           {   probabilityProfile = readFreq();    m->mothurOut("Done.");            }
@@ -170,13 +170,13 @@ int Pintail::doPrep() {
                        string noOutliers, outliers;
                        
                        if ((!filter) && (seqMask == "")) {
-                               noOutliers = outputDir + getRootName(getSimpleName(templateFileName)) + "pintail.quan";
+                               noOutliers = outputDir + m->getRootName(m->getSimpleName(templateFileName)) + "pintail.quan";
                        }else if ((!filter) && (seqMask != "")) { 
-                               noOutliers = outputDir + getRootName(getSimpleName(templateFileName)) + "pintail.masked.quan";
+                               noOutliers = outputDir + m->getRootName(m->getSimpleName(templateFileName)) + "pintail.masked.quan";
                        }else if ((filter) && (seqMask != "")) { 
-                               noOutliers = outputDir + getRootName(getSimpleName(templateFileName)) + "pintail.filtered." + getSimpleName(getRootName(fastafile)) + "masked.quan";
+                               noOutliers = outputDir + m->getRootName(m->getSimpleName(templateFileName)) + "pintail.filtered." + m->getSimpleName(m->getRootName(fastafile)) + "masked.quan";
                        }else if ((filter) && (seqMask == "")) { 
-                               noOutliers = outputDir + getRootName(getSimpleName(templateFileName)) + "pintail.filtered." + getSimpleName(getRootName(fastafile)) + "quan";
+                               noOutliers = outputDir + m->getRootName(m->getSimpleName(templateFileName)) + "pintail.filtered." + m->getSimpleName(m->getRootName(fastafile)) + "quan";
                        }
 
                        decalc->removeObviousOutliers(quantilesMembers, templateSeqs.size());
@@ -450,7 +450,7 @@ vector<float> Pintail::readFreq() {
                istringstream iss (tempBuf,istringstream::in);
                
                //read version
-               string line = getline(iss); gobble(iss);
+               string line = m->getline(iss); m->gobble(iss);
                
                while(!iss.eof()) {
                        iss >> pos >> num;
@@ -466,7 +466,7 @@ vector<float> Pintail::readFreq() {
                                prob.push_back(Pi);  
                        }
                        
-                       gobble(iss);
+                       m->gobble(iss);
                }
        
                MPI_File_close(&inMPI);
@@ -474,10 +474,10 @@ vector<float> Pintail::readFreq() {
        #else   
 
                ifstream in;
-               openInputFile(consfile, in);
+               m->openInputFile(consfile, in);
                
                //read version
-               string line = getline(in); gobble(in);
+               string line = m->getline(in); m->gobble(in);
                                
                while(!in.eof()){
                        
@@ -494,7 +494,7 @@ vector<float> Pintail::readFreq() {
                                prob.push_back(Pi);  
                        }
                        
-                       gobble(in);
+                       m->gobble(in);
                }
                in.close();
                
@@ -546,7 +546,7 @@ void Pintail::createProcessesQuan() {
                                //write out data to file so parent can read it
                                ofstream out;
                                string s = toString(getpid()) + ".temp";
-                               openOutputFile(s, out);
+                               m->openOutputFile(s, out);
                                
                                                                
                                //output observed distances
@@ -574,7 +574,7 @@ void Pintail::createProcessesQuan() {
                for (int i=0;i<processors;i++) { 
                        ifstream in;
                        string s = toString(processIDS[i]) + ".temp";
-                       openInputFile(s, in);
+                       m->openInputFile(s, in);
                        
                        vector< vector<float> > quan; 
                        quan.resize(100);
@@ -584,7 +584,7 @@ void Pintail::createProcessesQuan() {
                                int num;
                                in >> num; 
                                
-                               gobble(in);
+                               m->gobble(in);
 
                                vector<float> q;  float w; 
                                for (int j = 0; j < num; j++) {
@@ -593,7 +593,7 @@ void Pintail::createProcessesQuan() {
                                }
 
                                quan[h] = q;
-                               gobble(in);
+                               m->gobble(in);
                        }
                        
        
@@ -655,7 +655,7 @@ vector< vector<float> > Pintail::readQuantiles() {
                delete buffer;
                
                //read version
-               string line = getline(iss); gobble(iss);
+               string line = m->getline(iss); m->gobble(iss);
                
                while(!iss.eof()) {
                        iss >> num >> ten >> twentyfive >> fifty >> seventyfive >> ninetyfive >> ninetynine; 
@@ -671,7 +671,7 @@ vector< vector<float> > Pintail::readQuantiles() {
                        
                        quan.push_back(temp);  
                        
-                       gobble(iss);
+                       m->gobble(iss);
                }
        
                MPI_File_close(&inMPI);
@@ -679,10 +679,10 @@ vector< vector<float> > Pintail::readQuantiles() {
        #else   
 
                ifstream in;
-               openInputFile(quanfile, in);
+               m->openInputFile(quanfile, in);
                
                //read version
-               string line = getline(in); gobble(in);
+               string line = m->getline(in); m->gobble(in);
                        
                while(!in.eof()){
                        
@@ -699,7 +699,7 @@ vector< vector<float> > Pintail::readQuantiles() {
                        
                        quan.push_back(temp);  
        
-                       gobble(in);
+                       m->gobble(in);
                }
                in.close();
        #endif
@@ -749,7 +749,7 @@ void Pintail::printQuanFile(string file, string outputString) {
                        //delete FileName;
                #else
                        ofstream outQuan;
-                       openOutputFile(file, outQuan);
+                       m->openOutputFile(file, outQuan);
                        
                        outQuan << outputString;