Question: Quick Visual Inspection Of Mapping Images For A List Of Regions
8
gravatar for 2184687-1231-83-
7.6 years ago by
2184687-1231-83-4.9k wrote:

Hi,

I would like to quickly have a look to a few hundred images of reads mapped to a reference, for a list of a few hundred regions.

What I've got so far is a file with a list of regions "chrname:start-end", and I am simply using samtools tview for them like this:

cat peaks.txt | while read i; do echo -e "g$i\n." | samtools tview my.bam my.ref.fa.gz; done

The "." at the end is to switch of the dots in the tview configuration. I use Ctrl+C to go to the next region.

Is there a better way to do this? Maybe something that generates image files?

Cheers

visualization mapping • 2.4k views
ADD COMMENTlink written 7.6 years ago by 2184687-1231-83-4.9k
10
gravatar for Sean Davis
7.6 years ago by
Sean Davis25k
National Institutes of Health, Bethesda, MD
Sean Davis25k wrote:

Take a look at the IGV browser. In particular, it has some nice scripting functionality:

http://www.broadinstitute.org/software/igv/batch

and

http://www.broadinstitute.org/software/igv/PortCommands

ADD COMMENTlink written 7.6 years ago by Sean Davis25k
1

bedtools has a script called bedToIgv that will create an IGV batch script for generating images for each interval in a BED/GFF/VCF file.

ADD REPLYlink written 7.2 years ago by Aaronquinlan10k

+1 for the batch query

ADD REPLYlink written 7.6 years ago by Pierre Lindenbaum112k
5
gravatar for Scott Cain
7.6 years ago by
Scott Cain750
Scott Cain750 wrote:

Since you already have BAM files, you can use Bio::DB::Sam with GBrowse and gbrowse_img to generate images. It could easily be scripted using wget or curl and shell scripting and gbrowse_img will return graphics like GBrowse would use. Alternatively, you could skip the webserver and do the image generation with Bio::Graphics and perl. For more information, you can take a look at:

GBrowse2 Install Doc

Bio::DB::Sam

Bio::Graphics

BioPerl

ADD COMMENTlink written 7.6 years ago by Scott Cain750
4
gravatar for Ido Tamir
7.2 years ago by
Ido Tamir4.9k
Austria
Ido Tamir4.9k wrote:

same answer as for other thread

most genome browsers have scripting capability IGB and IGV.[?] GBrowse2 also allows linking and by this scripting.

If you want something really small:[?]

  1. download the two files from lookseq lookseq
  2. and compile them: g++ render_image.cpp -O3 -o render_image -lpng -L . -lbam
  3. create image with: ./render_image --bam=mybam.bam --options=snps,pairs,arrows,single,faceaway,inversions,linkpairs,colordepth --ref=myref.fa --region="2L:1-200000" --png=2L.a.png

This way you can quickly create small images with the reads from your bam file with many viewing options. like this example (click on one button on the right).

ADD COMMENTlink written 7.2 years ago by Ido Tamir4.9k

IIRC now I copied the lookseq files into the folder of the samtools and compile there for correct linkage with libbam YMMV.

ADD REPLYlink written 7.2 years ago by Ido Tamir4.9k
3
gravatar for 2184687-1231-83-
7.2 years ago by
2184687-1231-83-4.9k wrote:

For different level of zoomed-out views as bitmaps, Lookseq's render_image is great. In combination with ImageMagick's montage tool, it does pretty much all I want:

montage -tile 1 -geometry +0+0 $i/*.png $i.png

For nucleotide-level textual views, I've just been made aware about Pierre's bamttview, which is a modification of samtools tview:

http://plindenbaum.blogspot.com/2011/07/text-alignment-viewer-using-samtools.html

ADD COMMENTlink modified 7.2 years ago • written 7.2 years ago by 2184687-1231-83-4.9k

many thanks to the LookSeq people and @Pierre Lindenbaum for both solutions.

ADD REPLYlink written 7.2 years ago by 2184687-1231-83-4.9k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1601 users visited in the last hour