SEQanswers

SEQanswers (http://seqanswers.com/forums/index.php)
-   Bioinformatics (http://seqanswers.com/forums/forumdisplay.php?f=18)
-   -   Extract perfectly mapped reads from SAM/BAM file (http://seqanswers.com/forums/showthread.php?t=12849)

Graham Etherington 07-20-2011 04:45 AM

Extract perfectly mapped reads from SAM/BAM file
 
Hi,
Given a SAM or BAM file, does anyone know how to identify which paired-sequences map perfectly to the reference? By perfectly mapped, I mean that the query is identical to the the reference (or its reverse complement).
I'm fine using either command-line tools or programming.
Many thanks,
Graham

dariober 07-20-2011 07:44 AM

Hi,
I think you can look at the NM tag in the SAM/BAM file. If both reads of a pair have NM:i:0 than the match is perfect.

Dario

nilshomer 07-21-2011 07:27 AM

Make sure that there is also no soft-clipping in the cigar if you want the full read aligned.


All times are GMT -8. The time now is 04:30 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.