arq5x / bedtools

A powerful toolset for genome arithmetic.
http://code.google.com/p/bedtools/
GNU General Public License v2.0
139 stars 86 forks source link

Intersect not working on alignments with MAPQ = 0 #139

Open Dave217 opened 5 years ago

Dave217 commented 5 years ago

Hello,

I'm trying to filter out reads that map to a specific area using bowtie2 and bedtools intersect (moving reads not mapping to the region to a new file). This works, except for any reads with a MAPQ score of 0 are not filtered out (included in the new file), even though they are overlapping the region of interest. I don't know if this is intended behaviour, or usually not relevant because one would throw out reads that map that poorly. The reads with poor alignment quality are due to several localized mutations on the DNA template but these alignments are definitely real and correct.

The command I'm using is: bedtools intersect -a name.bam -b filter.bed -v -F .7 > name_filtered.bam

Is intersect ignoring these alignments because of the poor MAPQ, and if so is there a way to prevent that? In the bedtools documentation for other tools, there's a -q option to only operate on alignments of a specific quality, but that doesn't seem to exist for intersect. Or am I just missing it?

I'm new to this so if I can provide any additional info to help, please let me know. Likewise, sorry if I'm not understanding something, but I couldn't find anything on google about this.

Thanks very much,

Dave