Extending BED intervals
2
0
Entering edit mode
5.4 years ago
rbronste ▴ 420

Kind of a straightforward question, but what is a quick/simple method to take a bed file with an avg bp size of 350 and extend every interval by 325bp in each direction? Thanks!

bed interval bedops bedtools • 1.6k views
ADD COMMENT
2
Entering edit mode
5.4 years ago

With bedops --range:

$ bedops --range 325 --everything in.bed > out.bed

https://bedops.readthedocs.io/en/latest/content/reference/set-operations/bedops.html

ADD COMMENT
1
Entering edit mode
5.4 years ago

bedtools slop https://bedtools.readthedocs.io/en/latest/content/tools/slop.html

or awk

awk -F '\t' '{x=325;S=int($2)-x;printf("%s\t%d\t%d\n",$1,(S<0?0:S),int($3)+x);}'
ADD COMMENT

Login before adding your answer.

Traffic: 1953 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6