File: ReadIndelErrorModel.hpp

package info (click to toggle)
dindel 1.01%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 940 kB
  • ctags: 1,130
  • sloc: cpp: 15,773; makefile: 40
file content (57 lines) | stat: -rw-r--r-- 1,433 bytes parent folder | download | duplicates (2)
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
/*    
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
/*
 * ReadIndelErrorModel.hpp
 *
 *  Created on: Oct 12, 2009
 *      Author: caa
 */

#ifndef READINDELERRORMODEL_HPP_
#define READINDELERRORMODEL_HPP_

class ReadIndelErrorModel
{
public:
	ReadIndelErrorModel()
	{
		double hp[] = { 2.9e-5, 2.9e-5,2.9e-5, 2.9e-5, 4.3e-5, 1.1e-4, 2.4e-4, 5.7e-4, 1.0e-3, 1.4e-3 };
		baselineProbs = vector<double>(10,0.0);
		for (int x=0;x<10;x++) {
			baselineProbs[x]=hp[x];
		}
	}
	double getViterbiHPError(int hpLen)
	{
		int len=hpLen;
		if (len<1) len=1;
		double pbe;
		if (len<=10) {
			pbe=baselineProbs[len-1];
		} else {
			pbe=baselineProbs[9]+4.3e-4*double(len-10);
		}
		pbe *= double(hpLen);
		if (pbe>0.99) pbe = 0.99;
		return pbe;

	}
private:
	vector<double> baselineProbs;

};


#endif /* READINDELERRORMODEL_HPP_ */