Question: Bedtools intersect A contains B and vise versa
0
gravatar for Medhat
3.8 years ago by
Medhat8.3k
Texas
Medhat8.3k wrote:

Is there is any options when using 

bedtools intersect -a A.bed -b B.bed

 

to detect if line in A contains line in B and vice verse  "I do not know if -f could help me in this!!"

for example

A.bed

  chr1 100 200 

  chr1 150 300

B.bed

  chr1 110 150

  chr1 180 350

the result shall be A contains B (assuming I am using -wb )

chr1 100 200 chr1 110 150

 

sequence bedtools • 1.1k views
ADD COMMENTlink modified 3.8 years ago • written 3.8 years ago by Medhat8.3k

What is the expected output ?

ADD REPLYlink written 3.8 years ago by geek_y9.6k

the result shall be A contains B (assuming I am using -wb )

chr1 100 200 chr1 110 150

ADD REPLYlink written 3.8 years ago by Medhat8.3k
1
gravatar for PoGibas
3.8 years ago by
PoGibas4.8k
Vilnius
PoGibas4.8k wrote:
# minimal overlap fraction
# bedtools intersect -f
bedtools intersect -b B.bed -a A.bed -wo -f 1​

chr1    110     150     chr1    100     200     40

ADD COMMENTlink modified 3.8 years ago • written 3.8 years ago by PoGibas4.8k

Thanks but it does not work like that , I think the one that will work is, 

 

-a b.bed -b a.bed -wo -f 1

chr1    110    150    chr1    100    200    40

 

 

ADD REPLYlink modified 3.8 years ago • written 3.8 years ago by Medhat8.3k
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: 616 users visited in the last hour