]> git.donarmstrong.com Git - mothur.git/commitdiff
working on mgcluster count file change
authorSarah Westcott <mothur.westcott@gmail.com>
Wed, 11 Jul 2012 19:09:35 +0000 (15:09 -0400)
committerSarah Westcott <mothur.westcott@gmail.com>
Wed, 11 Jul 2012 19:09:35 +0000 (15:09 -0400)
mgclustercommand.cpp
mgclustercommand.h

index cffb80f9e8f2963d4983c6637d8eef2b33566de4..6ef968c2248de78e304291f3c781a2baa44ad8ea 100644 (file)
@@ -172,7 +172,7 @@ MGClusterCommand::MGClusterCommand(string option) {
                        else if (countfile == "not found") { countfile = ""; }
             else { m->setCountTableFile(countfile); }
             
-            if (countfile != "" && namefile != "") { m->mothurOut("Cannot have both a name file and count file. Please use one or the other."); m->mothurOutEndLine(); abort = true; }
+            if (countfile != "" && namefile != "") { m->mothurOut("[ERROR]: Cannot have both a name file and count file. Please use one or the other."); m->mothurOutEndLine(); abort = true; }
                        
                        if ((blastfile == "")) { m->mothurOut("When executing a mgcluster command you must provide a blastfile."); m->mothurOutEndLine(); abort = true; }
                        
@@ -249,8 +249,8 @@ int MGClusterCommand::execute(){
             //map<string, int> nameMapCounts = m->readNames(namefile);
             ct = new CountTable();
             ct->readTable(countfile);
-            createRabund(ct, list);
-            rabund = &rav;
+            rabund = new RAbundVector();
+            createRabund(ct, list, rabund);
         }else {
             rabund = new RAbundVector(list->getRAbundVector());
         }
@@ -724,7 +724,7 @@ void MGClusterCommand::sortHclusterFiles(string unsortedDist, string unsortedOve
 
 //**********************************************************************************************************************
 
-void MGClusterCommand::createRabund(CountTable* ct, ListVector* list){
+void MGClusterCommand::createRabund(CountTable*& ct, ListVector*& list, RAbundVector*& rabund){
     try {
         //vector<string> names = ct.getNamesOfSeqs();
 
@@ -739,7 +739,7 @@ void MGClusterCommand::createRabund(CountTable* ct, ListVector* list){
            for (int j = 0; j < binNames.size(); j++) { 
                total += ct->getNumSeqs(binNames[j]);
            }
-           rav.push_back(total);   
+           rabund->push_back(total);   
        }
         
         
index 0626b86cd96792dfce2b4c523760749f44d74858..6c75d6c606f90d33d2d67b687fa567309012dd3e 100644 (file)
@@ -64,7 +64,7 @@ private:
        ListVector* mergeOPFs(map<string, int>, float);
        void sortHclusterFiles(string, string);
        vector<seqDist> getSeqs(ifstream&);
-    void createRabund(CountTable*, ListVector*);
+    void createRabund(CountTable*&, ListVector*&, RAbundVector*&);
 
 };