def test_report_nearest_peaks_multi_line_max_hits(self): # Expected lines expected = ( "CG31973\t1 of 2\tchr2L\t66711\t66911\t7468\t7468", "CG31973\t2 of 2\tchr2L\t249077\t249277\t189834\t189834", ) # Set up to report some stuff ap = AnalysisReporter(output.MULTI_LINE, fields=self.multi_line_fields, max_hits=2) # Check that output matches for line,expected_line in izip_longest( ap.report_nearest_peaks(self.feature, self.peaks), expected): self.assertEqual(line,expected_line)
def test_report_nearest_peaks_multi_line_max_hits(self): # Expected lines expected = ( "CG31973\t1 of 2\tchr2L\t66711\t66911\t7468\t7468", "CG31973\t2 of 2\tchr2L\t249077\t249277\t189834\t189834", ) # Set up to report some stuff ap = AnalysisReporter(output.MULTI_LINE, fields=self.multi_line_fields, max_hits=2) # Check that output matches for line,expected_line in izip_longest( ap.report_nearest_peaks(self.feature, self.peaks), expected): self.assertEqual(line,expected_line)
def test_report_nearest_peaks_single_line(self): # Expected lines expected = ( "CG31973\t3\t" "chr2L\t66711\t66911\t7468\t7468\t" "chr2L\t249077\t249277\t189834\t189834\t" "chr2L\t605850\t606050\t546607\t546607", ) # Set up to report some stuff ap = AnalysisReporter(output.SINGLE_LINE, fields=self.single_line_fields) # Check that output matches for line,expected_line in izip_longest( ap.report_nearest_peaks(self.feature, self.peaks), expected): self.assertEqual(line,expected_line)
def test_report_nearest_peaks_single_line(self): # Expected lines expected = ( "CG31973\t3\t" "chr2L\t66711\t66911\t7468\t7468\t" "chr2L\t249077\t249277\t189834\t189834\t" "chr2L\t605850\t606050\t546607\t546607", ) # Set up to report some stuff ap = AnalysisReporter(output.SINGLE_LINE, fields=self.single_line_fields) # Check that output matches for line,expected_line in izip_longest( ap.report_nearest_peaks(self.feature, self.peaks), expected): self.assertEqual(line,expected_line)
def test_report_nearest_peaks_single_line_extra_data(self): # Expected lines expected = ( "CG31973\t100000\t2\t" "chr2L\t66711\t66911\t7468\t7468\t" "chr2L\t249077\t249277\t189834\t189834", ) # Set up to report some stuff ap = AnalysisReporter(output.SINGLE_LINE, fields=self.single_line_fields_extra_data, max_hits=2, null_placeholder='.') # Check that output matches for line,expected_line in izip_longest( ap.report_nearest_peaks(self.feature, self.peaks, cutoff=100000), expected): self.assertEqual(line,expected_line)
def test_report_nearest_peaks_multi_line_pad(self): # Expected lines expected = ( "CG31973\t1 of 3\tchr2L\t66711\t66911\t7468\t7468", "CG31973\t2 of 3\tchr2L\t249077\t249277\t189834\t189834", "CG31973\t3 of 3\tchr2L\t605850\t606050\t546607\t546607", "CG31973\t.\t.\t.\t.\t.\t.", ) # Set up to report some stuff ap = AnalysisReporter(output.MULTI_LINE, fields=self.multi_line_fields, max_hits=4, pad=True, null_placeholder='.') # Check that output matches for line,expected_line in izip_longest( ap.report_nearest_peaks(self.feature, self.peaks), expected): self.assertEqual(line,expected_line)
def test_report_nearest_peaks_multi_line_pad(self): # Expected lines expected = ( "CG31973\t1 of 3\tchr2L\t66711\t66911\t7468\t7468", "CG31973\t2 of 3\tchr2L\t249077\t249277\t189834\t189834", "CG31973\t3 of 3\tchr2L\t605850\t606050\t546607\t546607", "CG31973\t.\t.\t.\t.\t.\t.", ) # Set up to report some stuff ap = AnalysisReporter(output.MULTI_LINE, fields=self.multi_line_fields, max_hits=4, pad=True, null_placeholder='.') # Check that output matches for line,expected_line in izip_longest( ap.report_nearest_peaks(self.feature, self.peaks), expected): self.assertEqual(line,expected_line)