2 # Time-stamp: <2022-09-14 13:33:37 Tao Liu>
7 from MACS3
.IO
.PeakIO
import *
9 class Test_PeakIO(unittest
.TestCase
):
11 self
.test_peaks1
= [ (b
"chrY",0,100),
18 (b
"chr1",100, 10000), # chr1 only has one region but overlapping with peaks2
19 (b
"chr2",1000,2000), # only peaks1 has chr2
20 (b
"chr4",500,800), # chr4 only one region, and not overlapping with peaks2
22 self
.test_peaks2
= [ (b
"chrY",100,200),
30 (b
"chr3",1000, 5000), # only peaks2 has chr3
33 self
.result_exclude2from1
= [ (b
"chrY",0,100),
38 self
.exclude2from1
= PeakIO()
39 for a
in self
.result_exclude2from1
:
40 self
.exclude2from1
.add(a
[0],a
[1],a
[2])
42 def test_exclude(self
):
44 for a
in self
.test_peaks1
:
45 r1
.add(a
[0],a
[1],a
[2])
47 for a
in self
.test_peaks2
:
48 r2
.add(a
[0],a
[1],a
[2])
51 expected
= str(self
.exclude2from1
)
52 print( "result:\n",result
)
53 print( "expected:\n", expected
)
54 self
.assertEqual( result
, expected
)