| 1 |
.. _maskfasta: |
| 2 |
|
| 3 |
############### |
| 4 |
*maskfasta* |
| 5 |
############### |
| 6 |
|
| 7 |
|
| 8 |
| |
| 9 |
|
| 10 |
.. image:: ../images/tool-glyphs/maskfasta-glyph.png |
| 11 |
:width: 600pt |
| 12 |
|
| 13 |
|
| 14 |
``bedtools maskfasta`` masks sequences in a FASTA file based on intervals defined in a feature file. The |
| 15 |
headers in the input FASTA file must exactly match the chromosome column in the feature file. This |
| 16 |
may be useful for creating your own masked genome file based on custom annotations or for masking all |
| 17 |
but your target regions when aligning sequence data from a targeted capture experiment. |
| 18 |
|
| 19 |
|
| 20 |
========================================================================== |
| 21 |
Usage and option summary |
| 22 |
========================================================================== |
| 23 |
**Usage** |
| 24 |
|
| 25 |
.. code-block:: bash |
| 26 |
|
| 27 |
$ bedtools maskfasta [OPTIONS] -fi <input FASTA> -bed <BED/GFF/VCF> -fo <output FASTA> |
| 28 |
|
| 29 |
**(or):** |
| 30 |
|
| 31 |
.. code-block:: bash |
| 32 |
|
| 33 |
$ maskFastaFromBed [OPTIONS] -fi <input FASTA> -bed <BED/GFF/VCF> -fo <output FASTA> |
| 34 |
|
| 35 |
|
| 36 |
.. note:: |
| 37 |
|
| 38 |
The input (``-fi``) and output (``-fo``) FASTA files must be different. |
| 39 |
|
| 40 |
.. seealso:: |
| 41 |
|
| 42 |
:doc:`../tools/getfasta` |
| 43 |
|
| 44 |
|
| 45 |
=========================== ========================================================================================================================================== |
| 46 |
Option Description |
| 47 |
=========================== ========================================================================================================================================== |
| 48 |
**-soft** Soft-mask (that is, convert to lower-case bases) the FASTA sequence. *By default, hard-masking (that is, conversion to Ns) is performed*. |
| 49 |
**-mc** Replace masking character. That is, instead of masking with Ns, use another character. |
| 50 |
=========================== ========================================================================================================================================== |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
========================================================================== |
| 55 |
Default behavior |
| 56 |
========================================================================== |
| 57 |
**bedtools maskfasta** will mask a FASTA file based on the intervals in a |
| 58 |
BED file. The newly masked FASTA file is written to the output FASTA file. |
| 59 |
|
| 60 |
.. code-block:: bash |
| 61 |
|
| 62 |
$ cat test.fa |
| 63 |
>chr1 |
| 64 |
AAAAAAAACCCCCCCCCCCCCGCTACTGGGGGGGGGGGGGGGGGG |
| 65 |
|
| 66 |
$ cat test.bed |
| 67 |
chr1 5 10 |
| 68 |
|
| 69 |
$ bedtools maskfasta -fi test.fa -bed test.bed -fo test.fa.out |
| 70 |
|
| 71 |
$ cat test.fa.out |
| 72 |
>chr1 |
| 73 |
AAAAANNNNNCCCCCCCCCCGCTACTGGGGGGGGGGGGGGGGGG |
| 74 |
|
| 75 |
|
| 76 |
========================================================================== |
| 77 |
``-soft`` Soft-masking the FASTA file. |
| 78 |
========================================================================== |
| 79 |
Using the **-soft** option, one can optionally "soft-mask" the FASTA file. |
| 80 |
|
| 81 |
.. code-block:: bash |
| 82 |
|
| 83 |
$ cat test.fa |
| 84 |
>chr1 |
| 85 |
AAAAAAAACCCCCCCCCCCCCGCTACTGGGGGGGGGGGGGGGGGG |
| 86 |
|
| 87 |
$ cat test.bed |
| 88 |
chr1 5 10 |
| 89 |
|
| 90 |
$ bedtools maskfasta -fi test.fa -bed test.bed -fo test.fa.out -soft |
| 91 |
|
| 92 |
$ cat test.fa.out |
| 93 |
>chr1 |
| 94 |
AAAAAaaaccCCCCCCCCCCGCTACTGGGGGGGGGGGGGGGGGG |
| 95 |
|
| 96 |
========================================================================== |
| 97 |
``-mc`` Specify a masking character. |
| 98 |
========================================================================== |
| 99 |
Using the **-mc** option, one can optionally choose a masking character to each |
| 100 |
base that will be masked by the BED file. |
| 101 |
|
| 102 |
.. code-block:: bash |
| 103 |
|
| 104 |
$ cat test.fa |
| 105 |
>chr1 |
| 106 |
AAAAAAAACCCCCCCCCCCCCGCTACTGGGGGGGGGGGGGGGGGG |
| 107 |
|
| 108 |
$ cat test.bed |
| 109 |
chr1 5 10 |
| 110 |
|
| 111 |
$ bedtools maskfasta -fi test.fa -bed test.bed -fo test.fa.out -mc X |
| 112 |
|
| 113 |
$ cat test.fa.out |
| 114 |
>chr1 |
| 115 |
AAAAAXXXXXCCCCCCCCCCGCTACTGGGGGGGGGGGGGGGGGG |