fastafile = validParameter.validFile(parameters, "fasta", true);
if (fastafile == "not found") { cout << "fasta is a required parameter for the bin.seqs command." << endl; abort = true; }
else if (fastafile == "not open") { abort = true; }
- else {
- openInputFile(fastafile, in);
- fasta = new FastaMap();
- }
-
//check for optional parameter and set defaults
// ...at some point should added some additional type checking...
groupfile = validParameter.validFile(parameters, "group", true);
if (groupfile == "not open") { abort = true; }
else if (groupfile == "not found") { groupfile = ""; }
- else {
- //read in group map info.
- groupMap = new GroupMap(groupfile);
- groupMap->readMap();
+
+ if (abort == false) {
+ openInputFile(fastafile, in);
+ fasta = new FastaMap();
+ if (groupfile != "") {
+ groupMap = new GroupMap(groupfile);
+ groupMap->readMap();
+ }
}
}
BinSeqCommand::~BinSeqCommand(){
//made new in execute
if (abort == false) {
- delete input;
+ delete input; globaldata->ginput = NULL;
delete read;
- delete list;
- }
-
- //made new in constructor
- delete fasta;
- if (groupfile != "") {
- delete groupMap;
+ globaldata->gListVector = NULL;
+ delete fasta;
+ if (groupfile != "") { delete groupMap; globaldata->gGroupmap = NULL; }
}
-
}
//**********************************************************************************************************************
//read fastafile
fasta->readFastaFile(in);
+ in.close();
+
//set format to list so input can get listvector
// globaldata->setFormat("list");