2 * rarefactsharedcommand.cpp
5 * Created by Sarah Westcott on 1/6/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "rarefactsharedcommand.h"
11 #include "sharedsobs.h"
13 //**********************************************************************************************************************
15 RareFactSharedCommand::RareFactSharedCommand(){
17 globaldata = GlobalData::getInstance();
19 fileNameRoot = getRootName(globaldata->inputFileName);
22 for (i=0; i<globaldata->sharedRareEstimators.size(); i++) {
23 if (globaldata->sharedRareEstimators[i] == "sharedobserved") {
24 rDisplays.push_back(new RareDisplay(new SharedSobs(), new SharedThreeColumnFile(fileNameRoot+"shared.rarefaction", "")));
29 cout << "Standard Error: " << e.what() << " has occurred in the RareFactSharedCommand class Function RareFactSharedCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
33 cout << "An unknown error has occurred in the RareFactSharedCommand class function RareFactSharedCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
39 //**********************************************************************************************************************
41 RareFactSharedCommand::~RareFactSharedCommand(){
48 //**********************************************************************************************************************
50 int RareFactSharedCommand::execute(){
53 read = new ReadPhilFile(globaldata->inputFileName);
54 read->read(&*globaldata);
56 input = globaldata->ginput;
57 SharedList = globaldata->gSharedList;
58 order = SharedList->getSharedOrderVector();
62 if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(order->getLabel()) == 1){
63 //create collectors curve
64 rCurve = new Rarefact(order, rDisplays);
65 convert(globaldata->getFreq(), freq);
66 convert(globaldata->getIters(), nIters);
67 rCurve->getSharedCurve(freq, nIters);
71 cout << order->getLabel() << '\t' << count << endl;
74 SharedList = input->getSharedListVector(); //get new list vector to process
75 if (SharedList != NULL) {
76 order = SharedList->getSharedOrderVector(); //gets new order vector with group info.
84 for(int i=0;i<rDisplays.size();i++){ delete rDisplays[i]; }
88 cout << "Standard Error: " << e.what() << " has occurred in the RareFactSharedCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
92 cout << "An unknown error has occurred in the RareFactSharedCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
98 //**********************************************************************************************************************