]> git.donarmstrong.com Git - mothur.git/blobdiff - bellerophon.cpp
started work on classify.seqs command. changed the database class so that it does...
[mothur.git] / bellerophon.cpp
index 5e219d49c9c6c0b41a80614d347fefbbf3470350..9aa4f7ac7aa566f39a9b68c7b9e0103f516e0ba4 100644 (file)
@@ -32,7 +32,7 @@ void Bellerophon::print(ostream& out) {
                out << "Name\tScore\tLeft\tRight\t" << endl;
                //output prefenence structure to .chimeras file
                for (int i = 0; i < pref.size(); i++) {
-                       out << pref[i].name << '\t' << pref[i].score[0] << '\t' << pref[i].leftParent[0] << '\t' << pref[i].rightParent[0] << endl;
+                       out << pref[i].name << '\t' << setprecision(3) << pref[i].score[0] << '\t' << pref[i].leftParent[0] << '\t' << pref[i].rightParent[0] << endl;
                        
                        //calc # of seqs with preference above 1.0
                        if (pref[i].score[0] > 1.0) { 
@@ -115,7 +115,7 @@ void Bellerophon::getChimeras() {
                                
                        }else{ increment = 0; }
                }
-cout << "increment = " << increment << endl;           
+               
                if (increment == 0) { iters = 1; }
                else { iters = ((seqs[0]->getAlignLength() - (2*window)) / increment); }
                
@@ -193,7 +193,6 @@ cout << "increment = " << increment << endl;
                                delete SparseLeft;
                                delete SparseRight;
                                
-                               
                                //fill preference structure
                                generatePreferences(distMapLeft, distMapRight, midpoint);
                                
@@ -216,17 +215,12 @@ cout << "increment = " << increment << endl;
                        
                        //how much higher or lower is this than expected
                        pref[i].score[0] = pref[i].score[0] / expectedPercent;
-                       
-                       
-                       
-               }
                
+               }
                
                //sort Preferences highest to lowest
                sort(pref.begin(), pref.end(), comparePref);
 
-
-
        }
        catch(exception& e) {
                errorOut(e, "Bellerophon", "getChimeras");
@@ -340,7 +334,6 @@ void Bellerophon::generatePreferences(vector<SeqMap> left, vector<SeqMap> right,
                
                  
                //calculate the dme
-               
                int count0 = 0;
                for (int i = 0; i < pref.size(); i++) {  dme += pref[i].score[1];  if (pref[i].score[1] == 0.0) { count0++; }  }