Skip to content

bedtools

A set of genome arithmetic tools


bedtools requires an environment module

In order to use bedtools, you must first load the appropriate environment module:

module load gnu

The bedtools suite is a swiss-army knife of tools for a wide-range of genomics analysis tasks. Many of these tools perform genome arithmetic and set theoretic analyses on genomes.

Using bedtools on the HPC#

Connect to the HPC and run the following commands to create a folder and download a set of example files into it:

## Load the required modules
$ ml gnu

## If you are using a compute node or the RCC Desktop App in Open OnDemand...
## Then, you'll also need this to download data
$ ml webproxy

## Make a directory for working
$ mkdir bedtools_workdir
$ cd bedtools_workdir

## Now create the tutorial data
$ touch a.bed
$ touch b.bed
$ printf "Chr3\t11699949\t11700000\nChr3\t11699967\t11700018\nChr3\t11699972\t11700023" >> a.bed
$ printf "Chr3\t11699950\t11699990\nChr3\t11699970\t11700020\nChr4\t11699972\t11700023" >> b.bed


## Perform an intersection on the available genome data
$ bedtools intersect -wb -a a.bed -b b.bed 

For a complete tutorial, follow the available online Example.
Further information about bedtools can be found at the Bedtools documentation site.