-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathselector.h
94 lines (80 loc) · 4.14 KB
/
selector.h
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
93
94
/*
Pheniqs : PHilology ENcoder wIth Quality Statistics
Copyright (C) 2018 Lior Galanti
NYU Center for Genetics and System Biology
Author: Lior Galanti <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PHENIQS_ACCUMULATE_H
#define PHENIQS_ACCUMULATE_H
#include "include.h"
#include "json.h"
#include "phred.h"
class AccumulatingOption;
class AccumulatingSelector;
class AccumulatingOption {
public:
uint64_t count;
uint64_t pf_count;
uint64_t accumulated_distance;
double accumulated_confidence;
uint64_t low_conditional_confidence_count;
uint64_t low_confidence_count;
uint64_t accumulated_pf_distance;
double accumulated_pf_confidence;
double pf_fraction; /* pf_count / count */
double average_distance; /* accumulated_distance / count */
double average_confidence; /* accumulated_confidence / count */
double average_pf_distance; /* accumulated_pf_distance / pf_count */
double average_pf_confidence; /* accumulated_pf_confidence / pf_count */
double pooled_fraction; /* count / decoder.count */
double pf_pooled_fraction; /* pf_count / decoder.pf_count */
double pooled_classified_fraction; /* count / decoder.classified_count */
double pf_pooled_classified_fraction; /* pf_count / decoder.pf_classified_count */
double estimated_concentration_prior;
AccumulatingOption();
AccumulatingOption(const AccumulatingOption& other);
virtual ~AccumulatingOption() = default;
void collect(const AccumulatingOption& other);
virtual void finalize(const AccumulatingSelector& parent);
virtual void encode(Value& container, Document& document) const;
};
class AccumulatingSelector {
public:
const int32_t index;
uint64_t count;
uint64_t pf_count;
uint64_t classified_count;
uint64_t accumulated_classified_distance;
double accumulated_classified_confidence;
uint64_t low_conditional_confidence_count;
uint64_t low_confidence_count;
uint64_t pf_classified_count;
uint64_t accumulated_pf_classified_distance;
double accumulated_pf_classified_confidence;
double pf_fraction; /* pf_count / count */
double classified_fraction; /* classified_count / count */
double average_classified_distance; /* accumulated_classified_distance / classified_count */
double average_classified_confidence; /* accumulated_classified_confidence / classified_count */
double pf_classified_fraction; /* pf_classified_count / pf_count */
double classified_pf_fraction; /* pf_classified_count / classified_count */
double average_pf_classified_distance; /* accumulated_pf_classified_distance / pf_classified_count */
double average_pf_classified_confidence; /* accumulated_pf_classified_confidence / pf_classified_count */
double estimated_noise_prior;
AccumulatingSelector(const int32_t index);
AccumulatingSelector(const AccumulatingSelector& other);
virtual ~AccumulatingSelector() = default;
void collect(const AccumulatingSelector& other);
virtual void finalize();
virtual void encode(Value& container, Document& document) const;
};
#endif /* PHENIQS_ACCUMULATE_H */