X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=kmerdb.hpp;h=ead3d7e0b20d7b0ee070caebaad74aedeaae7dd3;hp=0088efdb27e06c0768367d1b387e518ff7ff684c;hb=df7e3ff9f68ef157b0328a2d353c3258c5d45d89;hpb=20a2d0350a737a434c89f303662d64a8eeea7b05 diff --git a/kmerdb.hpp b/kmerdb.hpp index 0088efd..ead3d7e 100644 --- a/kmerdb.hpp +++ b/kmerdb.hpp @@ -8,19 +8,41 @@ * Created by Pat Schloss on 12/16/08. * Copyright 2008 Patrick D. Schloss. All rights reserved. * + * This class is a child class of the Database class, which stores the template sequences as a kmer table and provides + * a method of searching the kmer table for the sequence with the most kmers in common with a query sequence. + * kmerLocations is the primary storage variable that is a two-dimensional vector where each row represents the + * different number of kmers and each column contains the index to sequences that use that kmer. + * + * Construction of an object of this type will first look for an appropriately named database file and if it is found + * then will read in the database file (readKmerDB), otherwise it will generate one and store the data in memory + * (generateKmerDB) + */ +#include "mothur.h" +#include "database.hpp" + class KmerDB : public Database { public: KmerDB(string, int); - Sequence* findClosestSequence(Sequence*); - + KmerDB(); + ~KmerDB(); + + void generateDB(); + void addSequence(Sequence); + vector findClosestSequences(Sequence*, int); + void readKmerDB(ifstream&); + int getCount(int); //returns number of sequences with that kmer number + vector getSequencesWithKmer(int); //returns vector of sequences that contain kmer passed in + int getReversed(int); //returns reverse compliment kmerNumber + int getMaxKmer() { return maxKmer; } + private: - void generateKmerDB(string); - void readKmerDB(string, ifstream&); + int kmerSize; - int maxKmer; + int maxKmer, count; + string kmerDBName; vector > kmerLocations; };