5 * Created by Sarah Westcott on 1/21/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "deconvolutecommand.h"
12 /**************************************************************************************/
13 int DeconvoluteCommand::execute() {
15 globaldata = GlobalData::getInstance();
17 //prepare filenames and open files
18 filename = globaldata->getFastaFile();
19 outputFileName = (getRootName(filename) + "names");
20 outFastafile = (getRootName(filename) + "unique.fasta");
22 openInputFile(filename, in);
23 openOutputFile(outputFileName, out);
24 openOutputFile(outFastafile, outFasta);
26 //constructor reads in file and store internally
27 fastamap = new FastaMap();
29 //two columns separated by tabs sequence name and then sequence
30 fastamap->readFastaFile(in);
32 //print out new names file
33 //file contains 2 columns separated by tabs. the first column is the groupname(name of first sequence found.
34 //the second column is the list of names of identical sequences separated by ','.
36 fastamap->printCondensedFasta(outFasta);
41 cout << "Standard Error: " << e.what() << " has occurred in the DeconvoluteCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
45 cout << "An unknown error has occurred in the DeconvoluteCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
49 /**************************************************************************************/