]> git.donarmstrong.com Git - mothur.git/commitdiff
change to phylo.diversity to make output = total branch length seen so far for each...
authorwestcott <westcott>
Mon, 17 May 2010 14:01:43 +0000 (14:01 +0000)
committerwestcott <westcott>
Mon, 17 May 2010 14:01:43 +0000 (14:01 +0000)
phylodiversity.cpp
phylodiversitycommand.cpp

index 96d49d489e192cc3f9b1cf52f4091dc32cab9f20..37884c483619887bcc478b6fdf7e77be08424cd4 100644 (file)
@@ -66,10 +66,11 @@ EstOutput PhyloDiversity::getValues(Tree* t, vector<int> treeNodes) {
                
        
                for (int i=0; i<globaldata->Groups.size(); i++) {   
-                       if (groupTotals[globaldata->Groups[i]] != 0.0) { //avoid divide by zero error
-                               float percent = DScore[globaldata->Groups[i]] / groupTotals[globaldata->Groups[i]];
-                               data.push_back(percent);  
-                       }else {  data.push_back(0.0);  }
+                       //if (groupTotals[globaldata->Groups[i]] != 0.0) { //avoid divide by zero error
+                               //float percent = DScore[globaldata->Groups[i]] / groupTotals[globaldata->Groups[i]];
+                       float percent = DScore[globaldata->Groups[i]]; 
+                       data.push_back(percent);  
+                       //}else {  data.push_back(0.0);  }
                }
                
                return data;
index 19c65ce9a11c30e19d6d10a477165c1bcbe164c1..0c2f72d0ad6fd57f628ec01d16ba6c8c31a00d8c 100644 (file)
@@ -113,7 +113,7 @@ int PhyloDiversityCommand::execute(){
                
                        if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) {        remove(outputNames[i].c_str());         } return 0; }
                        
-                       phylo.setTotalGroupBranchLengths(trees[i]);
+                       //phylo.setTotalGroupBranchLengths(trees[i]);
                        
                        string outFile = outputDir + getRootName(getSimpleName(globaldata->getTreeFile()))  + toString(i+1) + ".phylo.diversity";
                        if (rarefy) { outFile += ".rarefaction"; }