I have a .BAM file which contains discordantly and concordantly mapped mate-pairs. I used bedtools Pairtobed to extract the mate-pairs which both show overlap with targeted regions (Illumina target .bed file). Is it somewhere possible to remove the parts of the mate-pairs that do not show overlap? I couldn't find it in the bedtools manual... can I just use intersectBed for each read for this?
Once you filter for mate-pairs mapping to targeted regions, the mate-pairs that do not overlap are already removed. If you post an example of what you have and what you want, I can help you more.
With the -type parameter of pairToBed and -v of intersectBed, you can definitely achieve it, but can't pinpoint without a snippet of data.
-type Approach to reporting overlaps between BEDPE and BED.
either Report overlaps if either end of A overlaps B.
- Default.
neither Report A if neither end of A overlaps B.
both Report overlaps if both ends of A overlap B.
xor Report overlaps if one and only one end of A overlaps B.
notboth Report overlaps if neither end or one and only one
end of A overlap B. That is, xor + neither.
ispan Report overlaps between [end1, start2] of A and B.
- Note: If chrom1 <> chrom2, entry is ignored.
ospan Report overlaps between [start1, end2] of A and B.
- Note: If chrom1 <> chrom2, entry is ignored.
notispan Report A if ispan of A doesn't overlap B.
- Note: If chrom1 <> chrom2, entry is ignored.
notospan Report A if ospan of A doesn't overlap B.
- Note: If chrom1 <> chrom2, entry is ignored.