-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEvidenceFilter.C
71 lines (43 loc) · 1.28 KB
/
EvidenceFilter.C
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
58
59
60
61
62
63
64
65
/****************************************************************
EvidenceFilter.C
Copyright (C)2013 William H. Majoros ([email protected]).
This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
License (GPL) version 3, as described at www.opensource.org.
****************************************************************/
#include <iostream>
#include "EvidenceFilter.H"
using namespace std;
using namespace BOOM;
EvidenceFilter::EvidenceFilter(int m,WigBinary *w,RnaJunctions *j)
: minSupport(m), wig(w), junctions(j)
{
// ctor
}
EvidenceFilter::~EvidenceFilter()
{
delete wig;
delete junctions;
}
bool EvidenceFilter::intronSupported(int begin,int end)
{
return junctions->getDepth(begin,end)>=minSupport;
}
bool EvidenceFilter::exonSupported(int begin,int end)
{
// ### THIS NEEDS TO BE CHANGED TO SOME CONSTANT-TIME ALGORITHM!
for(int pos=begin ; pos<end ; ++pos)
if(wig->read(pos)<minSupport) return false;
return true;
}
bool EvidenceFilter::codingSignalSupported(int begin,int end)
{
return exonSupported(begin,end);
}
bool EvidenceFilter::spliceOutSupported(int pos)
{
return junctions->getSpliceOutDepth(pos)>=minSupport;
}
bool EvidenceFilter::spliceInSupported(int pos)
{
return junctions->getSpliceInDepth(pos)>=minSupport;
}