]> git.donarmstrong.com Git - mothur.git/blobdiff - parselistcommand.cpp
I've changed the listfile, sabundfile, etc. option handles to not need the "file...
[mothur.git] / parselistcommand.cpp
index 8a848e768fd5c4c2775bec636be6acf64dd5d2ac..5379052d6dd4f1bbfe51b3b346874def78a7b841 100644 (file)
@@ -27,12 +27,7 @@ ParseListCommand::ParseListCommand(){
                }
                
                //set fileroot
-               if(globaldata->getFileRoot() != ""){
-                       fileroot = globaldata->getFileRoot();
-               }
-               else{
-                       fileroot = getRootName(globaldata->getDistFile());
-               }
+               fileroot = getRootName(globaldata->getListFile());
                
                //open output list files
                for (i=0; i<groupMap->getNumGroups(); i++) {//opens an output file for each group
@@ -96,8 +91,7 @@ int ParseListCommand::execute(){
                        read = new ReadPhilFile(globaldata->inputFileName);     
                        read->read(&*globaldata); 
                        input = globaldata->ginput;
-                       //list = input->getListVector();
-                       list = globaldata->glist;
+                       list = globaldata->gSharedList;
 
                        //read in group map info.
                        groupMap = new GroupMap(globaldata->getGroupFile());
@@ -107,7 +101,7 @@ int ParseListCommand::execute(){
                        int i;
                        //create new list vectors to fill with parsed data
                        for (i=0; i<groupMap->getNumGroups(); i++) {
-                               groupOfLists[groupMap->namesOfGroups[i]] = new ListVector();
+                               groupOfLists[groupMap->namesOfGroups[i]] = new SharedListVector();
                        }
                        
                        //parses and sets each groups listvector
@@ -128,8 +122,12 @@ int ParseListCommand::execute(){
                                        groupOfLists[groupMap->namesOfGroups[i]]->print(*(filehandles[groupMap->namesOfGroups[i]]));
                                        groupOfLists[groupMap->namesOfGroups[i]]->clear();
                                }
-                               list = input->getListVector();
+                               list = input->getSharedListVector();
                        }
+                       
+                       //set groupmap for .shared commands
+                       globaldata->gGroupmap = groupMap; 
+                       
                        return 0;
        }
        catch(exception& e) {
@@ -146,7 +144,6 @@ int ParseListCommand::execute(){
 
 ParseListCommand::~ParseListCommand(){
        delete list;
-       delete groupMap;
        delete input;
        delete read;    
 }