5 * Created by Thomas Ryabin on 2/2/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "getgroupcommand.h"
13 GetgroupCommand::GetgroupCommand(){
15 globaldata = GlobalData::getInstance();
18 sharedfile = globaldata->getSharedFile();
19 openInputFile(sharedfile, in);
22 outputFile = getRootName(globaldata->inputFileName) + "bootGroups";
23 openOutputFile(outputFile, out);
26 cout << "Standard Error: " << e.what() << " has occurred in the GetgroupCommand class Function GetgroupCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
30 cout << "An unknown error has occurred in the GetgroupCommand class function GetgroupCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
36 //**********************************************************************************************************************
38 GetgroupCommand::~GetgroupCommand(){
41 //**********************************************************************************************************************
43 int GetgroupCommand::execute(){
45 int num, inputData, count;
47 string holdLabel, nextLabel, groupN, label;
49 //read in first row since you know there is at least 1 group.
50 in >> label >> groupN >> num;
54 cout << groupN << endl;
55 out << groupN << '\t' << groupN << endl;
58 for(int i=0;i<num;i++){
62 if (in.eof() != true) { in >> nextLabel; }
64 //read the rest of the groups info in
65 while ((nextLabel == holdLabel) && (in.eof() != true)) {
70 cout << groupN << endl;
71 out << groupN << '\t' << groupN << endl;
74 for(int i=0;i<num;i++){
78 if (in.eof() != true) { in >> nextLabel; }
86 cout << "Standard Error: " << e.what() << " has occurred in the GetgroupCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
90 cout << "An unknown error has occurred in the GetgroupCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";