MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / init_

Method init_

src/openms/source/DATASTRUCTURES/MassExplainer.cpp:74–109  ·  view source on GitHub ↗

check consistency of input @param init_thresh_p set default threshold (set to "false" to keep current value)

Source from the content-addressed store, hash-verified

72 /// check consistency of input
73 /// @param init_thresh_p set default threshold (set to "false" to keep current value)
74 void MassExplainer::init_(bool init_thresh_p)
75 {
76 if (init_thresh_p)
77 {
78 // every compound with log_p_<thresh_p_ will be discarded
79 // we allow at most two Na+
80 thresh_p_ = log(0.15) * 2 + log(0.7) * (q_max_ - 2);
81 }
82
83 // check consistency of members
84 if (q_max_ < q_min_)
85 {
86 Int tmp = q_max_;
87 q_max_ = q_min_;
88 q_min_ = tmp;
89 std::cerr << __FILE__ << ": Warning! \"q_max < q_min\" needed fixing!\n";
90 }
91
92 if (max_span_ > (q_max_ - q_min_ + 1))
93 {
94 max_span_ = q_max_ - q_min_ + 1;
95 std::cerr << __FILE__ << ": Warning! \"max_span_ > (q_max - q_min + 1)\" needed fixing!\n";
96 }
97
98 if (adduct_base_.empty())
99 {
100 //default adducts are: H+, Na+, K+, NH4+
101 // do NOT use "+" in empirical formula, as every + will add a proton weight!
102
103 adduct_base_.push_back(createAdduct_("H", 1, 0.7));
104 adduct_base_.push_back(createAdduct_("Na", 1, 0.1));
105 adduct_base_.push_back(createAdduct_("NH4", 1, 0.1));
106 adduct_base_.push_back(createAdduct_("K", 1, 0.1));
107
108 }
109 }
110
111 /// Assignment operator
112 MassExplainer& MassExplainer::operator=(const MassExplainer& rhs)

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected