intersectBed-2.26.0
The DE Quick Start tutorial provides an introduction to basic DE functionality and navigation.
Rationale and background:
BEDTools: a flexible suite of utilities for comparing genomic features
Aaron R. Quinlan and Ira M. Hall
Bioinformatics. 2010 Mar 15; 26(6): 841–842. [PMID: 20110278 ]
BEDTools consists of a suite of sub-commands that are invoked a wide-range of genomics analysis tasks. bedtools intersect
allows one to screen for overlaps between two sets of genomic features. By far, the most common interest in two sets of genomic features is whether or not any of the features in the two sets “overlap” with one another, which is known as feature intersection. Take ChIP-Seq as example, such an analysis to identify peaks that are observed in both two different experiments could be conducted with bedtools command – intersectBed.
Pre-Requisites
- A CyVerse account. (Register for an CyVerse account here - user.cyverse.org)
- Mandatory arguments
- A bed/gff/vcf file for "B".
- Optional arguments:
- A bed/gff/vcf file or a bam file for "A" (Note: one of these has to be provided).
- -F: Minimum overlap required as a fraction of B.
- -f: Minimum overlap required as a fraction of A.
- Output format when using BAM as input.
- -wa: Write the original entry in A for each overlap.
- -wb: Write the original entry in B for each overlap. Useful for knowing what A overlaps. Restricted by -f and -r.
- -wo: Write the original A and B entries plus the number of base pairs of overlap between the two features. Only A features with overlap are reported. Restricted by -f and -r.
- -wao: Write the original A and B entries plus the number of base pairs of overlap between the two features. However, A features w/o overlap are also reported with a NULL B feature and overlap = 0. Restricted by -f and -r.
- -u: Write original A entry once if any overlaps found in B. In other words, just report the fact at least one overlap was found in B. Restricted by -f and -r.
- -c: For each entry in A, report the number of hits in B while restricting to -f. Reports 0 for A entries that have no overlap with B. Restricted by -f and -r.
- -v: Only report those entries in A that have no overlap in B. Restricted by -f and -r.
- -r: Require that the fraction of overlap be reciprocal for A and B. In other words, if -f is 0.90 and -r is used, this requires that B overlap at least 90% of A and that A also overlaps at least 90% of B.
- Strandedness: Force “strandedness”. That is, only report hits in B that overlap A on the same/opposite strand. By default, overlaps are reported without respect to strand.
The following test data are provided for testing BWA-index-mem here /iplant/home/xiaofei_iplant/analyses/intersectBed/test_data:
G3_P_K4me3_rep1_chr8_R_rmDup.bed
G3_P_K4me3_rep2_chr8_R_rmDup.bed
Note: These are the output of HOMER_findPeaks 4.8.3 (using H3 as background control).
Results
Successful execution of the "intersectBed" will create a directory holding the intersected features file.
Outputs
- commonPeaks/SmpName_interSect.bed (e.g. G1_P_K4me3_interSect.bed)