2 # Time-stamp: <2024-10-16 00:13:01 Tao Liu>
6 from MACS3
.IO
.Parser
import (guess_parser
,
13 class Test_auto_guess(unittest
.TestCase
):
16 self
.bedfile
= "test/tiny.bed.gz"
17 self
.bedpefile
= "test/tiny.bedpe.gz"
18 self
.samfile
= "test/tiny.sam.gz"
19 self
.bamfile
= "test/tiny.bam"
21 def test_guess_parser_bed(self
):
22 p
= guess_parser(self
.bedfile
)
23 self
.assertTrue(p
.is_gzipped())
24 self
.assertTrue(isinstance(p
, BEDParser
))
26 def test_guess_parser_sam(self
):
27 p
= guess_parser(self
.samfile
)
28 self
.assertTrue(p
.is_gzipped())
29 self
.assertTrue(isinstance(p
, SAMParser
))
31 def test_guess_parser_bam(self
):
32 p
= guess_parser(self
.bamfile
)
33 self
.assertTrue(p
.is_gzipped())
34 self
.assertTrue(isinstance(p
, BAMParser
))
37 class Test_parsing(unittest
.TestCase
):
39 self
.bedfile
= "test/tiny.bed.gz"
40 self
.bedpefile
= "test/tiny.bedpe.gz"
41 self
.samfile
= "test/tiny.sam.gz"
42 self
.bamfile
= "test/tiny.bam"
43 self
.fragfile
= "test/test.fragments.tsv.gz"
45 def test_fragment_file(self
):
46 p
= FragParser(self
.fragfile
)
47 petrack
= p
.build_petrack2()
49 bdg
= petrack
.pileup_bdg()
50 bdg2
= petrack
.pileup_bdg2()
51 peaks
= bdg
.call_peaks(cutoff
=10, min_length
=200, max_gap
=100)
52 peaks2
= bdg2
.call_peaks(cutoff
=10, min_length
=200, max_gap
=100)