示例#1
0
 def test_feature_downstream_from_peak_neg_strand(self):
     peak = Peak('chr1', '450', '550')
     feature = Feature('NM1', 'chr1', '250', '400', '-')
     self.assertEqual(direction(peak, feature), DOWNSTREAM)
示例#2
0
 def test_feature_upstream_from_peak_neg_strand_partial_overlap(self):
     peak = Peak('chr1', '100', '300')
     feature = Feature('NM1', 'chr1', '250', '400', '-')
     self.assertEqual(direction(peak, feature), UPSTREAM)
示例#3
0
 def test_feature_downstream_from_peak_partial_overlap(self):
     peak = Peak('chr1', '100', '300')
     feature = Feature('NM1', 'chr1', '250', '400', '+')
     self.assertEqual(direction(peak, feature), DOWNSTREAM)
示例#4
0
 def test_feature_full_overlap_peak(self):
     peak = Peak('chr1', '200', '450')
     feature = Feature('NM1', 'chr1', '250', '400', '+')
     self.assertEqual(direction(peak, feature), OVERLAP)
示例#5
0
 def test_peak_full_overlap_feature_neg_strand(self):
     peak = Peak('chr1', '200', '450')
     feature = Feature('NM1', 'chr1', '250', '400', '-')
     self.assertEqual(direction(feature, peak), OVERLAP)
示例#6
0
 def test_feature_upstream_from_peak(self):
     peak = Peak('chr1', '450', '550')
     feature = Feature('NM1', 'chr1', '250', '400', '+')
     self.assertEqual(direction(peak, feature), UPSTREAM)
示例#7
0
 def test_peak_upstream_from_feature_neg_strand(self):
     peak = Peak('chr1', '100', '200')
     feature = Feature('NM1', 'chr1', '250', '400', '-')
     self.assertEqual(direction(feature, peak), DOWNSTREAM)
示例#8
0
 def test_peak_downstream_from_feature_neg_strand_partial_overlap(self):
     peak = Peak('chr1', '350', '550')
     feature = Feature('NM1', 'chr1', '250', '400', '-')
     self.assertEqual(direction(feature, peak), UPSTREAM)
示例#9
0
 def test_peak_downstream_from_feature(self):
     peak = Peak('chr1', '450', '550')
     feature = Feature('NM1', 'chr1', '250', '400', '+')
     self.assertEqual(direction(feature, peak), DOWNSTREAM)
示例#10
0
 def test_peak_upstream_from_feature_partial_overlap(self):
     peak = Peak('chr1', '100', '300')
     feature = Feature('NM1', 'chr1', '250', '400', '+')
     self.assertEqual(direction(feature, peak), UPSTREAM)
示例#11
0
 def test_distances_feature_contains_peak(self):
     self.assertEqual(
         edge_distances(Peak('chr1', '250', '350'),
                        Feature('NM6', 'chr1', '100', '400', '+')), (0, 0))
示例#12
0
 def test_distances_feature_overlaps_peak_start(self):
     self.assertEqual(
         edge_distances(Peak('chr1', '250', '350'),
                        Feature('NM4', 'chr1', '300', '400', '+')), (0, 50))
示例#13
0
 def test_distances_feature_before_peak(self):
     self.assertEqual(
         edge_distances(Peak('chr1', '250', '400'),
                        Feature('NM2', 'chr1', '100', '200', '+')),
         (50, 150))
示例#14
0
 def test__eq__(self):
     self.assertEqual(Peak('chr2L', '66811', '66812'),
                      Peak('chr2L', '66811', '66812'))
     self.assertNotEqual(Peak('chr2L', '66811', '66812'),
                         Peak('chr2L', '249177', '605951'))
示例#15
0
 def test_get_item(self):
     peaks = PeakSet('ChIP_peaks-ex1.txt')
     peak = peaks[2]
     self.assertEqual(peak, Peak('chr3L', '12139192', '12139193'))