Question: Question about Bedtools intersect: allows for multiple matches?
0
gravatar for fr
18 days ago by
fr100
fr100 wrote:

I have a binned genome (file G.bed) that I'm trying to intersect with another file (myfile.bed). It is possible that some of the bins in G.bed have multiple matches in myfile.bed).

I was going to use bedtools intersect -a G.bed -b myfile.bed -wo, or bedtools intersect -b G.bed -a myfile.bed -wo.

but if I understand correctly this will give the intersection to either file on a 1:1 relationship right? Or would it also add additional rows for multiple matches? (i.e. exploding rows)

Thanks a lot in advance

pybedtools bedtools • 71 views
ADD COMMENTlink modified 18 days ago by jared.andrews072.3k • written 18 days ago by fr100
2
gravatar for jared.andrews07
18 days ago by
jared.andrews072.3k
St. Louis, MO
jared.andrews072.3k wrote:

It will add additional rows for multiple matches:

$cat testerA.bed
chr1    100     200
chr1    150     250
chr1    500     1000

$cat testerB.bed
chr1    100     125
chr1    125     150
chr1    149     151
chr1    700     1000

$bedtools intersect -a testerA.bed -b testerB.bed -wo
chr1    100     200     chr1    100     125     25
chr1    100     200     chr1    125     150     25
chr1    100     200     chr1    149     151     2
chr1    150     250     chr1    149     151     1
chr1    500     1000    chr1    700     1000    300
ADD COMMENTlink modified 18 days ago • written 18 days ago by jared.andrews072.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: 1093 users visited in the last hour