Intersectbed Overlap
2
2
Entering edit mode
10.6 years ago

Hi,

I've a question about intersectBed. Is it possible to extract only alignment like this :

chromosome ===============================================================
BED/BAM A               ==============              =================
BED FILE B               ============
RESULT                  ==============

But no alignment like this (even if the read overlapp 100% of the feature, I don't want to extract these reads)

chromosome ===============================================================
BED/BAM A    =========================              =================
BED FILE B               =============
RESULT

So, only extracting reads that have 90-95% of its sequence overlapping 90-95% of the feature.

Is it clear ?

Thanks,

N.

bedtools intersect overlap • 4.4k views
ADD COMMENT
4
Entering edit mode
10.6 years ago

There are these options in intersectBed:

-f  Minimum overlap required as a fraction of A.
    - Default is 1E-9 (i.e., 1bp).
    - FLOAT (e.g. 0.50)

-r  Require that the fraction overlap be reciprocal for A and B.
    - In other words, if -f is 0.90 and -r is used, this requires
      that B overlap 90% of A and A _also_ overlaps 90% of B.
ADD COMMENT
0
Entering edit mode

Thanks I didn't see the -t parameter. Sorry

ADD REPLY
0
Entering edit mode

Thanks I didn't see the -r parameter. Sorry – NicoBxl 0 secs ago

ADD REPLY
0
Entering edit mode

Thanks I didn't see the -r parameter. Sorry

ADD REPLY
0
Entering edit mode
10.0 years ago

Another option is the use of the bedops tool in the BEDOPS suite, in which you can perform set operations on two (or more) BED files.

For example:

$ bedops -e -90% B.bed A.bed

will return all elements of B.bed which overlap elements in A.bed by 90 or more percent. You can also specify overlap criteria by bases, instead of percent.

There are other set operations and the documentation for bedops provides examples for them, but please let me know if you have any questions.

ADD COMMENT

Login before adding your answer.

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