Get overlapping features with certain fraction max
1
0
Entering edit mode
3.8 years ago
irfanwustl ▴ 90

Hi, Given two bed files, I want to get the overlapping feature which has at most x bp overlap. Probably I should use closest bed but how to restrict the overlap to some x bp at most?

genome bedtools • 675 views
ADD COMMENT
0
Entering edit mode
3.8 years ago

pipe the output of bedtools intersect into awk to filter on the overlapsize:

awk '{x1=int($2);x2=int($5);B=x1<x2?x2:x1; x1=int($3);x2=int($6);E=x1<x2?x1:x2;if(E-B<20) print}'
ADD COMMENT

Login before adding your answer.

Traffic: 1871 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