| 1 |
.. _complement: |
| 2 |
|
| 3 |
############### |
| 4 |
*complement* |
| 5 |
############### |
| 6 |
|
| 7 |
| |
| 8 |
|
| 9 |
.. image:: ../images/tool-glyphs/complement-glyph.png |
| 10 |
:width: 600pt |
| 11 |
|
| 12 |
| |
| 13 |
|
| 14 |
|
| 15 |
``bedtools complement`` returns all intervals in a genome that are **not** |
| 16 |
covered by at least one interval in the input BED/GFF/VCF file. |
| 17 |
|
| 18 |
|
| 19 |
.. seealso:: |
| 20 |
|
| 21 |
:doc:`../tools/merge` |
| 22 |
|
| 23 |
|
| 24 |
========================================================================== |
| 25 |
Usage and option summary |
| 26 |
========================================================================== |
| 27 |
**Usage**: |
| 28 |
:: |
| 29 |
|
| 30 |
bedtools complement -i <BED/GFF/VCF> -g <GENOME> |
| 31 |
|
| 32 |
**(or)**: |
| 33 |
:: |
| 34 |
|
| 35 |
complementBed -i <BED/GFF/VCF> -g <GENOME> |
| 36 |
|
| 37 |
|
| 38 |
========================================================================== |
| 39 |
Default behavior |
| 40 |
========================================================================== |
| 41 |
By default, ``bedtools complement`` returns all genomic intervals that are not |
| 42 |
covered by at least one record from the input file. |
| 43 |
|
| 44 |
.. code-block:: bash |
| 45 |
|
| 46 |
$ cat A.bed |
| 47 |
chr1 100 200 |
| 48 |
chr1 400 500 |
| 49 |
chr1 500 800 |
| 50 |
|
| 51 |
$ cat my.genome |
| 52 |
chr1 1000 |
| 53 |
chr2 800 |
| 54 |
|
| 55 |
$ bedtools complement -i A.bed -g my.genome |
| 56 |
chr1 0 100 |
| 57 |
chr1 200 400 |
| 58 |
chr1 800 1000 |
| 59 |
chr2 0 800 |
| 60 |
|
| 61 |
========================================================================== |
| 62 |
``-L`` Only report chromosomes that are in the `-i` file |
| 63 |
========================================================================== |
| 64 |
Use the "**-L**" option to `L`imit the output to solely the chromosomes |
| 65 |
that are represented in the `-i` file. Chromosomes that are in `-g` but |
| 66 |
not `-i` will be suppressed |
| 67 |
|
| 68 |
For example (note the difference in coverage with and without **-s**: |
| 69 |
|
| 70 |
.. code-block:: bash |
| 71 |
|
| 72 |
$ cat A.bed |
| 73 |
chr1 100 200 |
| 74 |
chr1 400 500 |
| 75 |
chr1 500 800 |
| 76 |
|
| 77 |
$ cat my.genome |
| 78 |
chr1 1000 |
| 79 |
chr2 800 |
| 80 |
|
| 81 |
$ bedtools complement -i A.bed -g my.genome |
| 82 |
chr1 0 100 |
| 83 |
chr1 200 400 |
| 84 |
chr1 800 1000 |
| 85 |
|
| 86 |
|