Question: Extending BED intervals
0
gravatar for rbronste
5 weeks ago by
rbronste230
rbronste230 wrote:

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!

interval bedops bed bedtools • 122 views
ADD COMMENTlink modified 5 weeks ago by Alex Reynolds26k • written 5 weeks ago by rbronste230
2
gravatar for Alex Reynolds
5 weeks ago by
Alex Reynolds26k
Seattle, WA USA
Alex Reynolds26k wrote:

With bedops --range:

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

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

ADD COMMENTlink modified 5 weeks ago • written 5 weeks ago by Alex Reynolds26k
1
gravatar for Pierre Lindenbaum
5 weeks ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum115k wrote:

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 COMMENTlink written 5 weeks ago by Pierre Lindenbaum115k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1181 users visited in the last hour