24 #ifndef _STATISTICALINFERENCEALGORITHM_H 25 #define _STATISTICALINFERENCEALGORITHM_H 31 #include "probabilisticassemblingmodel.h" 32 #include "maagforwardbackwardalgorithm.h" 38 class StatisticalInferenceAlgorithm;
55 bool check(
const string& param_name)
const {
56 if (_json.get(param_name,
"__NA__").asString() ==
"__NA__") {
57 cout <<
"Obligatory parameter '" << param_name <<
"' hasn't been found, please re-run the algorithm with the supplied parameter." << endl;
64 Json::Value
get(
const string& param_name,
const Json::Value& default_value)
const {
65 return _json.get(param_name, default_value).asString();
70 _json[param_name] = value;
75 const Json::Value& operator[](
const string& param_name)
const {
return _json[param_name]; }
87 virtual std::vector<prob_t> statisticalInference(
const ClonesetView &repertoire,
90 ErrorMode error_mode = NO_ERRORS)
const = 0;
94 const MAAGRepertoire &maag_rep,
95 vector<prob_t> &prob_vec,
96 vector<bool> &good_clonotypes,
99 size_t &no_alignments)
const 101 good_clonotypes.resize(maag_rep.size(),
true);
102 prob_vec.resize(maag_rep.size(), 0);
108 #pragma omp parallel for 110 for (
size_t i = 0; i < maag_rep.size(); ++i) {
111 prob_vec[i] = maag_rep[i].fullProbability();
114 for (
size_t i = 0; i < maag_rep.size(); ++i) {
115 if (rep_nonc[i].is_good()) {
116 if (std::isnan(prob_vec[i]) || (std::abs(prob_vec[i]) < 1e-80) || (std::abs(prob_vec[i]) >= 1)) {
117 good_clonotypes[i] =
false;
122 good_clonotypes[i] =
false;
129 cout <<
"Removed " << (int) removed
130 <<
" error-probability clonotypes. Check your minimal Diversity gene length to align and other parameters to make sure it won't happen again in the future." << endl;
131 cout <<
"\tZero probabilities:\t" << (int) zero_prob << std::endl;
132 cout <<
"\tBad alignments:\t" << (int) no_alignments <<
" (replaces with zeros)" << std::endl;
134 cout <<
"No clonotypes with error probabilities has been found. It's good in case you don't know." << std::endl;
Interface for algorithms for statistical inference of assembling model parameters.
Definition: statisticalinferencealgorithm.h:46
Definition: statisticalinferencealgorithm.h:49
Definition: probabilisticassemblingmodel.h:41
Definition: repertoire.h:51