5 * Created by Sarah Westcott on 1/20/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "readdistcommand.h"
12 ReadDistCommand::ReadDistCommand(){
14 globaldata = GlobalData::getInstance();
16 filename = globaldata->inputFileName;
17 format = globaldata->getFormat();
19 if (format == "column") { read = new ReadColumnMatrix(filename); }
20 else if (format == "phylip") { read = new ReadPhylipMatrix(filename); }
22 if(globaldata->getPrecision() != ""){
23 convert(globaldata->getPrecision(), precision);
26 if(globaldata->getCutOff() != ""){
27 convert(globaldata->getCutOff(), cutoff);
28 cutoff += (5 / (precision * 10.0));
30 read->setCutoff(cutoff);
32 if(globaldata->getNameFile() != ""){
33 nameMap = new NameAssignment(globaldata->getNameFile());
34 nameMap->readMap(1,2);
42 cout << "Standard Error: " << e.what() << " has occurred in the ReadDistCommand class Function ReadDistCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
46 cout << "An unknown error has occurred in the ReadDistCommand class function ReadDistCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
51 //**********************************************************************************************************************
52 ReadDistCommand::~ReadDistCommand(){
57 //**********************************************************************************************************************
58 int ReadDistCommand::execute(){
61 globaldata->setListVector(read->getListVector());
62 globaldata->setSparseMatrix(read->getMatrix());
66 cout << "Standard Error: " << e.what() << " has occurred in the ReadDistCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
70 cout << "An unknown error has occurred in the ReadDistCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";