globaldata = GlobalData::getInstance();
- cout << "Generating the temporary BLAST database...\t"; cout.flush();
+ mothurOut("Generating the temporary BLAST database...\t"); cout.flush();
int randNumber = rand();
dbFileName = toString(randNumber) + ".template.unaligned.fasta";
for(int i=0;i<numSeqs;i++){ // generating a fasta file with unaligned template
unalignedFastaFile << '>' << i << endl; // sequences, which will be input to formatdb
- unalignedFastaFile << templateSequences[i]->getUnaligned() << endl;
+ unalignedFastaFile << templateSequences[i].getUnaligned() << endl;
}
unalignedFastaFile.close();
string formatdbCommand = path + "blast/bin/formatdb -p F -o T -i " + dbFileName; // format the database, -o option gives us the ability
system(formatdbCommand.c_str()); // to get the right sequence names, i think. -p F
// option tells formatdb that seqs are DNA, not prot
- cout << "DONE." << endl << endl; cout.flush();
- emptySequence = new Sequence();
- emptySequence->setName("no_match");
- emptySequence->setUnaligned("XXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
- emptySequence->setAligned("XXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
+ mothurOut("DONE."); mothurOutEndLine(); mothurOutEndLine(); cout.flush();
+ emptySequence = Sequence();
+ emptySequence.setName("no_match");
+ emptySequence.setUnaligned("XXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
+ emptySequence.setAligned("XXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
}
/**************************************************************************************************/
BlastDB::~BlastDB(){
+ //for (int i = 0; i < templateSequences.size(); i++) { delete templateSequences[i]; }
+ //templateSequences.clear();
+ //delete emptySequence;
+
remove(queryFileName.c_str()); // let's clean stuff up and remove the temp files
remove(dbFileName.c_str()); // let's clean stuff up and remove the temp files
remove(blastFileName.c_str()); // let's clean stuff up and remove the temp files
/**************************************************************************************************/
-Sequence* BlastDB::findClosestSequence(Sequence* candidate){
+Sequence BlastDB::findClosestSequence(Sequence* candidate){
ofstream queryFile;
openOutputFile(queryFileName, queryFile);
searchScore = 0.00;
return emptySequence;
}
+ m8FileHandle.close();
}
/**************************************************************************************************/