This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Filtering BED file for interval length

Wondering about a quick and easy way to filter a 3 column bed file for interval length, lets say to toss all of the intervals above 1000bp in length. Thanks.

bedtools bed bedops

1 answer

awk should work fine:

awk '{if($3-$2 <= 1000) print}' file.bed > file_filtered.bed

Log in to answer this question.