File: suffixdb.hpp

package info (click to toggle)
mothur 1.48.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 13,684 kB
  • sloc: cpp: 161,854; makefile: 122; sh: 31
file content (41 lines) | stat: -rwxr-xr-x 1,305 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef SUFFIXDB_HPP
#define SUFFIXDB_HPP

/*
 *  suffixdb.hpp
 *  
 *
 *  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 object
 *	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 "mothur.h"
#include "searchdatabase.hpp"
#include "suffixtree.hpp"

class SuffixDB : public SearchDatabase {
	
public:
	SuffixDB(int);
	SuffixDB();
	~SuffixDB();
	
	void generateDB(){}; //adding sequences generates the db
	void addSequence(Sequence);
	vector<int> findClosestSequences(Sequence*, int, vector<float>&) const;

private:
	vector<SuffixTree> suffixForest;
	int count;
};

#endif