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 ((globaldata->getListFile() == "") && (globaldata->getRabundFile() == "") && (globaldata->getSabundFile() == "")) { mothurOut("You must read a list, sabund or rabund before you can use the get.label command."); mothurOutEndLine(); abort = true; }
28 errorOut(e, "GetlabelCommand", "GetlabelCommand");
32 //**********************************************************************************************************************
34 void GetlabelCommand::help(){
36 mothurOut("The get.label command can only be executed after a successful read.otu command.\n");
37 mothurOut("You may not use any parameters with the get.label command.\n");
38 mothurOut("The get.label command should be in the following format: \n");
39 mothurOut("get.label()\n");
40 mothurOut("Example get.label().\n");
43 errorOut(e, "GetlabelCommand", "help");
48 //**********************************************************************************************************************
50 GetlabelCommand::~GetlabelCommand(){
53 //**********************************************************************************************************************
55 int GetlabelCommand::execute(){
58 if (abort == true) { return 0; }
60 filename = globaldata->inputFileName;
62 openInputFile(filename, in);
70 mothurOut(label); mothurOutEndLine();
82 errorOut(e, "GetlabelCommand", "execute");