From: westcott Date: Mon, 17 May 2010 14:01:43 +0000 (+0000) Subject: change to phylo.diversity to make output = total branch length seen so far for each... X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=commitdiff_plain;h=29b2a01f3daf8f16438b16f0e44b1c36d989d60b change to phylo.diversity to make output = total branch length seen so far for each group instead of total branch length seen so far for each group / total branch length for that group --- diff --git a/phylodiversity.cpp b/phylodiversity.cpp index 96d49d4..37884c4 100644 --- a/phylodiversity.cpp +++ b/phylodiversity.cpp @@ -66,10 +66,11 @@ EstOutput PhyloDiversity::getValues(Tree* t, vector treeNodes) { for (int i=0; iGroups.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; diff --git a/phylodiversitycommand.cpp b/phylodiversitycommand.cpp index 19c65ce..0c2f72d 100644 --- a/phylodiversitycommand.cpp +++ b/phylodiversitycommand.cpp @@ -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"; }