def test_compare_ta_tss(self): out_table = StringIO() nums = {'pro': 3, 'tss': 3, 'uni': 0, 'cds': 3, 'ta': 3} output = StringIO() detects = {"overlap": False, "uni_with_tss": False} si.get_coverage = self.mock.mock_get_coverage args = self.mock_args.mock() args.tex_notex = "tex_notex" args.min_len = 30 args.max_len = 300 args.decrease_inter = 50 args.fuzzy_inter = 5 args.tolerance = 5 args.tsss = copy.deepcopy(self.example.tsss) args.nums = nums args.fuzzy = 20 args.detects = detects args.texs = "texs" args.replicates = "rep" args.table_best = True args.wigs_f = "" args.wigs_r = "" args.output = output args.out_table = out_table tas = copy.deepcopy(self.example.tas) tsss = copy.deepcopy(self.example.tsss) si.compare_ta_tss(10, 2, 15, tas[0], tsss[0], 50, "cutoff", 20, "", args) self.assertEqual(output.getvalue(), "aaa\tANNOgesic\tsRNA\t10\t15\t.\t+\t.\tID=srna0;Name=sRNA_00000;sRNA_type=intergenic;with_TSS=TSS:170_+\n") self.assertEqual(out_table.getvalue(), "aaa\t00000\t10\t15\t+\tNA\tNA\tNA\tNA\tNA\tTSS:170_+\n") si.get_coverage = get_coverage
def test_compare_ta_tss(self): out_table = StringIO() nums = {'pro': 3, 'tss': 3, 'uni': 0, 'cds': 3, 'ta': 3} output = StringIO() detects = {"overlap": False, "uni_with_tss": False} si.get_coverage = self.mock.mock_get_coverage args = self.mock_args.mock() args.tex_notex = "tex_notex" args.min_len = 30 args.max_len = 300 args.decrease_inter = 50 args.fuzzy_inter = 5 args.tolerance = 5 args.tsss = copy.deepcopy(self.example.tsss) args.nums = nums args.fuzzy = 20 args.detects = detects args.texs = "texs" args.replicates = "rep" args.table_best = True args.wigs_f = "" args.wigs_r = "" args.output = output args.out_table = out_table tas = copy.deepcopy(self.example.tas) tsss = copy.deepcopy(self.example.tsss) si.compare_ta_tss(10, 2, 15, tas[0], tsss[0], 50, "cutoff", 20, "", args) self.assertEqual( output.getvalue(), "aaa\tANNOgesic\tncRNA\t10\t15\t.\t+\t.\tID=aaa_srna0;Name=sRNA_00000;sRNA_type=intergenic;with_TSS=TSS:170_+\n" ) self.assertEqual( out_table.getvalue(), "aaa\t00000\t10\t15\t+\tNA\tNA\tNA\tNA\tNA\tTSS:170_+\n") si.get_coverage = get_coverage