Commit 43c73d8a authored by Mathieu Giraud's avatar Mathieu Giraud

core/dynprog.{h,cpp}: Cost::toPValue(), placeholder for p-value computation

This is now not a real p-value.
parent 4a35537d
......@@ -23,6 +23,7 @@
#include "dynprog.h"
#include "tools.h"
#include "segment.h"
#include <cassert>
#include <list>
#include <cstdlib>
......@@ -98,6 +99,12 @@ int Cost::homo2(char xa, char xb, char y)
return ((xa == xb) && (xb == y)) ? homopolymer : MINUS_INF ;
}
double Cost::toPValue(int score)
{
// TODO: compute an actual p-value
return (score <= 0) ? BAD_EVALUE : 1 / (double) score ;
}
DynProg::DynProg(const string &x, const string &y, DynProgMode mode, const Cost& cost, const bool reverse_x, const bool reverse_y)
{
......
......@@ -46,6 +46,11 @@ class Cost
int substitution(char a, char b);
int homo2(char xa, char xb, char y);
/**
* @return p-value of having a random alignment of the given score
*/
double toPValue(int score);
int open_insertion;
int open_deletion;
int extend_insertion;
......
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