Question: Extracting Reads That Are Properly Paired From Bam File
4
gravatar for Abhi
7.5 years ago by
Abhi1.5k
United States
Abhi1.5k wrote:

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 • 17k views
ADD COMMENTlink modified 7.5 years ago by Istvan Albert ♦♦ 78k • written 7.5 years ago by Abhi1.5k
2

This is already answered here: http://biostar.stackexchange.com/questions/5517/how-to-filter-bam-file

ADD REPLYlink written 7.5 years ago by iw9oel_ad6.0k
1

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 REPLYlink written 7.5 years ago by Ketil3.9k

This is elready answered here: http://biostar.stackexchange.com/questions/5517/how-to-filter-bam-file

ADD REPLYlink written 7.5 years ago by iw9oel_ad6.0k

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 REPLYlink written 7.5 years ago by Abhi1.5k

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

ADD REPLYlink written 7.5 years ago by Rm7.8k
3
gravatar for Istvan Albert
7.5 years ago by
Istvan Albert ♦♦ 78k
University Park, USA
Istvan Albert ♦♦ 78k wrote:

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 COMMENTlink modified 7.5 years ago • written 7.5 years ago by Istvan Albert ♦♦ 78k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1089 users visited in the last hour