Genomic Interval Manipulation

flankBed
Function: bedtools flank will create two new flanking intervals for each interval in a BED/GFF/VCF file. Note that flank will restrict the created flanking intervals to the size of the chromosome (i.e. no start < 0 and no end > chromosome size).
Usage: flankBed [OPTIONS] -i -g [-b or (-l and -r)]
bedCoverage
Function: Analyse coverage by bed files - chromosome bychromosome and genome-wide
Usage: bedCoverage genomeDatabase bedFile
Supported input format: BED
mergeBed
Function: bedtools merge combines overlapping or “book-ended” features in an interval file into a single feature which spans all of the combined features.
Usage: mergeBed [OPTIONS] -i
complementBed
Function: bedtools complement returns all intervals in a genome that are not covered by at least one interval in the input BED/GFF/VCF file.
Usage: complementBed -i <BED/GFF/VCF> -g <GENOME>
multiBamCov
Function: bedtools multicov, reports the count of alignments from multiple position-sorted and indexed BAM files that overlap intervals in a BED file. Specifically, for each BED interval provided, it reports a separate count of overlapping alignments from each BAM file.
Usage: multiBamCov [OPTIONS] -bams BAM1 BAM2 BAM3 ... BAMn -bed
bigBedNamedItems
Function: Extract item of given name from bigBed
Usage: bigBedNamedItems file.bb name output.bed
Supported input format: bigBed
intersectBed
Function: 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. bedtools intersect 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. bedtools intersect works with both BED/GFF/VCF and BAM files as input.
Usage: intersectBed [OPTIONS] -a \ -b
closestBed
Function: Similar to intersect, closest searches for overlapping features in A and B. In the event that no feature in B overlaps the current feature in A, closest will report the nearest (that is, least genomic distance from the start or end of A) feature in B. For example, one might want to find which is the closest gene to a significant GWAS polymorphism. Note that closest will report an overlapping feature as the closest—that is, it does not restrict to closest non-overlapping feature. The following iconic “cheatsheet” summarizes the funcitonality available through the various optyions provided by the closest tool.
Usage: closestBed [OPTIONS] -a -b
slopBed
Function: bedtools slop will increase the size of each feature in a feature file by a user-defined number of bases. While something like this could be done with an awk '{OFS="\t" print $1,$2-,$3+}', bedtools slop will restrict the resizing to the size of the chromosome (i.e. no start < 0 and no end > chromosome size).
Usage: slopBed [OPTIONS] -i -g [-b or (-l and -r)]
subtractBed
Function: bedtools subtract searches for features in B that overlap A. If an overlapping feature is found in B, the overlapping portion is removed from A and the remaining portion of A is reported. If a feature in B overlaps all of a feature in A, the A feature will not be reported.
Usage: subtractBed [OPTIONS] -a -b
bedtools map
Function: Map features in a B file onto features in an A file and apply statistics and/or summary operations on those features
Usage: bedtools map [OPTIONS] -a <bed/gff/vcf> -b <bed/gff/vcf>
Supported input format: BED, GFF, GTF, VCF
bedCommonRegions
Function: Create a bed file (just bed3) that contains the regions common to all inputs.
Usage: bedCommonRegions file1 file2 file3 ... fileN
Supported input format: BED
bedtools fisher
Function: Perform Fisher's test to see if the amount of overlap between the two sets of intervals is more or less than expected, given their coverage and the genome size.
Usage: bedtools fisher [OPTIONS] -a <bed/gff/vcf/bam> -b <bed/gff/vcf/bam> -g <genome file>
Supported input format: BED, BAM, GFF, GTF, VCF
bedtools igv
Function: Creates a batch script to create IGV images at each interval defined in a BED/GFF/VCF file.
Usage: bedtools igv [OPTIONS] -i <bed/gff/vcf>
Supported input format: BED, GFF, GTF, VCF
bedtools groupby
Function: Summarize a dataset column based upon common column groupings. Akin to the SQL "group by" command.
Usage: bedtools groupby [OPTIONS] -i <input> -g <group columns> -c <op. column> -o <operation>
Supported input format: BED