I've a question about intersectBed. Is it possible to extract only alignment like this :
BED/BAM A ============== =================
BED FILE B ============
But no alignment like this (even if the read overlapp 100% of the feature, I don't want to extract these reads)
BED/BAM A ========================= =================
BED FILE B =============
So, only extracting reads that have 90-95% of its sequence overlapping 90-95% of the feature.
Is it clear ?
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.
Another option is the use of the
tool in the
BEDOPS suite, in which you can perform set operations on two (or more) BED files.
$ 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
bedops provides examples for them, but please let me know if you have any questions.
Traffic: 2344 users visited in the last hour