]> git.donarmstrong.com Git - mothur.git/blobdiff - blastdb.cpp
cluster.split command
[mothur.git] / blastdb.cpp
index 17db069cdedb8a019d980c32fc4b6e7767fab27b..35a19f485816c87db85b71c74ca138f00595b180 100644 (file)
@@ -25,6 +25,19 @@ gapOpen(gO), gapExtend(gE), match(m), misMatch(mM) {
        queryFileName = toString(randNumber) + ".candidate.unaligned.fasta";
        blastFileName = toString(randNumber) + ".blast";
 
+}
+/**************************************************************************************************/
+
+BlastDB::BlastDB() : Database() {
+       
+       globaldata = GlobalData::getInstance();
+       count = 0;
+
+       int randNumber = rand();
+       dbFileName = toString(randNumber) + ".template.unaligned.fasta";
+       queryFileName = toString(randNumber) + ".candidate.unaligned.fasta";
+       blastFileName = toString(randNumber) + ".blast";
+
 }
 
 /**************************************************************************************************/
@@ -72,23 +85,6 @@ vector<int> BlastDB::findClosestSequences(Sequence* seq, int n) {
                }
                m8FileHandle.close();
                
-               string root = dbFileName;
-               string temp = dbFileName + ".nsq";
-               remove(temp.c_str());   
-               temp = dbFileName + ".nsi";
-               remove(temp.c_str());
-               
-               temp = dbFileName + ".nsd";
-               remove(temp.c_str());   
-
-               temp = dbFileName + ".nin";
-               remove(temp.c_str());   
-
-               temp = dbFileName + ".nhr";
-               remove(temp.c_str());   
-       
-
-               
                return topMatches;
        }
        catch(exception& e) {
@@ -154,7 +150,7 @@ void BlastDB::addSequence(Sequence seq) {
                unalignedFastaFile << '>' << count << endl;                                     //      sequences, which will be input to formatdb
                unalignedFastaFile << seq.getUnaligned() << endl;
                unalignedFastaFile.close();
-               
+       
                count++;
        }
        catch(exception& e) {
@@ -181,6 +177,7 @@ void BlastDB::generateDB() {
                exit(1);
        }
 }
+/**************************************************************************************************/
 
 /**************************************************************************************************/