]> git.donarmstrong.com Git - mothur.git/commitdiff
mgcluster with count file needed to create a nameMap to pass to readBlast like the...
authorSarah Westcott <mothur.westcott@gmail.com>
Thu, 13 Jun 2013 18:35:45 +0000 (14:35 -0400)
committerSarah Westcott <mothur.westcott@gmail.com>
Thu, 13 Jun 2013 18:35:45 +0000 (14:35 -0400)
mgclustercommand.cpp

index e76dd4860b03826db116323af7e42528a591c526..e3287f7f9bb19a4079c28e92fe57cf99e06216d5 100644 (file)
@@ -228,7 +228,13 @@ int MGClusterCommand::execute(){
                if (namefile != "") {
                        nameMap = new NameAssignment(namefile);
                        nameMap->readMap();
-               }else{ nameMap= new NameAssignment(); }
+               }else if (countfile != "") {
+            ct = new CountTable();
+            ct->readTable(countfile, false);
+            nameMap= new NameAssignment();
+            vector<string> tempNames = ct->getNamesOfSeqs();
+            for (int i = 0; i < tempNames.size(); i++) {  nameMap->push_back(tempNames[i]);  }
+        }else{ nameMap= new NameAssignment(); }
                
                string fileroot = outputDir + m->getRootName(m->getSimpleName(blastfile));
                string tag = "";
@@ -245,9 +251,6 @@ int MGClusterCommand::execute(){
         RAbundVector* rabund = NULL;
         
         if(countfile != "") {
-            //map<string, int> nameMapCounts = m->readNames(namefile);
-            ct = new CountTable();
-            ct->readTable(countfile, false);
             rabund = new RAbundVector();
             createRabund(ct, list, rabund);
         }else {