2 # Time-stamp: <2019-08-09 14:43:31 taoliu>
7 from MACS2
.IO
.PeakIO
import *
9 class Test_Region(unittest
.TestCase
):
12 self
.test_regions1
= [(b
"chrY",0,100),
17 self
.test_regions2
= [(b
"chrY",100,200),
22 self
.merge_result_regions
= [ (b
"chrY",0,200),
27 self
.subpeak_n
= [1,10,100,1000]
31 def test_add_loc1(self
):
32 # make sure the shuffled sequence does not lose any elements
34 for a
in self
.test_regions1
:
35 self
.r1
.add_loc(a
[0],a
[1],a
[2])
37 def test_add_loc2(self
):
38 # make sure the shuffled sequence does not lose any elements
40 for a
in self
.test_regions2
:
41 self
.r2
.add_loc(a
[0],a
[1],a
[2])
45 for a
in self
.test_regions1
:
46 self
.mr
.add_loc(a
[0],a
[1],a
[2])
47 for a
in self
.test_regions2
:
48 self
.mr
.add_loc(a
[0],a
[1],a
[2])
49 self
.mr
.merge_overlap()
50 self
.mr
.write_to_bed(sys
.stdout
)