Question about converting SAM alignment file data to a visual text alignment (e.g., resembling blastn alignment)
0
0
Entering edit mode
ktehmsen • 0
@ktehmsen-16900
Last seen 3.1 years ago

I'm wondering if someone out there would please answer a question for me about SAM files and ways to interact with their underlying alignment data.

I used bowtie2 to make alignments between two short test sequences in fasta format, using GRCh38 as an index file (details pasted below).  The SAM file with info detailing the alignment is in the SAM file, of course -- but the general question I have is, how, if at all, can I render this alignment data in the style of a more traditional view like a BLAST alignment?  What tool can read the SAM content and render an alignment in text format that looks something like the BLAST alignments pasted below?

Thank you.

Example blastn alignment result:

(identity 'ticks' are not properly aligned in this cut&paste text example, but the concept is there)

>NC_000010.11 Homo sapiens chromosome 10, GRCh38.p12 Primary Assembly

Length=133797422

 Score = 250 bits (151),  Expect = 2e-64

 Identities = 151/151 (100%), Gaps = 0/151 (0%)

 Strand=Plus/Plus

Query  1         ATGCCCTACATATCACACCCCCAGTAATATCTTTCTGATAAGCAGACTTATCAACACTTC  60

                 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Sbjct  90921451  ATGCCCTACATATCACACCCCCAGTAATATCTTTCTGATAAGCAGACTTATCAACACTTC  90921510

Query  61        ACTTAGGGGAAACTTGTCCCAGGACATCCTATTCCCTGGGTAAACAGCCTGAGGGGAAGG  120

                 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Sbjct  90921511  ACTTAGGGGAAACTTGTCCCAGGACATCCTATTCCCTGGGTAAACAGCCTGAGGGGAAGG  90921570

Query  121       GATCTGGGCCCTAAAGGCACTTGTCTATATC  151

                 |||||||||||||||||||||||||||||||

Sbjct  90921571  GATCTGGGCCCTAAAGGCACTTGTCTATATC  90921601

 

>NC_000010.11 Homo sapiens chromosome 10, GRCh38.p12 Primary Assembly

Length=133797422

 Score = 182 bits (110),  Expect = 3e-44

 Identities = 131/151 (87%), Gaps = 20/151 (13%)

 Strand=Plus/Plus

Query  1         ATGCCCTACATATCACACCCCCAGTAATATCTTTCTGATAAGCAGACTT-----------  49

                 |||||||||||||||||||||||||||||||||||||||||||||||||           

Sbjct  90921451  ATGCCCTACATATCACACCCCCAGTAATATCTTTCTGATAAGCAGACTTATCAACACTTC  90921510

Query  50        ---------AAACTTGTCCCAGGACATCCTATTCCCTGGGTAAACAGCCTGAGGGGAAGG  100

                          |||||||||||||||||||||||||||||||||||||||||||||||||||

Sbjct  90921511  ACTTAGGGGAAACTTGTCCCAGGACATCCTATTCCCTGGGTAAACAGCCTGAGGGGAAGG  90921570

Query  101       GATCTGGGCCCTAAAGGCACTTGTCTATATC  131

                 |||||||||||||||||||||||||||||||

Sbjct  90921571  GATCTGGGCCCTAAAGGCACTTGTCTATATC  90921601

 

example SAM content for these alignments below:

2 reads; of these:

  2 (100.00%) were unpaired; of these:

    0 (0.00%) aligned 0 times

    2 (100.00%) aligned exactly 1 time

    0 (0.00%) aligned >1 times

100.00% overall alignment rate

1] 0 NC_000010.11 90921451 42 151M * 0 0 ATGCCCTACATATCACACCCCCAGTAATATCTTTCTGATAAGCAGACTTATCAACACTTCACTTAGGGGAAACTTGTCCCAGGACATCCTATTCCCTGGGTAAACAGCCTGAGGGGAAGGGATCTGGGCCCTAAAGGCACTTGTCTATATC IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII AS:i:0 XN:i:0 XM:i:0 XO:i:0 XG:i:0 NM:i:0 MD:Z:151 YT:Z:UU

2] 0 NC_000010.11 90921451 0 49M20D82M * 0 0 ATGCCCTACATATCACACCCCCAGTAATATCTTTCTGATAAGCAGACTTAAACTTGTCCCAGGACATCCTATTCCCTGGGTAAACAGCCTGAGGGGAAGGGATCTGGGCCCTAAAGGCACTTGTCTATATC IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII AS:i:-65 XN:i:0 XM:i:0 XO:i:1 XG:i:20 NM:i:20 MD:Z:49^ATCAACACTTCACTTAGGGG82 YT:Z:UU

 

SAM samtools pairwisealignment alignment blastn • 424 views
ADD COMMENT

Login before adding your answer.

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