OpenFlexTyper
finder.h
1 #ifndef __FINDER_H__
2 #define __FINDER_H__
3 
4 #include <experimental/filesystem>
5 #include "fmindex.h"
6 #include "ifmindex.h"
7 #include <algorithm>
8 #include "ifinder.h"
9 
10 namespace ft {
11 
12 namespace fs = std::experimental::filesystem;
13 
18 class Finder : public IFinder
19 {
20 public:
22  Finder();
23  Finder(const Finder& other) = delete;
24 
26  virtual ~Finder();
27  const Finder& operator=(const Finder &other) = delete;
28 
32  void searchIndexes(ft::FTMap &ftMap);
33 
41  void parallelSearch(FTMap &ftMap,
42  const fs::path &indexPath, long long offset);
43 
51  void sequentialSearch(ft::FTMap &ftMap,
52  const fs::path &indexPath,long long offset);
53 
54 private:
55 
58  void addResultsFutures(std::map<std::string, ft::KmerClass> & indexResults, ft::KmerClass &tmpResult, uint offset);
59 
62  void indexParallelSearch(ft::FTMap &ftMap);
63 
66  void indexSequentialSearch(ft::FTMap &ftMap);
67 
69  void testIndex(const FTProp& ftProps, algo::IFmIndex* fmIndex, const fs::path &indexPath, std::string &testkmer);
70 };
71 }
72 
73 #endif // end of Finder class
ft::Finder::parallelSearch
void parallelSearch(FTMap &ftMap, const fs::path &indexPath, long long offset)
parallelSearch searches kmers in parallel in a single index.
Definition: finder.cpp:82
ft::KmerClass
A class that contains information for a single Kmer.
Definition: kmerClass.h:17
ft::Finder::~Finder
virtual ~Finder()
Destructor.
Definition: finder.cpp:179
ft::Finder::Finder
Finder()
Constructor.
Definition: finder.cpp:10
ft::Finder::searchIndexes
void searchIndexes(ft::FTMap &ftMap)
Main search function based on the parameters set in FTMap.
Definition: finder.cpp:31
ft::Finder::indexParallelSearch
void indexParallelSearch(ft::FTMap &ftMap)
indexParallelSearch searches across all indexes in parallel
Definition: finder.cpp:55
ft::Finder
A class that handles the main search functions.
Definition: finder.h:19
ft::Finder::sequentialSearch
void sequentialSearch(ft::FTMap &ftMap, const fs::path &indexPath, long long offset)
sequentialSearch searches kmers sequentially in a single index.
Definition: finder.cpp:140
ft
This namespace contains all the functions to interact with the search.
Definition: directSearch.h:16
ft::Finder::testIndex
void testIndex(const FTProp &ftProps, algo::IFmIndex *fmIndex, const fs::path &indexPath, std::string &testkmer)
Definition: finder.cpp:15
ft::Finder::addResultsFutures
void addResultsFutures(std::map< std::string, ft::KmerClass > &indexResults, ft::KmerClass &tmpResult, uint offset)
add results from an index to FTMap
Definition: finder.cpp:68
ft::FTProp
A class that contains all the properties for a FlexTyper instance.
Definition: ftPropsClass.h:63
ft::Finder::indexSequentialSearch
void indexSequentialSearch(ft::FTMap &ftMap)
indexSequentialSearch searches across all indexes sequentially
Definition: finder.cpp:43
ft::FTMap
A class that contains information for the FlexTyper Instance.
Definition: ftMapClass.h:24