1 | /* |
---|
2 | Copyright (c) 2006-2018 Elmar Pruesse <elmar.pruesse@ucdenver.edu> |
---|
3 | |
---|
4 | This file is part of SINA. |
---|
5 | SINA is free software: you can redistribute it and/or modify it under |
---|
6 | the terms of the GNU General Public License as published by the Free |
---|
7 | Software Foundation, either version 3 of the License, or (at your |
---|
8 | option) any later version. |
---|
9 | |
---|
10 | SINA is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
11 | WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
12 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
---|
13 | for more details. |
---|
14 | |
---|
15 | You should have received a copy of the GNU General Public License |
---|
16 | along with SINA. If not, see <http://www.gnu.org/licenses/>. |
---|
17 | |
---|
18 | Additional permission under GNU GPL version 3 section 7 |
---|
19 | |
---|
20 | If you modify SINA, or any covered work, by linking or combining it |
---|
21 | with components of ARB (or a modified version of that software), |
---|
22 | containing parts covered by the terms of the |
---|
23 | ARB-public-library-license, the licensors of SINA grant you additional |
---|
24 | permission to convey the resulting work. Corresponding Source for a |
---|
25 | non-source form of such a combination shall include the source code |
---|
26 | for the parts of ARB used as well as that of the covered work. |
---|
27 | */ |
---|
28 | |
---|
29 | #ifndef _KMER_SEARCH_H_ |
---|
30 | #define _KMER_SEARCH_H_ |
---|
31 | |
---|
32 | #include <map> |
---|
33 | #include <memory> |
---|
34 | #include <boost/filesystem.hpp> |
---|
35 | |
---|
36 | #include "search.h" |
---|
37 | |
---|
38 | namespace sina { |
---|
39 | |
---|
40 | class kmer_search : public search { |
---|
41 | public: |
---|
42 | static kmer_search* get_kmer_search(const boost::filesystem::path& filename, |
---|
43 | int k=10, bool fast=true); |
---|
44 | static void release_kmer_search(const boost::filesystem::path& filename, |
---|
45 | int k=10, bool fast=true); |
---|
46 | |
---|
47 | /** |
---|
48 | * match runs a word search using the PT server |
---|
49 | * |
---|
50 | * arguments: |
---|
51 | * family: will contain scored results |
---|
52 | * query: query sequence |
---|
53 | * min_match: minimum number of results required |
---|
54 | * max_match: maximum number of results desired |
---|
55 | * min_score: minimum relative score |
---|
56 | * max_score: maximum relative score |
---|
57 | * arb: pointer to matching arb database |
---|
58 | * noid: skip matches containing query |
---|
59 | * min_len: skip matches shorter |
---|
60 | * num_full: minimum "full length", ignoring score |
---|
61 | * minlen_full: length to be considered "full" |
---|
62 | * range_cover: minimum sequences touching alignment edge |
---|
63 | * leave_query_out: drop sequence with matching id |
---|
64 | */ |
---|
65 | double match(result_vector &results, |
---|
66 | const cseq& query, |
---|
67 | int min_match, |
---|
68 | int max_match, |
---|
69 | float min_score, |
---|
70 | float max_score, |
---|
71 | query_arb *arb, |
---|
72 | bool noid, |
---|
73 | int minlen, |
---|
74 | int num_full, |
---|
75 | int minlen_full, |
---|
76 | int range_cover, |
---|
77 | bool leave_query_out) override; |
---|
78 | |
---|
79 | void find(const cseq& query, result_vector& results, unsigned int max) override; |
---|
80 | |
---|
81 | unsigned int size() const override; |
---|
82 | /** |
---|
83 | * dtor - must remain public (super is public) |
---|
84 | */ |
---|
85 | ~kmer_search() override; |
---|
86 | |
---|
87 | class impl; |
---|
88 | private: |
---|
89 | kmer_search(std::shared_ptr<impl> pimpl); |
---|
90 | |
---|
91 | std::shared_ptr<impl> pimpl; |
---|
92 | static void destroy_indices(); |
---|
93 | }; |
---|
94 | |
---|
95 | |
---|
96 | } // namespace sina |
---|
97 | |
---|
98 | #endif // _KMER_SEARCH_H_ |
---|
99 | |
---|
100 | |
---|
101 | /* |
---|
102 | Local Variables: |
---|
103 | mode:c++ |
---|
104 | c-file-style:"stroustrup" |
---|
105 | c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) |
---|
106 | indent-tabs-mode:nil |
---|
107 | fill-column:99 |
---|
108 | End: |
---|
109 | */ |
---|
110 | // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : |
---|