X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=pam.cpp;h=bcc51fc7e87e93c6ed67b741b4e0335ea380327f;hp=2c70f58f5770135d93e97dbe06a7392816b37197;hb=cf9987b67aa49777a4c91c2d21f96e58bf17aa82;hpb=a2cde58c1e72199498a2142983ef040dce36da10 diff --git a/pam.cpp b/pam.cpp index 2c70f58..bcc51fc 100644 --- a/pam.cpp +++ b/pam.cpp @@ -339,6 +339,33 @@ double Pam::calcCHIndex(vector< vector > dists){ //countMatrix = [numSam } } + //make countMatrix a relabund + vector > relativeAbundance(numSamples); + //get relative abundance + for(int i=0;icontrol_pressed) { return 0; } + int groupTotal = 0; + + relativeAbundance[i].assign(numOTUs, 0.0); + + for(int j=0;j > centers; centers.resize(numPartitions); + int countPartitions = 0; + for (set::iterator it = medoids.begin(); it != medoids.end(); it++) { + for (int j = 0; j < numOTUs; j++) { + centers[countPartitions].push_back(relativeAbundance[*it][j]); //save the relative abundance of the medoid for this partition for this OTU + } + countPartitions++; + } + double sumBetweenCluster = 0.0; double sumWithinClusters = 0.0;