I would like to make a picture of a bam file aligned at a specific region. Something similar than samtools tview but as a picture not as a text output :
Do you know any tools for doing this ?
I would like to make a picture of a bam file aligned at a specific region. Something similar than samtools tview but as a picture not as a text output :
Do you know any tools for doing this ?
ImageMagick is always the answer to anything image-automation related :)
samtools tview your.bam -p chr1:5477604 -d text | convert -background black -fill white label:@- out.png
if you don't have 'convert' then just install ImageMagick.On OSX that's brew install imagemagick
IGV can be driven by a batch script, and therefore command line. It's a little bit of work to get the script written where you need it, but then you get very nice diagrams how you like them. Should be doable in Bash.
Their scripting interface looks like a series of commands, open this bam, sort the reads that way, go to this location, then take a "screenshot". It can all happen behind the scenes, and result in just the picture you are looking for.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Automated or interactive? Most genome browsers (IGV etc) will export images in various formats.