## Matching genomic regions / Intersect BED

### Description

Reports overlaps between two feature files such as BED, VCF and GTF. One of the files can also be BAM. Note that when A and B files are compared, the B file is loaded into memory. Therefore to minimize memory usage, one should set the smaller of the two files as the B file.

### Parameters

- Write the original entry in A for each overlap (yes, no) [no]
- Write the original A entry once if any overlaps found in B (yes, no) [no]
- Only report those entries in A that have no overlaps with B (yes, no) [no]
- Write the original entry in B for each overlap (yes, no) [no]
- Force strandedness (yes, no) [no]
- Write the original A and B entries for overlapped A features (yes, no) [no]
- Write the original A and B entries for all A features (yes, no) [no]
- For each entry in A, report the number of overlaps with B (yes, no) [no]
- Minimum overlap required as a fraction of A (0.0-1.0) [0.000000001}
- Require that the fraction overlap be reciprocal for A and B (yes, no) [no]
- File A is BAM format (yes, no) [no]
- Write uncompressed BAM output (yes, no) [no]
- When using BAM input, write output as BED (yes, no) [no]
- Treat split BAM or BED12 entries as distinct BED intervals (yes, no) [no]

### Details

By far, the most common question asked of two sets of genomic features is whether or not any of the features in the two sets “overlap” with one another. This is known as feature intersection. IntersectBed allows one to screen for overlaps between two sets of genomic features. Moreover, it allows one to have fine control as to how the intersections are reported. IntersectBed works with both BED/GFF/VCF and BAM files as input.

### Output

The output is a tab-delimited text file.

### References

This tool uses the BEDTools package. Please cite the article:

Quinlan AR and Hall IM, 2010. BEDTools: a flexible suite of utilities for comparing genomic features. Bioinformatics. 26, 6, pp. 841–842.

Please see the BEDTools homepage for more details.