Updated Oct 19, 2026

Utilities

Intersect, subtract or merge genomic intervals

bedtools-intervals is a genomic interval node exposing five bedtools operations.

Agent

overview

What bedtools-intervals does

Supply local interval files and choose intersect, intersect-unique, subtract, merge or sort. Receive the native text for that operation.

intersect returns overlapping portions of A for each B overlap. intersect-unique returns each A feature with any overlap once. subtract removes B coverage; merge sorts A before collapsing overlapping or touching features.

BED, GFF/GFF3, GTF and VCF are accepted, with gzip for BED and VCF, at most 2 GiB per file. B is required for intersection and subtraction and refused for merge/sort. Malformed input fails with native diagnostics. No network calls are made.

This packaged operation uses 2.30.0. Upstream license: MIT. The linked source identifies the actual program; this page documents the adapter's exposed contract.

source github.com/arq5x/bedtools2/tree/v2.30.0

use cases

Where bedtools-intervals fits

Find feature overlaps

Return the overlapping portions of A features for each B overlap.

Subtract covered regions

Remove B coverage from the supplied A features.

Sort and merge intervals

Sort features before merging overlaps and touching intervals.

reference

bedtools-intervals inputs and flags

4 inputs
NameTypeFlagDescription
sourceFOLDER--sourceFolder holding the interval files (.bed, .bed.gz, .gff, .gff3, .gtf, .vcf, .vcf.gz; each at most 2 GiB).
operationSTRING--operationintersect (overlapping parts), intersect-unique (A features with any overlap), subtract, merge or sort.
aSTRING--aPath of the A file inside the folder.

Showing key inputs. bedtools-intervals exposes 4 inputs in total.

Full flag reference (4 inputs)
NameTypeFlagDescription
sourceFOLDER--sourceFolder holding the interval files (.bed, .bed.gz, .gff, .gff3, .gtf, .vcf, .vcf.gz; each at most 2 GiB).
operationSTRING--operationintersect (overlapping parts), intersect-unique (A features with any overlap), subtract, merge or sort.
aSTRING--aPath of the A file inside the folder.
bSTRING--bPath of the B file inside the folder; required for intersect, intersect-unique and subtract, refused for merge and sort.

example

Run bedtools-intervals

bedtools-intervals · command
python3 /app/run.py --source ./source --operation intersect --a peaks.bed --b genes.bed ./output
sample output
chr1	180	200	p1
chr1	180	250	p2
chr1	500	520	p3
chr2	10	20	p4

guidance

Choosing bedtools-intervals

Use these coordinate operations for local genomic features. Genome-file operations such as complement or slop are outside the exposed contract; output does not establish biological significance.

faq

bedtools-intervals questions

source: Folder holding the interval files (.bed, .bed.gz, .gff, .gff3, .gtf, .vcf, .vcf.gz; each at most 2 GiB). operation: intersect (overlapping parts), intersect-unique (A features with any overlap), subtract, merge or sort. a: Path of the A file inside the folder. b: Path of the B file inside the folder; required for intersect, intersect-unique and subtract, refused for merge and sort.

Native interval text. intersect returns overlapping portions of A for each B overlap. intersect-unique returns each A feature with any overlap once. subtract removes B coverage; merge sorts A before collapsing overlapping or touching features.

BED, GFF/GFF3, GTF and VCF are accepted, with gzip for BED and VCF, at most 2 GiB per file. B is required for intersection and subtraction and refused for merge/sort. Malformed input fails with native diagnostics. No network calls are made.

Use these coordinate operations for local genomic features. Genome-file operations such as complement or slop are outside the exposed contract; output does not establish biological significance.

The public image repository includes download instructions for this version and a separate source/notices bundle. Its overview provides an immutable ORAS command, the expected bundle checksum and pinned upstream source directions. The bundle contains the original build recipe, runtime sources and retained component license notices. Image, source and license notice downloads.

Run bedtools-intervals yourself

The excerpt reconstructs the four exact BED rows asserted in a saved passing synthetic intersection check. The command shows the container entrypoint with example paths.

Facts on this page come from the live Trickest tool library.