From cf9987b67aa49777a4c91c2d21f96e58bf17aa82 Mon Sep 17 00:00:00 2001 From: Sarah Westcott Date: Tue, 21 Jan 2014 10:58:06 -0500 Subject: [PATCH] working on pam --- pam.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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; -- 2.39.2