Example #1
0
 def test_report_nearest_features_multi_line_max_hits(self):
     # Expected lines
     expected = (
         "chr2L\t66811\t66812\t1 of 2\tCG31973\t7568\t7568",
         "chr2L\t66811\t66812\t2 of 2\tCG2674-RE\t40091\t40091",
     )
     # 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_features(self.peak,
                                        self.features),
             expected):
         self.assertEqual(line,expected_line)
Example #2
0
 def test_report_nearest_features_multi_line_max_hits(self):
     # Expected lines
     expected = (
         "chr2L\t66811\t66812\t1 of 2\tCG31973\t7568\t7568",
         "chr2L\t66811\t66812\t2 of 2\tCG2674-RE\t40091\t40091",
     )
     # 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_features(self.peak,
                                        self.features),
             expected):
         self.assertEqual(line,expected_line)
Example #3
0
 def test_report_nearest_features_single_line(self):
     # Expected lines
     expected = (
         "chr2L\t66811\t66812\t3\t"
         "CG31973\t7568\t7568\t"
         "CG2674-RE\t40091\t40091\t"
         "CG2674-RC\t41114\t41114",
     )
     # 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_features(self.peak,
                                        self.features),
             expected):
         self.assertEqual(line,expected_line)
Example #4
0
 def test_report_nearest_features_single_line(self):
     # Expected lines
     expected = (
         "chr2L\t66811\t66812\t3\t"
         "CG31973\t7568\t7568\t"
         "CG2674-RE\t40091\t40091\t"
         "CG2674-RC\t41114\t41114",
     )
     # 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_features(self.peak,
                                        self.features),
             expected):
         self.assertEqual(line,expected_line)
Example #5
0
 def test_report_nearest_features_single_line_extra_data(self):
     # Expected lines
     expected = (
         "chr2L\t66811\t66812\t100000\t2\t"
         "CG31973\t7568\t7568\t"
         "CG2674-RE\t40091\t40091",
     )
     # Set up to report some stuff
     ap = AnalysisReporter(output.SINGLE_LINE,
                           fields=self.single_line_fields_extra_data,
                           max_hits=2)
     # Check that output matches
     for line,expected_line in izip_longest(
             ap.report_nearest_features(self.peak,
                                        self.features,
                                        cutoff=100000),
             expected):
         self.assertEqual(line,expected_line)