Filtering out of both read pairs from BAM file if any of the two align within interval
2
0
Entering edit mode
2.1 years ago
volatic • 0

Dear all,

I have a really basic question regarding how to filter out rRNA reads from my paired end RNA-seq data. Essentially I would like to filter out any read pair aligning within a bed file of rRNA coordinates, which I am doing using "bedtools intersect" with the -v flag. This works fine and I get rid of all reads aligning within this region, yet the issue lies in that if only one of the reads of a pair lies within this interval, then it only filters out the one that is within the interval and retains the other end.

Does anyone know of any tool that does either: a) removes both reads if at least one of them lies within an interval; or b) removes "orphan" reads for which its pair is not present in the bam file. Unfortunately, the FLAG field can't be used since the reads are actually properly paired at the time of aligning.

Thank you!

RNA-Seq • 770 views
ADD COMMENT
0
Entering edit mode
ADD COMMENT
0
Entering edit mode
2.1 years ago

2nd answer : I forgot I wrote samviewwithmate http://lindenb.github.io/jvarkit/SamViewWithMate.html

see also Extract reads within given region, and their mates ; How to extract reads in a specific region from a BAM file and also their mates mapped elsewhere ? ;

you would have to use bedtools complement to filter out the reads.

ADD COMMENT

Login before adding your answer.

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