This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Alignment plot of a small extract (sequence) from a .bam file

Hi

I have a made variant callings of a bam file. Now instead of checking 100 variants one by one in a genome browser (such as IGV) and making screenshots, I am wondering if there is any software that allows me to create an alignment plot of a defined region.

Let's say I am looking for something that works similarly to:

imaginary-alignment-plot-software --input my.bam --chr 7 --start 5000 --end 7000 #etc....

Thanks for any pointers!

Cheers

bam snp sequencing plot alignment

2 answers

I wrote a

image-1

image-2

image-3

Hello Pierre-- very useful application. thank you. Is there a way to control aesthetics of the svg? ie sample name, coordinates, grey banding in background? Thanks!

You can use samtools tview in order to visualize aligned reads spanning a specific position in you sorted bam.

samtools tview [-p chr:pos] [-s STR] [-d display] <in.sorted.bam> [ref.fasta]

If -d is set to T you can visualize output as text alignment file. As example:

      47696431  47696441  47696451  47696461  47696471  47696481  47696491      
AATCCCCAGTCTTTGCCTTGCACAAACCTATATGCCCGTTGACTCTCTGGGGTGGGGAAAAAAAAAGTCATATTTAAGGT
................................................................................
,,,,,,,,,,,,,,,,,   ,,,,,,,,,,,,,,,,,,,,,,,,                   ,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,       
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,       
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,       
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,       
................................................................................
................................................................................
...................................A............................................
...................................A............................................
................................................................................
................................................................................
................................................................................
................................................................................
...................................A............................................
...................................A............................................
................................................................................
................................................................................
................................................................................

Take a look at this for further information.

Log in to answer this question.