X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=suffixdb.cpp;fp=suffixdb.cpp;h=0000000000000000000000000000000000000000;hb=4a877efa127e56e81a21f53cfdbbfd3bfbe8c4ff;hp=4fc342dd8bd26f7809ef93ce57da1b5563ee4ad1;hpb=a6cf29fa4dac0909c7582cb1094151d34093ee76;p=mothur.git diff --git a/suffixdb.cpp b/suffixdb.cpp deleted file mode 100644 index 4fc342d..0000000 --- a/suffixdb.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * suffixdb.cpp - * - * - * Created by Pat Schloss on 12/16/08. - * Copyright 2008 Patrick D. Schloss. All rights reserved. - * - * This is a child class of the Database abstract datatype. The class is basically a database of suffix trees and an - * encapsulation of the method for finding the most similar tree to an inputted sequence. the suffixForest objecct - * is a vector of SuffixTrees, with each template sequence being represented by a different SuffixTree. The class also - * provides a method to take an unaligned sequence and find the closest sequence in the suffixForest. The search - * method is inspired by the article and Perl source code provided at http://www.ddj.com/web-development/184416093. I - * would estimate that the time complexity is O(LN) for each search, which is slower than the kmer searching, but - * faster than blast - * - */ - -#include "database.hpp" -#include "sequence.hpp" -#include "suffixtree.hpp" -#include "suffixdb.hpp" - -/**************************************************************************************************/ - -SuffixDB::SuffixDB(int numSeqs) : Database() { - suffixForest.resize(numSeqs); - count = 0; -} -/**************************************************************************************************/ - -SuffixDB::SuffixDB() : Database() { - count = 0; -} - -/**************************************************************************************************/ -//assumes sequences have been added using addSequence -vector 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(); } -} -/**************************************************************************************************/