BEDTools

Contents:

Created on 24 Apr 2017

@author: ernesto

class BEDTools.BEDTools.BEDTools(bedtools_folder)

Class used to perform different operations with the BEDTools package.

This is essentially a wrapper for the BEDTools package. The functionality is quite limited and additional functions will be added as necessary

Methods

make_windows(w, g[, s, subtract, lextend, …]) This method will make windows from a genome file by using ‘bedtools makewindows’
make_windows(w, g, s=None, subtract=None, lextend=None, rextend=None, verbose=False)

This method will make windows from a genome file by using ‘bedtools makewindows’

Parameters:
w : int

width of windows in bp

g : filename

Path to genome file

s : int , optional

overlap in bp. i.e. if -w 100 -s 80 will generate:

chr1 0 100 chr1 80 180 chr1 160 260 … So, -s defines the offset in bp

Another example -w 1000 -s 200

chr1 0 1000 chr1 200 1200 chr1 400 1400 chr1 600 1600

lextend : int, optional

Extend each interval to the left by int bases

rextend : int, optional

Extend each interval to the right by int bases

subtract : filename, optional

BED file containing the features that will be removed from the generated windows. For example, if we have the following window:

chr20 1000 2000

And we have the following feature in the BED file: chr20 1100 1200 Then the resulting windows will be like:

chr20 1000 1100 chr20 1200 2000

verbose : bool, optional

Default=False

Returns
——
list

A list of lists. Each sublist is composed of [‘chr’,’start’,’end’] It will return an empty list if not elements for a certain chr are defined