]> git.donarmstrong.com Git - mothur.git/blob - getgroupcommand.cpp
altered venn command to make use of sharedchao for any number of groups, fixed window...
[mothur.git] / getgroupcommand.cpp
1 /*
2  *  getgroupcommand.cpp
3  *  Mothur
4  *
5  *  Created by Thomas Ryabin on 2/2/09.
6  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
7  *
8  */
9
10 #include "getgroupcommand.h"
11
12
13 GetgroupCommand::GetgroupCommand(){
14         try {
15                 globaldata = GlobalData::getInstance();
16                 groupMap = globaldata->gGroupmap;
17                 outputFile = globaldata->inputFileName + ".bootGroups";
18                 openOutputFile(outputFile, out);
19         }
20         catch(exception& e) {
21                 cout << "Standard Error: " << e.what() << " has occurred in the GetgroupCommand class Function GetgroupCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
22                 exit(1);
23         }
24         catch(...) {
25                 cout << "An unknown error has occurred in the GetgroupCommand class function GetgroupCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
26                 exit(1);
27         }       
28                         
29 }
30
31 //**********************************************************************************************************************
32
33 GetgroupCommand::~GetgroupCommand(){
34 }
35
36 //**********************************************************************************************************************
37
38 int GetgroupCommand::execute(){
39         try {
40                 vector<string> groupNames = groupMap->namesOfGroups;    
41                 for(int i = 0; i < groupNames.size(); i++) {
42                         cout << groupNames[i] << "\n";
43                         out << groupNames[i] << "\t" << groupNames[i] << "\n";
44                 }
45                 out.close();
46                 return 0;       
47         }
48
49         catch(exception& e) {
50                 cout << "Standard Error: " << e.what() << " has occurred in the GetgroupCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
51                 exit(1);
52         }
53         catch(...) {
54                 cout << "An unknown error has occurred in the GetgroupCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
55                 exit(1);
56         }       
57 }
58
59