]> git.donarmstrong.com Git - mothur.git/blobdiff - phylosummary.cpp
added otu.association command. added calcSpearman, calcKendall and calcPearson functi...
[mothur.git] / phylosummary.cpp
index 47591f6a8ec577afe99fd21b0ab79b989023ce73..7d9fcac2558da8f50653a11ddafd997b58c1c286 100644 (file)
@@ -121,6 +121,7 @@ string PhyloSummary::getNextTaxon(string& heirarchy){
 
 int PhyloSummary::addSeqToTree(string seqName, string seqTaxonomy){
        try {
+                               
                numSeqs++;
                
                map<string, int>::iterator childPointer;
@@ -131,7 +132,7 @@ int PhyloSummary::addSeqToTree(string seqName, string seqTaxonomy){
                int level = 0;
                
                //are there confidence scores, if so remove them
-               if (seqTaxonomy.find_first_of('(') != -1) {  removeConfidences(seqTaxonomy);    }
+               if (seqTaxonomy.find_first_of('(') != -1) {  m->removeConfidences(seqTaxonomy); }
                
                while (seqTaxonomy != "") {
                        
@@ -148,7 +149,7 @@ int PhyloSummary::addSeqToTree(string seqName, string seqTaxonomy){
                                        //find out the sequences group
                                        string group = groupmap->getGroup(seqName);
                                        
-                                       if (group == "not found") {  m->mothurOut(seqName + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine();  }
+                                       if (group == "not found") {  m->mothurOut("[WARNING]: " + seqName + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine();  }
                                        
                                        //do you have a count for this group?
                                        map<string, int>::iterator itGroup = tree[childPointer->second].groupCount.find(group);
@@ -183,7 +184,7 @@ int PhyloSummary::addSeqToTree(string seqName, string seqTaxonomy){
                                                //find out the sequences group
                                                string group = groupmap->getGroup(seqName);
                                                
-                                               if (group == "not found") {  m->mothurOut(seqName + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine();  }
+                                               if (group == "not found") {  m->mothurOut("[WARNING]: " + seqName + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine();  }
                                                
                                                //do you have a count for this group?
                                                map<string, int>::iterator itGroup = tree[index].groupCount.find(group);
@@ -229,7 +230,7 @@ int PhyloSummary::addSeqToTree(string seqTaxonomy, vector<string> names){
                int level = 0;
                
                //are there confidence scores, if so remove them
-               if (seqTaxonomy.find_first_of('(') != -1) {  removeConfidences(seqTaxonomy);    }
+               if (seqTaxonomy.find_first_of('(') != -1) {  m->removeConfidences(seqTaxonomy); }
                
                while (seqTaxonomy != "") {
                        
@@ -254,7 +255,7 @@ int PhyloSummary::addSeqToTree(string seqTaxonomy, vector<string> names){
                                                //find out the sequences group
                                                string group = groupmap->getGroup(names[k]);
                                        
-                                               if (group == "not found") {  m->mothurOut(names[k] + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine();  }
+                                               if (group == "not found") {  m->mothurOut("[WARNING]: " + names[k] + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine();  }
                                                else {
                                                        containsGroup[group] = true;
                                                }
@@ -296,7 +297,7 @@ int PhyloSummary::addSeqToTree(string seqTaxonomy, vector<string> names){
                                                        //find out the sequences group
                                                        string group = groupmap->getGroup(names[k]);
                                                        
-                                                       if (group == "not found") {  m->mothurOut(names[k] + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine();  }
+                                                       if (group == "not found") {  m->mothurOut("[WARNING]: " + names[k] + " is not in your groupfile, and will be included in the overall total, but not any group total."); m->mothurOutEndLine();  }
                                                        else {
                                                                containsGroup[group] = true;
                                                        }
@@ -496,35 +497,6 @@ void PhyloSummary::readTreeStruct(ifstream& in){
        }
 }
 /**************************************************************************************************/
-void PhyloSummary::removeConfidences(string& tax) {
-       try {
-               
-               string taxon;
-               string newTax = "";
-               
-               while (tax.find_first_of(';') != -1) {
-                       //get taxon
-                       taxon = tax.substr(0,tax.find_first_of(';'));
-                       
-                       int pos = taxon.find_first_of('(');
-                       if (pos != -1) {
-                               taxon = taxon.substr(0, pos); //rip off confidence 
-                       }
-                       
-                       taxon += ";";
-                       
-                       tax = tax.substr(tax.find_first_of(';')+1, tax.length());
-                       newTax += taxon;
-               }
-               
-               tax = newTax;
-       }
-       catch(exception& e) {
-               m->errorOut(e, "PhyloSummary", "removeConfidences");
-               exit(1);
-       }
-}
-/**************************************************************************************************/