bedtools/bedtools_bamtobed
Converts
BAM
BED
BED6
BEDPE
Description
Converts BAM alignments to BED6 or BEDPE format.
This tool converts alignments in BAM format to either BED6 or BEDPE format,
allowing for flexible downstream analysis of genomic intervals.
Inputs
Name | Type & Properties | Description |
|---|---|---|
--input -i | file required | Input BAM file containing aligned sequences. **Requirements:** - Must be in SAM/BAM format - For paired-end BEDPE output (`--bedpe`), must be grouped or sorted by query name |
Outputs
Name | Type & Properties | Description |
|---|---|---|
--output -o | file required output | Output file in BED or BEDPE format. **Output formats:** - Default: BED6 format (6 columns) - With `--bedpe`: BEDPE format for paired-end data - With `--bed12`: BED12 format with blocked intervals |
Options
Name | Type & Properties | Description |
|---|---|---|
--bedpe | boolean_true | Write BEDPE format for paired-end data. **Requirements:** - BAM must be grouped or sorted by query name - Produces paired-end BED format with mate information |
--mate1 | boolean_true | When writing BEDPE format (`--bedpe`), always report mate one as the first BEDPE block. Ensures consistent ordering of paired-end reads in output. |
--bed12 | boolean_true | Write blocked BED format (BED12 format). **Features:** - Creates 12-column BED format with block information - Automatically forces `--split` option - Useful for representing spliced alignments See [BED12 format specification](http://genome-test.cse.ucsc.edu/FAQ/FAQformat#format1) for details. |
--split | boolean_true | Report split BAM alignments as separate BED entries. **Behavior:** - Splits only on **N** CIGAR operations (introns/gaps) - Each split becomes a separate BED interval - Useful for RNA-seq data with spliced alignments |
--splitD | boolean_true | Split alignments based on both **N** and **D** CIGAR operators. **Features:** - Splits on N (gaps/introns) and D (deletions) operations - Automatically forces `--split` option - More aggressive splitting than `--split` alone |
--edit_distance -ed | boolean_true | Use BAM edit distance (NM tag) for BED score instead of mapping quality. **Scoring behavior:** - **Default BED**: Uses mapping quality as score - **Default BEDPE**: Uses minimum of two mapping qualities - **With --ed + --bedpe**: Reports total edit distance from both mates |
--tag | string | Use other numeric BAM alignment tag for BED score. **Usage:** - Specify any numeric BAM tag (e.g., `SM`, `AS`, `XS`) - Replaces default mapping quality scoring - **Not allowed** with BEDPE output format |
--color | string | RGB color string for BED12 format visualization. **Format:** R,G,B values (0-255 each) **Default:** `255,0,0` (red) |
--cigar | boolean_true | Add the CIGAR string as a 7th column in BED output. Useful for preserving alignment information in BED format. |
Run this component
Run the following command to execute this component with Nextflow:
cat > params.yaml <<'EOM'
output: "$id.$key.output.bed"
id: "run"
publish_dir: "output/"
EOM
nextflow run https://packages.viash-hub.com/vsh/biobox.git \
-revision v0.4.0 \
-main-script target/nextflow/bedtools/bedtools_bamtobed/main.nf \
-params-file params.yaml Relationships
Used by
0 relationships
No components use this component.
Current component
bedtools/bedtools_bamtobedbiobox v0.4.0
Uses
0 relationships
No component dependencies found.