Commit 4e1af945 authored by Mathieu Giraud's avatar Mathieu Giraud

core/dynprog.cpp, core/segment.cpp: debug, display p-values and D e-values

parent cdf885c8
......@@ -120,6 +120,13 @@ int Cost::homo2(char xa, char xb, char y)
double Cost::toPValue(const int score)
{
#ifdef DEBUG_EVALUE
cout << *this
<< " | score " << score
<< ", matches " << (float) score / (float) match
<< " ==> pvalue " << std::scientific << K * exp(-lambda * score) << std::fixed
<< endl;
#endif
return K * exp(-lambda * score);
}
......
......@@ -1009,6 +1009,13 @@ bool FineSegmenter::FineSegmentD(Germline *germline,
float evalue_D = multiplier * (r-l) * germline->rep_4.totalSize() * segment_cost.toPValue(box_DD->score[0].first);
#ifdef DEBUG_EVALUE
cout << "multiplier " << multiplier
<< ", length " << (r-l)
<< ", D rep size " << germline->rep_4.totalSize()
<< " ==> e-value (D) " << std::scientific << evalue_D << std::fixed << endl ;
#endif
if (evalue_D > evalue_threshold)
return false;
......@@ -1032,6 +1039,13 @@ bool FineSegmenter::FineSegmentD(Germline *germline,
float evalue_DD_new = multiplier * (box_DD->end - box_DD->start + 1) * box_DD->ref.size() * segment_cost.toPValue(score_new);
#ifdef DEBUG_EVALUE
cout << "multiplier " << multiplier
<< ", length " << (box_DD->end - box_DD->start + 1)
<< ", D size " << box_DD->ref.size()
<< " ==> e-value (DD) " << std::scientific << evalue_DD_new << std::fixed << endl ;
#endif
if (evalue_DD_new > evalue_threshold)
{
// Restore box_Y and box_Z
......
......@@ -13,6 +13,8 @@
#include "affectanalyser.h"
#include "../lib/json.hpp"
// #define DEBUG_EVALUE
#define EXTEND_D_ZONE 5
#define RATIO_STRAND 2 /* The ratio between the affectations in one
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment