|
| 1 | +Here we show examples of how `bedder` can perform intersections. All examples uses these files: |
| 2 | + |
| 3 | +#### aa.bed |
| 4 | + |
| 5 | +``` |
| 6 | +chr1 2 23 |
| 7 | +``` |
| 8 | + |
| 9 | +#### bb.bed |
| 10 | + |
| 11 | +``` |
| 12 | +chr1 8 12 |
| 13 | +chr1 14 15 |
| 14 | +chr1 20 30 |
| 15 | +``` |
| 16 | + |
| 17 | +# Reporting Part |
| 18 | + |
| 19 | +For, now, we focus on which part of each interval that is reported. The options for this are: |
| 20 | + |
| 21 | +``` |
| 22 | + -p, --a-part <A_PART> |
| 23 | + a-part [default: whole] [possible values: none, part, whole, inverse] |
| 24 | + --b-part <B_PART> |
| 25 | + b-part [default: whole] [possible values: none, part, whole, inverse] |
| 26 | +``` |
| 27 | + |
| 28 | +Let's start with reporting the *whole* `a` interval if it overlaps and *none* of the `b` interval: |
| 29 | + |
| 30 | +``` |
| 31 | +$ bedder -a tests/examples/aa.bed -b tests/examples/bb.bed -g tests/examples/fake.fai --a-part whole --b-part none |
| 32 | +chr1 2 23 |
| 33 | +``` |
| 34 | + |
| 35 | +Now, we report the *part*s of the `a` interval along with the *whole* `b` interval that it overlapped: |
| 36 | + |
| 37 | +``` |
| 38 | +$ bedder -a tests/examples/aa.bed -b tests/examples/bb.bed -g tests/examples/fake.fai --a-part part --b-part whole |
| 39 | +chr1 8 12 chr1 8 12 |
| 40 | +chr1 14 15 chr1 14 15 |
| 41 | +chr1 20 23 chr1 20 30 |
| 42 | +``` |
| 43 | + |
| 44 | +And now the *part* of `a` and the `part` of `b`: |
| 45 | + |
| 46 | +``` |
| 47 | +$ bedder -a tests/examples/aa.bed -b tests/examples/bb.bed -g tests/examples/fake.fai --a-part part --b-part part |
| 48 | +chr1 8 12 chr1 8 12 |
| 49 | +chr1 14 15 chr1 14 15 |
| 50 | +chr1 20 23 chr1 20 23 |
| 51 | +``` |
| 52 | + |
| 53 | +We can also report the `inverse` that is, parts of `a` that do not overlap `b`: |
| 54 | + |
| 55 | +``` |
| 56 | +$ bedder -a tests/examples/aa.bed -b tests/examples/bb.bed -g tests/examples/fake.fai --a-part inverse --b-part none |
| 57 | +chr1 2 8 |
| 58 | +chr1 12 14 |
| 59 | +chr1 15 20 |
| 60 | +``` |
| 61 | + |
| 62 | +There are other combinations of parameters, some of which are not very helpful! |
| 63 | + |
| 64 | +# Overlap Requirements |
| 65 | + |
| 66 | +The default in bedder is that a single base of overlap is sufficient to report. However we can add constraints to this with these arguments: |
| 67 | + |
| 68 | +``` |
| 69 | + -r, --a-requirements <A_REQUIREMENTS> |
| 70 | + a-requirements for overlap. A float value < 1 or a number ending with % will be the fraction (or %) of the interval. An integer will be the number of bases. [default: 1] |
| 71 | + -R, --b-requirements <B_REQUIREMENTS> |
| 72 | + b-requirements for overlap. A float value < 1 or a number ending with % will be the fraction (or %) of the interval. An integer will be the number of bases. [default: 1] |
| 73 | +``` |
| 74 | + |
| 75 | +Here is the default, requiring a single base of overlap: |
| 76 | + |
| 77 | +``` |
| 78 | +$ bedder -a tests/examples/aa.bed -b tests/examples/bb.bed -g tests/examples/fake.fai --a-part part --b-part none --a-requirements 1 |
| 79 | +chr1 8 12 |
| 80 | +chr1 14 15 |
| 81 | +chr1 20 23 |
| 82 | +``` |
| 83 | + |
| 84 | +We can update that to require at least 3 bases: |
| 85 | + |
| 86 | +``` |
| 87 | +$ bedder -a tests/examples/aa.bed -b tests/examples/bb.bed -g tests/examples/fake.fai --a-part whole --b-part whole --a-requirements 3 --a-mode piece |
| 88 | +chr1 2 23 chr1 8 12 chr1 20 30 |
| 89 | +chr1 2 23 chr1 8 12 chr1 20 30 # bug: TODO: printing this line twice |
| 90 | +``` |
0 commit comments