5 * Created by Thomas Ryabin on 4/13/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "readseqscommand.h"
12 //**********************************************************************************************************************
13 ReadSeqsCommand::ReadSeqsCommand(){
15 globaldata = GlobalData::getInstance();
16 filename = globaldata->inputFileName;
17 if(globaldata->getFastaFile().compare("") != 0) {
18 readFasta = new ReadFasta(filename);
20 globaldata->gSequenceDB = readFasta->getDB();
22 else if(globaldata->getNexusFile().compare("") != 0) {
23 readNexus = new ReadNexus(filename);
25 globaldata->gSequenceDB = readNexus->getDB();
27 else if(globaldata->getClustalFile().compare("") != 0) {
28 readClustal = new ReadClustal(filename);
30 globaldata->gSequenceDB = readClustal->getDB();
32 else if(globaldata->getPhylipFile().compare("") != 0) {
33 readPhylip = new ReadPhylip(filename);
35 globaldata->gSequenceDB = readPhylip->getDB();
39 cout << "Standard Error: " << e.what() << " has occurred in the ReadSeqsCommand class Function ReadSeqsCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
43 cout << "An unknown error has occurred in the ReadSeqsCommand class function ReadSeqsCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
48 //**********************************************************************************************************************
50 ReadSeqsCommand::~ReadSeqsCommand(){
51 //delete readFasta->getDB();
52 // delete readNexus->getDB();
53 // delete readClustal->getDB();
54 // delete readPhylip->getDB();
57 //**********************************************************************************************************************
59 int ReadSeqsCommand::execute(){
63 //fb.open ("fasta.txt",ios::out);
65 // SequenceDB* db = readFasta->getDB();
67 //fb.open("nexus.txt",ios::out);
69 // SequenceDB* db = readNexus->getDB();
71 //fb.open("clustal.txt",ios::out);
72 // readClustal->read();
73 // SequenceDB* db = readClustal->getDB();
75 //fb.open("phylip.txt",ios::out);
76 // readPhylip->read();
77 // SequenceDB* db = readPhylip->getDB();
81 //for(int i = 0; i < db->size(); i++) {
82 // cout << db->get(i).getLength() << "\n" << db->get(i).getName() << ": " << db->get(i).getAligned() << "\n\n";
92 cout << "Standard Error: " << e.what() << " has occurred in the ReadOtuCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
96 cout << "An unknown error has occurred in the ReadOtuCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
100 //**********************************************************************************************************************