def test_detect_wig_pos(self): si.replicate_comparison = self.mock.mock_replicate_comparison nums = {'pro': 3, 'tss': 3, 'uni': 0, 'cds': 3, 'ta': 3} out_table = StringIO() output = StringIO() args = self.mock_args.mock() args.texs = "texs" args.replicates = "rep" args.max_len = 300 args.min_len = 30 args.decrease_inter = 50 args.fuzzy_inter = 5 args.tex_notex = "tex_notex" args.pros = copy.deepcopy(self.example.pros) tas = copy.deepcopy(self.example.tas) args.table_best = True args.nums = nums args.out_table = out_table args.output = output args.tolerance = 5 si.detect_wig_pos(self.example.wigs, tas[0], 20, 70, "TSS_160+", 10, 20, args) self.assertEqual(output.getvalue(), ("aaa\tANNOgesic\tncRNA\t20\t190\t.\t+\t.\t" "ID=aaa_srna0;Name=sRNA_00000;sRNA_type=intergenic;" "with_TSS=TSS_160+;end_cleavage=Cleavage:190_+;" "best_avg_coverage=40;best_high_coverage=50;" "best_low_coverage=10\n")) self.assertEqual(out_table.getvalue(), ("aaa\t00000\t20\t190\t+\tcond1\t" "test1\t40\t50\t10\t\n"))
def test_detect_wig_pos(self): si.replicate_comparison = self.mock.mock_replicate_comparison nums = {'pro': 3, 'tss': 3, 'uni': 0, 'cds': 3, 'ta': 3} out_table = StringIO() output = StringIO() args = self.mock_args.mock() args.texs = "texs" args.replicates = "rep" args.max_len = 300 args.min_len = 30 args.decrease_inter = 50 args.fuzzy_inter = 5 args.tex_notex = "tex_notex" args.pros = copy.deepcopy(self.example.pros) tas = copy.deepcopy(self.example.tas) args.table_best = True args.nums = nums args.out_table = out_table args.output = output args.tolerance = 5 si.detect_wig_pos(self.example.wigs, tas[0], 20, 70, "TSS_160+", 10, 20, args) self.assertEqual( output.getvalue(), "aaa\tANNOgesic\tncRNA\t20\t190\t.\t+\t.\tID=aaa_srna0;Name=sRNA_00000;sRNA_type=intergenic;with_TSS=TSS_160+;end_cleavage=Cleavage:190_+;best_avg_coverage=40;best_high_coverage=50;best_low_coverage=10\n" ) self.assertEqual( out_table.getvalue(), "aaa\t00000\t20\t190\t+\tcond1\ttest1\t40\t50\t10\t\n")