set distr as Bionic.
[MACS.git] / test / test_PeakIO.py
blob1a8cd51c7b9f34744d9333bd825bf8e1acaf90f4
1 #!/usr/bin/env python
2 # Time-stamp: <2019-08-09 14:43:31 taoliu>
4 import unittest
5 import sys
7 from MACS2.IO.PeakIO import *
9 class Test_Region(unittest.TestCase):
11 def setUp(self):
12 self.test_regions1 = [(b"chrY",0,100),
13 (b"chrY",300,500),
14 (b"chrY",700,900),
15 (b"chrY",1000,1200),
17 self.test_regions2 = [(b"chrY",100,200),
18 (b"chrY",300,400),
19 (b"chrY",600,800),
20 (b"chrY",1200,1300),
22 self.merge_result_regions = [ (b"chrY",0,200),
23 (b"chrY",300,500),
24 (b"chrY",600,900),
25 (b"chrY",1000,1300),
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
33 self.r1 = Region()
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
39 self.r2 = Region()
40 for a in self.test_regions2:
41 self.r2.add_loc(a[0],a[1],a[2])
43 def test_merge(self):
44 self.mr = Region()
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)