5 * Created by Pat Schloss on 6/6/09.
6 * Copyright 2009 Patrick D. Schloss. All rights reserved.
10 #include "reversecommand.h"
11 #include "sequence.hpp"
14 //***************************************************************************************************************
16 ReverseSeqsCommand::ReverseSeqsCommand(){
18 globaldata = GlobalData::getInstance();
19 if(globaldata->getFastaFile() == "") { cout << "you need to at least enter a fasta file name" << endl; }
22 cout << "Standard Error: " << e.what() << " has occurred in the ReverseSeqsCommand class Function ReverseSeqsCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
26 cout << "An unknown error has occurred in the ReverseSeqsCommand class function ReverseSeqsCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
31 //***************************************************************************************************************
33 ReverseSeqsCommand::~ReverseSeqsCommand(){ /* do nothing */ }
35 //***************************************************************************************************************
38 int ReverseSeqsCommand::execute(){
42 openInputFile(globaldata->getFastaFile(), inFASTA);
45 string reverseFile = getRootName(globaldata->getFastaFile()) + "rc" + getExtension(globaldata->getFastaFile());
46 openOutputFile(reverseFile, outFASTA);
48 while(!inFASTA.eof()){
49 Sequence currSeq(inFASTA);
50 currSeq.reverseComplement();
51 currSeq.printSequence(outFASTA);
60 cout << "Standard Error: " << e.what() << " has occurred in the ReverseSeqsCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
64 cout << "An unknown error has occurred in the ReverseSeqsCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
69 //***************************************************************************************************************