]> git.donarmstrong.com Git - mothur.git/blobdiff - mgclustercommand.cpp
edited createRabund function
[mothur.git] / mgclustercommand.cpp
index c4cdb50a303e6e814bf7c6e10ca5fcb76935b597..e5681efb220d1635382ea6b077a36ea4e0f50226 100644 (file)
@@ -235,12 +235,12 @@ int MGClusterCommand::execute(){
         RAbundVector* rabund = NULL;
         if(large) {
             map<string, int> nameMapCounts = m->readNames(namefile);
-            RAbundVector* rabund = newFunctionToCreateRabund(list, nameMapCounts);
+            RAbundVector* rabund = createRabund(list, nameMapCounts);
         }else {
             RAbundVector* rabund = new RAbundVector(list->getRAbundVector());
         }
         
-        
+                
                //list = new ListVector(nameMap->getListVector());
                //RAbundVector* rabund = new RAbundVector(list->getRAbundVector());
                
@@ -709,7 +709,19 @@ void MGClusterCommand::sortHclusterFiles(string unsortedDist, string unsortedOve
 
 //**********************************************************************************************************************
 
+RAbundVector MGClusterCommand::createRabund(ListVector list, map<string, int> nameMapCounts){
+    try {
+        RAbundVector rav;
+        for(int i = 0; i < list->getNumBins(); i++) {   rav.push_back(nameMapCounts[i]);    }
+        return rav;
+    }
+    catch(exception& e) {
+               m->errorOut(e, "MGClusterCommand", "createRabund");
+               exit(1);
+       }
+    
+}
 
-
+//**********************************************************************************************************************