Create Image From Mapping Region
4
2
Entering edit mode
11.6 years ago
Yahan ▴ 400

I am looking for a way to generate an image for a set of mapping positions in a bam file.

Instead of browsing to each position by providing the coordinates in a tool like samtools tview, which is pretty cumbersome, I could then provide a list of such coordinates after which for each of them an image would be created.

Then I could browse these images to get a first impression of how the mapping looks like.

Does anyone know of a tool that could do something like that?

Thanks

samtools • 2.6k views
ADD COMMENT
3
Entering edit mode
11.6 years ago

I wrote something like this for IGV: http://plindenbaum.blogspot.fr/2011/07/controlling-igv-through-port-my.html

and I also wrote a tool that takes a VCF input and a bam: see http://code.google.com/p/variationtoolkit/wiki/VcfTTView

$ echo -e "ref\t3\nref2\t2" |\
  vcfttview -x 3 -B toy.bam -R toy.fa

>ref:3

1         11              21        31         41        51        61           
AGCATGTTAGATAA****GATA**GCTGTGCTAGTAGGCAG*TCAGCGCCATNNNNNNNNNNNNNNNNNNNNNNNNNNNN
      ........    ....  ......K.K......K. ..........                            
      ........AGAG....***...      ,,,,,    ,,,,,,,,,                            
        ......GG**....AA                                                        
        ..C...**** ...**...>>>>>>>>>>>>>>T.....                                 



>ref2:2

1         11            21        31        41        51        61              
aggttttataaaac****aattaagtctacagagcaactacgcgNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
.............Y    ..W...................                                        
..............****..A...                                                        
 .............****..A...T.                                                      
     .........AAAT.............                                                 
         C...T****....................                                          
           ..T****.....................                                         
             T****......................
ADD COMMENT
1
Entering edit mode
11.6 years ago

You can use IGV and talk to IGV via its port mechanism. If you are an R user, the SRAdb package has convenience functions to work with IGV to produce plots.

ADD COMMENT
0
Entering edit mode
11.6 years ago
Fidel ★ 2.0k

I've found that the best way to achieve what you want is using IGV batch script.

You can quickly generate a batch script as follows:

> echo "snapshotDirectory <some directory to put the images>" > igv_batch_script.txt
> cat file.bed | perl -lane 'print "goto $F[0]:$F[1]-$F[2]\nsnapshot";' >>  igv_batch_script.txt

Then you just load this file in IGV: "File" -> "Run Batch Script..."

For further info look at: http://www.broadinstitute.org/igv/batch

ADD COMMENT
0
Entering edit mode
10.0 years ago

If you are familiar with the UCSC browser, you could load your reads into a custom track, add annotation tracks (if desired) and use UCSC Fetch to generate screenshots around regions-of-interest.

You could then use something like SimpleViewer to make a quickly-browsable gallery.

ADD COMMENT

Login before adding your answer.

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