BAM to BED
Convert BAM file to BED file
This is a very old tool that is kept for legacy reasons. Very rarely will this transformation be useful for users.
File input (BAM)
This script processes BAM-type files so make sure your input is properly formatted and uses the appropriate .bam extension if you are working from the GUI.
Read Options
This tool has multiple read options to output.
- Read 1: output Read 1
- Read 2: output Read 2
- Combined: output combined reads
- Midpoint: output the midpoint between reads
- Fragment: output the full fragment of two reads
The Midpoint and Fragment options require proper mate-pair reading.
Filter Options
- Require Proper Paired-End refers to the proper pairing of reads Read 1 and Reads 2.
- Filter Min Insert Size (bp) refers to the minimum insert size to filter
- Filter Max Insert Size (bp) refers to the maximum insert size to filter
Output format (BED)
The alignment of each BAM entry for the entire read/fragment/midpoint is written as a separate BED entry. The output .bed file is named based on the BAM filename with either a _READ1.bed, _READ2.bed, _COMBINED.bed, _MIDPOINT.bed, or _FRAGMENT.bed suffix according to the Read Option selected.
Output GZip
Toggling this allows the user to write output to a compressed file format using a general compression (gzip) which has the added advantage of speeding up the execution time by shrinking the I/O load (esp for large output). The .gz extension will be appended as appropriate.
Command Line Interface
Usage:
java -jar ScriptManager.jar bam-format-converter bam-to-bed [-1 | -2 | -a | -m | -f]
[-hpsV] [-n=<MIN_INSERT>] [-o=<output>] [-x=<MAX_INSERT>] <bamFile>
Positional Input
This tool takes a single BAM file for input. As with other tools, this tool requires the BAM file be indexed.
Output Options
| Option | Description |
|---|---|
-o, --output=<output> | specify output directory (name will be same as original with .bed ext) |
-s, --stdout | stream output file to STDOUT (cannot be used with -o flag) |
-z, --gzip | gzip output (default=false) |
Filter Options
These filter options are shared across all the BAM Format Converter tools.
| Option | Description |
|---|---|
-p, --mate-pair | require proper mate pair (default not required) |
-n, --min-insert=<MIN_INSERT> | filter by min insert size in bp |
-x, --max-insert=<MAX_INSERT> | filter by max insert size in bp |
Read Options
| Option | Description |
|---|---|
-1, --read1 | output read 1 (default) |
-2, --read2 | output read 2 |
-a, --all-reads | output combined |
-m, --midpoint | output midpoint (require PE) |
-f, --fragment | output fragment (requires PE) |