Extracting Reads That Are Properly Paired From Bam File
1
4
Entering edit mode
13.4 years ago
Abhi ★ 1.6k

How to filter BAM file

Hey Guys

I have a bam file of which I have to extract reads that are mapping in proper pair as per library construction protocol.

The definition of proper pair is PE reads facing inwards. (-----> <-----)

Not able to perfectly form the filters that I should use to extract the properly mapped pair.

I would like to add that I am not looking for all the pairs in a bam file. I understand that is trivial enough and can be pulled out with -f 3 filter in the samtools.

What I am looking for is specific pair which is mapped inwards (----> <-----) . I know many read pairs in this particular library could be mappee (<----- <-----) or (-----> ---->)

Thanks! -Abhi

bam samtools • 22k views
ADD COMMENT
2
Entering edit mode

This is already answered here: How To Filter Bam File

ADD REPLY
1
Entering edit mode

Although what constitutes a "proper pair" is, I think, up to the aligner, I think most aligners require a pair to point inwards (an "innie") and within some reasonable distance. So I don't think you'll get "lefties" or "righties" as proper pairs, and at least bwa doesn't seem to accept "outties" either - at least not my mate pair library.

ADD REPLY
0
Entering edit mode

This is already answered here: How To Filter Bam File

ADD REPLY
0
Entering edit mode

Well I am not sure how I could re-open this thread but I dont think the other thread pointed by Keith provides the answer I am looking for. I am looking to find a specific directional pair and not all the reads that are paired. I need to know reads that are (---> <---) mapped inwards and not any pair in the data.

-Abhi

ADD REPLY
0
Entering edit mode

Picard provides explaination of the S/BAM flag details: http://picard.sourceforge.net/explain-flags.html

ADD REPLY
3
Entering edit mode
13.4 years ago

These were mentioned in the comments and I only repeat them here because I think they qualify as an answer.

The definition of a proper pair is already the one that you are looking for. The other orientations are probably not reported as a pair unless the aligner has a setting that reports these as well. In that case it is up to the aligner to tag this (with a custom tag perhaps) and you would need to look for these tags.

The BAM format only supports the concept of proper pair, but it does not specify what the proper pair means - that job is up to the aligner.

ADD COMMENT

Login before adding your answer.

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