|
5 | 5 |
|
6 | 6 |
|
7 | 7 | def test_feature_overlap(): |
8 | | - f1 = Feature.from_string('chr1 12 50 feature1 10.0 +') |
9 | | - f2 = Feature.from_string('chr1 40 60 feature2 10.0 -') |
10 | | - f3 = Feature.from_string('chr1 60 80 feature2 10.0 -') |
11 | | - f4 = Feature.from_string('chr2 60 80 feature2 10.0 -') |
| 8 | + f1 = Feature.from_string("chr1 12 50 feature1 10.0 +") |
| 9 | + f2 = Feature.from_string("chr1 40 60 feature2 10.0 -") |
| 10 | + f3 = Feature.from_string("chr1 60 80 feature2 10.0 -") |
| 11 | + f4 = Feature.from_string("chr2 60 80 feature2 10.0 -") |
12 | 12 | assert f1.has_overlap_with(f2) |
13 | 13 | assert not f1.has_overlap_with(f3) |
14 | 14 | assert not f3.has_overlap_with(f4) |
15 | 15 | assert not f2.has_overlap_with(f3) |
16 | 16 |
|
17 | 17 |
|
18 | 18 | def test_feature_contains(): |
19 | | - f1 = Feature.from_string('chr1 50 60 feature1 10.0 +') |
20 | | - f2 = Feature.from_string('chr1 40 60 feature2 10.0 -') |
21 | | - f3 = Feature.from_string('chr2 40 80 feature2 10.0 -') |
| 19 | + f1 = Feature.from_string("chr1 50 60 feature1 10.0 +") |
| 20 | + f2 = Feature.from_string("chr1 40 60 feature2 10.0 -") |
| 21 | + f3 = Feature.from_string("chr2 40 80 feature2 10.0 -") |
22 | 22 | assert f1 in f2 |
23 | 23 | assert not f1 in f3 |
24 | 24 |
|
25 | 25 |
|
26 | 26 | def test_feature_bp_overlap(): |
27 | | - f1 = Feature.from_string('chr1 12 50 feature1 10.0 +') |
28 | | - f2 = Feature.from_string('chr1 40 60 feature2 10.0 -') |
29 | | - f3 = Feature.from_string('chr1 60 80 feature2 10.0 -') |
30 | | - f4 = Feature.from_string('chr2 60 80 feature2 10.0 -') |
| 27 | + f1 = Feature.from_string("chr1 12 50 feature1 10.0 +") |
| 28 | + f2 = Feature.from_string("chr1 40 60 feature2 10.0 -") |
| 29 | + f3 = Feature.from_string("chr1 60 80 feature2 10.0 -") |
| 30 | + f4 = Feature.from_string("chr2 60 80 feature2 10.0 -") |
31 | 31 | assert f1.get_overlap_in_bp_with(f2) == 10 |
32 | 32 | assert f1.get_overlap_in_bp_with(f3) == 0 |
33 | 33 | assert f2.get_overlap_in_bp_with(f3) == 0 |
|
0 commit comments