Skip to content

intersect_bedpe

Concepts

intersect_bedpe is a comprehensive wrapper for bedtools intersect, designed to perform intersection operations on .bedpe files. intersect_bedpe is a key component of the aqua_tools suite, quickly identifying properties and relationships in .bedpe files and classifying intersections for easy downstream filtering.

Vanilla

Let’s start with a simple example using one .bedpe file and one .bed file.

intro

Understanding the output

Understanding the output of intersect_bedpe is key. By default, the output of intersect_bedpe is organized into channels that correspond to the upstream and downstream .bedpe feet.

intro

One-bed intersection types

Intersection types allow for a quick assessment of the intersection output. The next 4 slides explain the 3 possible intersection types in a one-bed analysis.

intro intro intro intro

Two bed intersection types

Now let’s provide intersect_bedpe with a second .bed file. With two .bed files, -A and -B, we gain additional intersection types.

intro intro intro

Multiple intersection types

intro

Reporting intersecting .bed regions

So far, we have only been reporting intersecting .bedpe rows. With --print_bed TRUE, we can print intersecting .bed rows instead of .bedpe.

intro

Reporting .bedpe absences

With --absence TRUE , intersect_bedpe will report absences instead of intersections.

intro

Reporting .bed absences

intro

Boolean intersections and absences

--print_bool TRUE returns the entire, original input .bedpe file, with two additional columns containing boolean values. This option provides a comprehensive report on intersections as well as absences.

intro

Usage

Given a bedpe file, intersect_bedpe prints rows of the .bedpe in standard out that intersect with rows of given .bed file(s) on either foot of the pair

Expected output:

<chr_up> <start_up> <end_up> <chr_down> <start_down> <end_down> | <intersection_up> <intersection_down>

Usage and Option Summary

Terminal window
intersect_bedpe -A H3K27ac -P /path/to/bedpe

(or):

Terminal window
intersect_bedpe -A H3K27ac -B H3K27me3 -P /path/to/bedpe

Required

Short OptionLong OptionDescription
-A--bed_APath to the first bed file
-P--bedpePath to the bedpe file

Optional

Short OptionLong OptionDescription
-v--absenceIf TRUE, reports those rows of the bedpe that do not intersect with rows of given bed file. Default FALSE
-B--bed_BPath to the second bed file
-f--flankGenome distance in bp that the bed should be in vicinity of either foot. Default is 0
--print_bedIf specified, reports rows of bed instead of bedpe
--print_boolIf TRUE, retains all rows of bedpe and prints TRUE/FALSE in new columns to indicate intersections on bedpe feet. Default FALSE
-h--helpHelp message