bedtools/bedtools_map
genomics
intervals
map
statistics
aggregate
annotate
overlap
scores
Description
Apply statistical functions to columns from overlapping genomic intervals.
This tool maps values from intervals in file B onto overlapping intervals in file A
by applying statistical operations (sum, mean, median, etc.). For each interval in A,
it finds all overlapping intervals in B and applies the specified function to the
specified column(s). Useful for aggregating scores, computing statistics over
genomic regions, or annotating intervals with quantitative data.
Inputs
Name | Type & Properties | Description |
|---|---|---|
--input_a -a | file required | First input file (intervals to annotate). **Format:** BED, GFF, VCF file with genomic intervals **Requirement:** Must be sorted by chromosome, then start position **Usage:** Each interval will be annotated with mapped values from file B |
--input_b -b | file required | Second input file (source of values to map). **Format:** BED, GFF, VCF file with genomic intervals and data columns **Requirement:** Must be sorted by chromosome, then start position **Usage:** Overlapping intervals provide values for mapping operations |
Outputs
Name | Type & Properties | Description |
|---|---|---|
--output | file required output | Output file with mapped values appended to input A intervals. **Format:** Same as input A with additional columns for mapped values **Content:** Original columns from A plus computed statistical values **Order:** Follows the order specified in column and operation parameters |
Mapping Options
Name | Type & Properties | Description |
|---|---|---|
--columns -c | string | Columns from file B to use for mapping operations. **Default:** 5 (fifth column, typically score column in BED) **Format:** Comma-delimited list for multiple columns **Example:** "5" for score column, "4,5" for name and score columns **Indexing:** 1-based column numbering |
--operations -o | string | Statistical operations to apply to specified columns. **Numeric operations:** sum, min, max, absmin, absmax, mean, median, mode, antimode, stdev, sstdev, count, count_distinct **List operations:** collapse, distinct, distinct_sort_num, distinct_sort_num_desc, distinct_only **Position operations:** first, last **Default:** sum **Format:** Comma-delimited list for multiple operations **Pairing:** Operations applied to columns in respective order |
--delimiter -delim | string | Custom delimiter for collapse operations. **Default:** "," (comma) **Usage:** Only affects collapse, distinct, and related operations **Example:** "|" for pipe-separated values, ";" for semicolon-separated |
--precision -prec | integer | Decimal precision for numerical output. **Default:** 5 decimal places **Range:** 0-15 (reasonable range for floating point precision) **Usage:** Controls rounding of computed statistical values |
Overlap Options
Name | Type & Properties | Description |
|---|---|---|
--min_overlap_a -f | double | Minimum overlap required as fraction of A. **Range:** 0.0 to 1.0 **Default:** 1E-9 (effectively 1bp) **Example:** 0.50 requires 50% of A to be overlapped by B |
--min_overlap_b -F | double | Minimum overlap required as fraction of B. **Range:** 0.0 to 1.0 **Default:** 1E-9 (effectively 1bp) **Example:** 0.50 requires 50% of B to overlap A |
--reciprocal -r | boolean_true | Require reciprocal overlap for both A and B. **Effect:** Both -f and -F thresholds must be satisfied **Example:** With -f 0.90 -r, requires B overlaps 90% of A AND A overlaps 90% of B **Default:** false |
--either -e | boolean_true | Require minimum fraction satisfied for A OR B. **Effect:** Only one of -f or -F thresholds needs to be satisfied **Alternative:** Without -e, both fractions must be satisfied **Default:** false (both required) |
Strand Options
Name | Type & Properties | Description |
|---|---|---|
--same_strand -s | boolean_true | Require same strandedness for overlaps. **Effect:** Only consider overlaps on the same strand **Default:** false (strand-independent) |
--opposite_strand -S | boolean_true | Require different strandedness for overlaps. **Effect:** Only consider overlaps on opposite strands **Default:** false (strand-independent) **Note:** May have issues in some bedtools versions |
Format Options
Name | Type & Properties | Description |
|---|---|---|
--split | boolean_true | Treat split BAM or BED12 entries as distinct intervals. **Effect:** Split multi-block entries into individual intervals **Usage:** For BAM alignments with gaps or BED12 entries **Default:** false |
--bed_output --bed | boolean_true | Write output in BED format when using BAM input. **Effect:** Forces BED output format for BAM inputs **Default:** false |
--header | boolean_true | Print header from file A prior to results. **Effect:** Includes original header from input file A **Default:** false |
Advanced Options
Name | Type & Properties | Description |
|---|---|---|
--genome -g | file | Genome file for consistent chromosome sorting. **Format:** Tab-delimited file with chromosome name and size **Usage:** Only applies when used with sorted data **Purpose:** Enforces consistent chromosome sort order |
--no_name_check --nonamecheck | boolean_true | Skip chromosome naming convention checks for sorted data. **Effect:** Allows different naming (e.g., "chr1" vs "chr01") **Usage:** For files with inconsistent chromosome naming **Default:** false (strict checking) |
--no_buffer --nobuf | boolean_true | Disable buffered output. **Effect:** Print each line immediately instead of buffering **Usage:** For real-time processing or piping **Trade-off:** Slower performance but immediate output **Default:** false (buffered output) |
--io_buffer --iobuf | string | Specify input buffer memory size. **Format:** Integer with optional K/M/G suffix **Example:** "128M" for 128 megabytes **Note:** No effect with compressed files |
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.1 \
-main-script target/nextflow/bedtools/bedtools_map/main.nf \
-params-file params.yaml Relationships
Used by
0 relationships
No components use this component.
Current component
bedtools/bedtools_mapbiobox v0.4.1
Uses
0 relationships
No component dependencies found.