-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdme_zoops_workspace.hpp
More file actions
92 lines (74 loc) · 2.77 KB
/
dme_zoops_workspace.hpp
File metadata and controls
92 lines (74 loc) · 2.77 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* Copyright (C) 2025 Andrew D Smith
* Author: Andrew D Smith
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef DME_ZOOPS_WORKSPACE_HPP
#define DME_ZOOPS_WORKSPACE_HPP
#include <smithlab_utils.hpp>
#include "CTSet.hpp"
#include "ScoringMatrix.hpp"
struct dme_zoops_lextree;
class dme_zoops_workspace {
public:
dme_zoops_workspace(const std::vector<std::string> &foreground,
const std::vector<std::string> &background,
const size_t motif_width_param, const float adjustment);
~dme_zoops_workspace();
DMEPath
run_dme_zoops(const std::vector<std::vector<float>> &column_types,
const std::vector<float> &bits, const float min_information);
DMEPath
run_dme_zoops_local(
const std::vector<std::vector<std::vector<float>>> &refined_column_types,
const std::vector<std::vector<float>> &refined_bits,
const float min_information, const size_t n_changes);
void
deactivate(const ScoringMatrix &sm);
private:
void
refined_enumeration(const size_t depth, const float surplus_information,
const size_t remaining_changes);
void
enumeration(const size_t depth, const float surplus_information);
float
get_background_score() const;
float
get_background_refined_score() const;
// These are set initially and not changed
std::vector<std::vector<std::vector<float>>> fgscore;
std::vector<std::vector<std::vector<dme_zoops_lextree *>>> fgnodes;
std::vector<dme_zoops_lextree *> bgtrees;
size_t fgsize;
size_t bgsize;
size_t motif_width; // width of motif
std::vector<size_t> prefix;
// standard search variables
std::vector<std::vector<float>> scoremat;
std::vector<float> coltype_bits;
size_t n_types;
float max_score;
// local search variables
std::vector<std::vector<std::vector<float>>> refined_scoremat;
std::vector<size_t> n_refined_types;
std::vector<std::vector<float>> refined_coltype_bits;
float refined_max_score;
// for both standard and local search (reset right away at each
// public function call)
std::vector<size_t> best_path;
float best_score;
float lambda;
};
#endif