-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMinusSVMipv4.cpp
51 lines (49 loc) · 1.31 KB
/
MinusSVMipv4.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
40
41
42
43
44
45
46
47
48
49
50
51
#include <string>
#include "SVMipv4.h"
#include "MinusSVMipv4.h"
using namespace std;
string reverse_comp (string seq) {
string rev_comp;
for (int i = seq.length()-1; i >= 0; i--)
{
switch(seq[i])
{
case 'G':
rev_comp.append("C");
break;
case 'C':
rev_comp.append("G");
break;
case 'A':
rev_comp.append("T");
break;
case 'T':
rev_comp.append("A");
break;
default:
rev_comp.append(string(1, seq[i]));
}
}
return rev_comp;
}
MinusSVMipv4::MinusSVMipv4(string chromosome, int scan_start, int scan_stop, int ext_length, int lig_length):SVMipv4(chromosome, scan_start, scan_stop, ext_length, lig_length)
{
ext_probe_start = scan_stop + 1;
ext_probe_stop = scan_stop + ext_length;
lig_probe_start = scan_start - lig_length;
lig_probe_stop = scan_start - 1;
strand = "-";
}
void MinusSVMipv4::set_ext_probe_seq (string seq) {
this->ext_probe_sequence = reverse_comp(seq);
}
void MinusSVMipv4::set_lig_probe_seq (string seq) {
this->lig_probe_sequence = reverse_comp(seq);
this->ligation_junction = this->lig_probe_sequence.substr(0,2);
}
void MinusSVMipv4::set_scan_target_seq (string seq) {
this->scan_target_sequence = reverse_comp(seq);
}
int MinusSVMipv4::get_mip_start () {
return this->lig_probe_start;
}