Tool:sam2pairwise: a tool to visualize SAM entries as pairwise alignments
0
12
Entering edit mode
9.7 years ago
Matt LaFave ▴ 310

I was recently approached by a colleague who was doing a lot of high-throughput amplicon sequencing, and wanted to see the pairwise alignment of many reads without a lot of copy-and-paste. Since the information necessary to reproduce each alignment is present in the CIGAR and MD tag of a SAM/BAM file, I wrote a C++ program called sam2pairwise to do so.

The program takes one or more SAM entries and outputs the alignments, along with any deletions, insertions, mismatches, or trimming. For example, given an entry like this:

r002    0    ref    9    30    1S2I6M1P1I1P1I4M2I    *    0    0    AAAAGATAAGGGATAAA    *    NM:i:6    MD:Z:10

...it can be presented to sam2pairwise like this:

samtools view file.bam | sam2pairwise

...and produces the following output:

    r002    0    ref    9    30    1S2I6M1P1I1P1I4M2I    *    0    0
    AAAAGATAA*G*GGATAAA
       ||||||    ||||  
    N--AGATAA*-*-GATA--

For more information, please visit the github repo.

sam alignment • 4.6k views
ADD COMMENT
1
Entering edit mode
ADD REPLY

Login before adding your answer.

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