forked from maip/novo_muta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathread_dependent_data.cc
68 lines (63 loc) · 2.71 KB
/
read_dependent_data.cc
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
/**
* @file read_dependent_data.cc
* @author Melissa Ip
*
* This file contains the implementation of the ReadDependentData class.
*
* See top of read_dependent_data.h for a complete description.
*/
#include "read_dependent_data.h"
/**
* Default constructor.
*/
ReadDependentData::ReadDependentData() {
sequencing_probability_mat = Matrix3_16d::Zero();
child_somatic_probability = RowVector16d::Zero();
mother_somatic_probability = RowVector16d::Zero();
father_somatic_probability = RowVector16d::Zero();
}
/**
* Constructor takes in ReadDataVector.
*/
ReadDependentData::ReadDependentData(const ReadDataVector &data_vec)
: read_data_vec{data_vec} {
sequencing_probability_mat = Matrix3_16d::Zero();
child_somatic_probability = RowVector16d::Zero();
mother_somatic_probability = RowVector16d::Zero();
father_somatic_probability = RowVector16d::Zero();
};
/**
* Returns true if the two ReadDependentData objects are equal to each other.
*
* @param other ReadDependentData object to be compared.
* @return True if the two ReadDependentData objects are equal to each other.
*/
bool ReadDependentData::Equals(const ReadDependentData &other) {
bool attr_table[20] = {
EqualsReadDataVector(read_data_vec, other.read_data_vec),
max_elements == other.max_elements,
sequencing_probability_mat == other.sequencing_probability_mat,
child_somatic_probability == other.child_somatic_probability,
mother_somatic_probability == other.mother_somatic_probability,
father_somatic_probability == other.father_somatic_probability,
denominator.child_zygotic_probability == other.denominator.child_zygotic_probability,
denominator.mother_zygotic_probability == other.denominator.mother_zygotic_probability,
denominator.father_zygotic_probability == other.denominator.father_zygotic_probability,
denominator.child_germline_probability == other.denominator.child_germline_probability,
denominator.parent_probability == other.denominator.parent_probability,
denominator.root_mat == other.denominator.root_mat,
denominator.sum == other.denominator.sum,
numerator.child_zygotic_probability == other.numerator.child_zygotic_probability,
numerator.mother_zygotic_probability == other.numerator.mother_zygotic_probability,
numerator.father_zygotic_probability == other.numerator.father_zygotic_probability,
numerator.child_germline_probability == other.numerator.child_germline_probability,
numerator.parent_probability == other.numerator.parent_probability,
numerator.root_mat == other.numerator.root_mat,
numerator.sum == other.numerator.sum
};
if (all_of(begin(attr_table), end(attr_table), [](bool i) { return i; })) {
return true;
} else {
return false;
}
}