5 * Created by Thomas Ryabin on 1/30/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "getlabelcommand.h"
12 //**********************************************************************************************************************
14 GetlabelCommand::GetlabelCommand(string option){
16 globaldata = GlobalData::getInstance();
19 //allow user to run help
20 if(option == "help") { help(); abort = true; }
23 if (option != "") { cout << "There are no valid parameters for the get.label command." << endl; abort = true; }
25 if ((globaldata->getListFile() == "") && (globaldata->getRabundFile() == "") && (globaldata->getSabundFile() == "")) { cout << "You must read a list, sabund or rabund before you can use the get.label command." << endl; abort = true; }
30 cout << "Standard Error: " << e.what() << " has occurred in the GetlabelCommand class Function GetlabelCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
34 cout << "An unknown error has occurred in the GetlabelCommand class function GetlabelCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
39 //**********************************************************************************************************************
41 void GetlabelCommand::help(){
43 cout << "The get.label command can only be executed after a successful read.otu command." << "\n";
44 cout << "You may not use any parameters with the get.label command." << "\n";
45 cout << "The get.label command should be in the following format: " << "\n";
46 cout << "get.label()" << "\n";
47 cout << "Example get.label()." << "\n";
50 cout << "Standard Error: " << e.what() << " has occurred in the GetlabelCommand class Function help. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
54 cout << "An unknown error has occurred in the GetlabelCommand class function help. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
59 //**********************************************************************************************************************
61 GetlabelCommand::~GetlabelCommand(){
64 //**********************************************************************************************************************
66 int GetlabelCommand::execute(){
69 if (abort == true) { return 0; }
71 filename = globaldata->inputFileName;
73 openInputFile(filename, in);
81 cout << label << "\n";
91 cout << "Standard Error: " << e.what() << " has occurred in the GetlabelCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
95 cout << "An unknown error has occurred in the GetlabelCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";