]> git.donarmstrong.com Git - mothur.git/blobdiff - phylosummary.cpp
added code to check path for uchime and catchall executables
[mothur.git] / phylosummary.cpp
index b645bac794777a1050de116407fa834370e7940e..2f565150aabeec35cc8a3c03a459d8b85090550b 100644 (file)
@@ -25,7 +25,7 @@ PhyloSummary::PhyloSummary(string refTfile, string groupFile){
                }
                                
                //check for necessary files
-               string taxFileNameTest = refTfile.substr(0,refTfile.find_last_of(".")+1) + "tree.sum";
+               string taxFileNameTest = m->getFullPathName((refTfile.substr(0,refTfile.find_last_of(".")+1) + "tree.sum"));
                ifstream FileTest(taxFileNameTest.c_str());
                
                if (!FileTest) { 
@@ -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 != "") {
                        
@@ -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 != "") {
                        
@@ -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);
-       }
-}
-/**************************************************************************************************/