Hi, Does anyone know how can I draw programmatically a region of a bam alignment to a png image? I want to do this to examine several bam alignments at a time.
Because this sounds a lot like what a genome browser does (IGV, USCS, etc) could you define what your png should look like that differs from a genome browser screen shot?
You can do this using Gviz R package.
You could control IGV over a port: https://www.broadinstitute.org/igv/PortCommands
I wrote a tool to convert a BAM to SVG: https://github.com/lindenb/jvarkit/wiki/Bam2SVG
See also: Alignment plot of a small extract (sequence) from a .bam file
Recently posted (hence my late answer): https://github.com/stevekm/IGV-snapshot-automator
Login before adding your answer.
Use of this site constitutes acceptance of our User Agreement and Privacy