Repository navigation
Expand file tree
/
Copy pathoutput_co.cpp
More file actions
66 lines (65 loc) · 2.18 KB
/
Copy pathoutput_co.cpp
File metadata and controls
66 lines (65 loc) · 2.18 KB
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
66
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <fstream>
#include <iostream>
#include "globals.h"
//
bool output_co(multimap<string, multimap<unsigned long, BPINFO> > rawbpmap, string rawbpfile)
{
// output chr:left-coordinate-sorted raw break points:
// left-coordinate sorted raw break points
fstream sortedrawfp;
sortedrawfp.open(rawbpfile.c_str(), ios::out);
if(!sortedrawfp.good())
{
cout << " Error: cannot open file " << rawbpfile << " for collecting break point predictions. " << endl;
return false;
}
sortedrawfp << "#chr\t"
<< "left_pos(sorted)\t"
<< "right_pos\t"
<< "score\t"
<< "left_alleles\t"
<< "right_alleles\t"
<< "barcode\t"
<< "vcf_mole_len\t"
<< "left_span\t"
<< "right_span\t"
<< "read_density\t"
<< "co_boundary_same_fragment\t"
<< "min_mole_RR_dist\t"
<< "max_mole_RR_dist\t"
<< "bam_mole_len\t"
<< "bam_mole_readNum\t"
<< "bam_mole_base_cov\t"
<< "af_at_markers\t"
<< "cov_at_markers\t"
<< "co_size\t"
<< "readnum_left\t"
<< "readnum_right\t"
<< "maxium_RR_distance_in_CO\n";
multimap<string, multimap<unsigned long, BPINFO> >::iterator chritr;
multimap<string, multimap<unsigned long, BPINFO> >::iterator chritr_end;
chritr = rawbpmap.begin();
chritr_end = rawbpmap.end();
while(chritr != chritr_end)
{
multimap<unsigned long, BPINFO> tmp;
tmp = (*chritr).second;
multimap<unsigned long, BPINFO>::iterator litr;
multimap<unsigned long, BPINFO>::iterator litr_end;
litr = tmp.begin();
litr_end = tmp.end();
while(litr != litr_end)
{
sortedrawfp << ((*litr).second).bpline << endl;
litr ++;
}
chritr ++;
}
sortedrawfp.close();
return true;
}