]> git.donarmstrong.com Git - mothur.git/blobdiff - pintail.cpp
removing extra file output from pintail
[mothur.git] / pintail.cpp
index 04dfb0a76467ab6b030cfa60b8462dd7d30afd73..7ae3ff6dbb96224197dff97db4b435880738d87b 100644 (file)
@@ -41,13 +41,15 @@ void Pintail::print(ostream& out) {
                for (int i = 0; i < querySeqs.size(); i++) {
                        
                        int index = ceil(deviation[i]);
-                       
-                       if (index == 0) { index=1;  }
                                                
                        //is your DE value higher than the 95%
                        string chimera;
-                       if (DE[i] > quantiles[index-1][4])              {       chimera = "Yes";        }
-                       else                                                                    {       chimera = "No";         }
+                       if (quantiles[index][4] == 0.0) {
+                               chimera = "Your template does not include sequences that provide quantile values at distance " + toString(index);
+                       }else {
+                               if (DE[i] > quantiles[index][4])                {       chimera = "Yes";        }
+                               else                                                                    {       chimera = "No";         }
+                       }
                        
                        out << querySeqs[i]->getName() << '\t' << "div: " << deviation[i] << "\tstDev: " << DE[i] << "\tchimera flag: " << chimera << endl;
                        if (chimera == "Yes") {
@@ -144,18 +146,15 @@ void Pintail::getChimeras() {
                        mothurOut("Done."); mothurOutEndLine();
                }else {         createProcessesPairs();         }
                
-/*string o = "foronlinepintailpairs-eachgap";
-ofstream out7;
-openOutputFile(o, out7);
+//string o = "closestmatch.eachgap.fasta";
+//ofstream out7;
+//openOutputFile(o, out7);
 
-for (int i = 0; i < bestfit.size(); i++) {
-       out7 << querySeqs[i]->getName() << endl;
-       out7 << querySeqs[i]->getUnaligned() << endl << endl;
-       
-       out7 << bestfit[i]->getName() << endl;
-       out7 << bestfit[i]->getUnaligned() << endl << endl << endl;
-}              
-out7.close();/*/       
+//for (int i = 0; i < bestfit.size(); i++) {
+       //out7 << ">" << querySeqs[i]->getName() << "-"<< bestfit[i]->getName() << endl;
+       //out7 << bestfit[i]->getAligned() << endl;
+//}            
+//out7.close();        
                //find P
                mothurOut("Getting conservation... "); cout.flush();
                if (consfile == "") { 
@@ -279,10 +278,19 @@ out7.close();/*/
                        ofstream out4, out5;
                        string noOutliers, outliers;
                        
-                       noOutliers = getRootName(templateFile) + "pintail.quanNOOUTLIERS";
-                       outliers = getRootName(templateFile) + "pintail.quanYESOUTLIERS";
+                       if ((!filter) && (seqMask == "")) {
+                               noOutliers = getRootName(templateFile) + "pintail.quan";
+                       }else if ((filter) && (seqMask == "")) { 
+                               noOutliers = getRootName(templateFile) + "pintail.filtered.quan";
+                       }else if ((!filter) && (seqMask != "")) { 
+                               noOutliers = getRootName(templateFile) + "pintail.masked.quan";
+                       }else if ((filter) && (seqMask != "")) { 
+                               noOutliers = getRootName(templateFile) + "pintail.filtered.masked.quan";
+                       }
+
+                       //outliers = getRootName(templateFile) + "pintail.quanYESOUTLIERS";
                        
-                       openOutputFile(outliers, out4);
+                       /*openOutputFile(outliers, out4);
                        
                        //adjust quantiles
                        for (int i = 0; i < quantilesMembers.size(); i++) {
@@ -321,7 +329,7 @@ out7.close();/*/
                                
                        }
                        
-                       out4.close();
+                       out4.close();*/
                        
                        decalc->removeObviousOutliers(quantilesMembers, templateSeqs.size());