X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=suffixdb.cpp;h=4fc342dd8bd26f7809ef93ce57da1b5563ee4ad1;hp=15f7753b65291f897103e5e7b75fe79a2d139b99;hb=050a3ff02473a3d4c0980964e1a9ebe52e55d6b8;hpb=74c78f9abd9e733f0c2f812efec97a76632fcbf8 diff --git a/suffixdb.cpp b/suffixdb.cpp index 15f7753..4fc342d 100644 --- a/suffixdb.cpp +++ b/suffixdb.cpp @@ -22,33 +22,64 @@ /**************************************************************************************************/ -SuffixDB::SuffixDB(string fastaFileName) : Database(fastaFileName) { - +SuffixDB::SuffixDB(int numSeqs) : Database() { suffixForest.resize(numSeqs); - cout << "Generating the suffix tree database...\t"; cout.flush(); - for(int i=0;iconvert2ints(); // the candidate sequence needs to be a string of ints - for(int i=0;i SuffixDB::findClosestSequences(Sequence* candidateSeq, int num){ + try { + vector topMatches; + string processedSeq = candidateSeq->convert2ints(); // the candidate sequence needs to be a string of ints + + vector seqMatches; + for(int i=0;ierrorOut(e, "SuffixDB", "findClosestSequences"); + exit(1); + } } +/**************************************************************************************************/ +//adding the sequences generates the db +void SuffixDB::addSequence(Sequence seq) { + try { + suffixForest[count].loadSequence(seq); + count++; + } + catch(exception& e) { + m->errorOut(e, "SuffixDB", "addSequence"); + exit(1); + } +} +/**************************************************************************************************/ +SuffixDB::~SuffixDB(){ + for (int i = (suffixForest.size()-1); i >= 0; i--) { suffixForest.pop_back(); } +} /**************************************************************************************************/