-
Notifications
You must be signed in to change notification settings - Fork 82
/
CorrectionThresholds.cpp
40 lines (35 loc) · 1007 Bytes
/
CorrectionThresholds.cpp
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
//-----------------------------------------------
// Copyright 2010 Wellcome Trust Sanger Institute
// Written by Jared Simpson (js18@sanger.ac.uk)
// Released under the GPL
//-----------------------------------------------
//
// CorrectionThresholds - Cutoff values for determining
// whether a particular base should be corrected or not
//
#include "CorrectionThresholds.h"
CorrectionThresholds::CorrectionThresholds()
{
// Set defaults
m_minSupportLowQuality = 4;
m_minSupportHighQuality = 3;
m_highQualityCutoff = 20;
}
CorrectionThresholds& CorrectionThresholds::Instance()
{
static CorrectionThresholds instance;
return instance;
}
void CorrectionThresholds::setBaseMinSupport(int ms)
{
m_minSupportHighQuality = ms;
m_minSupportLowQuality = ms + 1;
}
//
int CorrectionThresholds::getRequiredSupport(int phred)
{
int threshold = m_minSupportLowQuality;
if(phred >= m_highQualityCutoff)
threshold = m_minSupportHighQuality;
return threshold;
}