From: Sarah Westcott Date: Tue, 21 Jan 2014 15:58:06 +0000 (-0500) Subject: working on pam X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=commitdiff_plain;h=cf9987b67aa49777a4c91c2d21f96e58bf17aa82 working on pam --- 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;