]> git.donarmstrong.com Git - mothur.git/commitdiff
mods in testing 1.16.0
authorwestcott <westcott>
Wed, 26 Jan 2011 17:57:33 +0000 (17:57 +0000)
committerwestcott <westcott>
Wed, 26 Jan 2011 17:57:33 +0000 (17:57 +0000)
Mothur.xcodeproj/project.pbxproj
clusterfragmentscommand.cpp
getlineagecommand.cpp
linearalgebra.cpp
metastats.h
odum.cpp
phylodiversitycommand.cpp
removelineagecommand.cpp

index 24187d82fd0bff1934e3faeb458bb062fba6548b..2f3cc5520b1b3454081b9db51fe4d75662070c18 100644 (file)
                                GCC_OPTIMIZATION_LEVEL = 0;
                                GCC_PREPROCESSOR_DEFINITIONS = (
                                        "MOTHUR_FILES=\"\\\"../release\\\"\"",
-                                       "VERSION=\"\\\"1.15.0\\\"\"",
-                                       "RELEASE_DATE=\"\\\"12/10/2010\\\"\"",
+                                       "VERSION=\"\\\"1.16.0\\\"\"",
+                                       "RELEASE_DATE=\"\\\"1/26/2010\\\"\"",
                                );
                                GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
index 6eff3a74e6cf984b9c0dcdd33f5453db5ef8fc91..24070d2bb0e8b8f781eece4e35e7dec4f42d6797 100644 (file)
@@ -213,7 +213,7 @@ int ClusterFragmentsCommand::execute(){
                                        if (alignSeqs[j].active) {  //this sequence has not been merged yet
                                                
                                                string jBases = alignSeqs[j].seq.getUnaligned();
-                                                                                               
+                                                                                                       
                                                if (isFragment(iBases, jBases)) {
                                                        //merge
                                                        alignSeqs[i].names += ',' + alignSeqs[j].names;
@@ -291,7 +291,7 @@ bool ClusterFragmentsCommand::isFragment(string seq1, string seq2){
                                int percentDiff = floor((seq2.length() * (percent / 100.0)));
                                if (percentDiff < totalDiffs) { totalDiffs = percentDiff; }
                        }
-                               
+                       
                        Alignment* alignment = new NeedlemanOverlap(-1.0, 1.0, -1.0, (seq1.length()+totalDiffs+1));
                                                        
                        //use needleman to align 
@@ -314,6 +314,7 @@ bool ClusterFragmentsCommand::isFragment(string seq1, string seq2){
                        }
                        
                        if (numDiffs <= totalDiffs) { fragment = true; }
+                       
                }
                
                return fragment;
index 4231435e556f205b753985bacca8d418b0d07c2c..8a6f47c0998202943e398fce09a9ae52edfa5eda 100644 (file)
@@ -677,8 +677,14 @@ vector< map<string, int> > GetLineageCommand::getTaxons(string tax) {
                                int openParen = taxon.find_first_of('(');
                                int closeParen = taxon.find_last_of(')');
                                
-                               string newtaxon = taxon.substr(0, openParen); //rip off confidence
-                               string confidence = taxon.substr((openParen+1), (closeParen-openParen-1));  
+                               string newtaxon, confidence;
+                               if ((openParen != string::npos) && (closeParen != string::npos)) {
+                                       newtaxon = taxon.substr(0, openParen); //rip off confidence
+                                       confidence = taxon.substr((openParen+1), (closeParen-openParen-1));  
+                               }else{
+                                       newtaxon = taxon;
+                                       confidence = "0";
+                               } 
                                int con = 0;
                                convert(confidence, con);
                                
index 27d35ac2cd7c40d4502aa469ffa62f2d01ff31ec..a2ee221b9d79c0997f25f6c9baf09cdd0b752bf2 100644 (file)
@@ -372,6 +372,9 @@ double LinearAlgebra::calcPearson(vector< vector<double> >& euclidDists, vector<
                double denom = (sqrt(denomTerm1) * sqrt(denomTerm2));
                double r = numerator / denom;
                
+               //divide by zero error
+               if (isnan(r) || isinf(r)) { r = 0.0; }
+               
                return r;
                
        }
index a833474b740d829c3fd85beea38e87aaf652636f..5bab288f5064f5d325304e072901abb86a72f598 100644 (file)
@@ -39,4 +39,7 @@ int metastat_main (char*, int, int, double, int, double**, int);
 }
 #endif
 
-#endif
\ No newline at end of file
+#endif
+
+
+
index e9cc5b86cba5f9a6a1f8b9dac10215e3445db8d5..ec432e03b80f471e2d275c3af9b9006c30573be0 100644 (file)
--- a/odum.cpp
+++ b/odum.cpp
@@ -24,7 +24,7 @@ EstOutput Odum::getValues(vector<SharedRAbundVector*> shared) {
                        int Bij = shared[1]->getAbundance(i);
                        
                        sumNum += abs(Aij - Bij);
-                       sumDenom += Aij + Bij;
+                       sumDenom += (Aij + Bij);
                }
                
                data[0] = sumNum / sumDenom;
index 80d909016103f3b579f9096f342cf3a8acbb677b..4eb652c9b951f0e1384eafeae722b6ea583b5790 100644 (file)
@@ -595,4 +595,7 @@ vector<float> PhyloDiversityCommand::calcBranchLength(Tree* t, int leaf, map< st
                exit(1);
        }
 }
-//**********************************************************************************************************************
\ No newline at end of file
+//**********************************************************************************************************************
+
+
+
index 9467ff60d50b3d72f3f016ed934ba828566f950f..0a5c5c7135941843452e2100977cfff9df3d4b19 100644 (file)
@@ -551,6 +551,7 @@ int RemoveLineageCommand::readTax(){
                        
                        //if the users file contains confidence scores we want to ignore them when searching for the taxons, unless the taxon has them
                        if (!taxonsHasConfidence) {
+                               
                                int hasConfidences = tax.find_first_of('(');
                                if (hasConfidences != string::npos) { 
                                        newtax = removeConfidences(tax);
@@ -568,7 +569,7 @@ int RemoveLineageCommand::readTax(){
                        }else{//if taxons has them and you don't them remove taxons
                                int hasConfidences = tax.find_first_of('(');
                                if (hasConfidences == string::npos) { 
-                                       
+                               
                                        int pos = newtax.find(noConfidenceTaxons);
                                        
                                        if (pos == string::npos) { 
@@ -579,7 +580,7 @@ int RemoveLineageCommand::readTax(){
                                        }
                                }else { //both have confidences so we want to make sure the users confidences are greater then or equal to the taxons
                                        //first remove confidences from both and see if the taxonomy exists
-                                       
+                               
                                        string noNewTax = tax;
                                        int hasConfidences = tax.find_first_of('(');
                                        if (hasConfidences != string::npos) { 
@@ -671,8 +672,14 @@ vector< map<string, int> > RemoveLineageCommand::getTaxons(string tax) {
                                int openParen = taxon.find_first_of('(');
                                int closeParen = taxon.find_last_of(')');
                                
-                               string newtaxon = taxon.substr(0, openParen); //rip off confidence
-                               string confidence = taxon.substr((openParen+1), (closeParen-openParen-1));  
+                               string newtaxon, confidence;
+                               if ((openParen != string::npos) && (closeParen != string::npos)) {
+                                       newtaxon = taxon.substr(0, openParen); //rip off confidence
+                                       confidence = taxon.substr((openParen+1), (closeParen-openParen-1));  
+                               }else{
+                                       newtaxon = taxon;
+                                       confidence = "0";
+                               }
                                int con = 0;
                                convert(confidence, con);