[Bioperl-l] Pictogram

Shawn Hoon shawnh at fugu-sg.org
Sat May 10 13:57:37 EDT 2003


Hi folks,
	I just added a Bio::Graphics::Pictogram module (Lincoln, I hope the 
name space is okay with you) that
draws consensus motifs of the format described by Chris Burge and 
colleagues. It only produces SVG output
and u will need to convert that to png or jpeg if you need to. SVG may 
be viewed using the adobe plugin or
the batik suite of tools.  Naturally this module  requires SVG.pm
Synopsis of the code:

use Bio::Graphics::Pictogram;
  use Bio::SeqIO;

   my $sio = Bio::SeqIO->new(-file=>$ARGV[0],-format=>'fasta');
   my @seq;
   while(my $seq = $sio->next_seq){
    push @seq, $seq;
   }

   my $picto = Bio::Graphics::Pictogram->new(-width=>"800",
                                             -height=>"500",
                                             -fontsize=>"60",
                                             -plot_bits=>1,
                                             -background=>{
                                                           'A'=>0.25,
                                                           'C'=>0.18,
                                                           'T'=>0.32,
                                                           'G'=>0.25},
                                             -color=>{'A'=>'red',
                                                       'G'=>'blue',
                                                       'C'=>'green',
                                                       'T'=>'magenta');

   my $svg = $picto->make_svg(\@seq);

   print $svg->xmlify."\n";

I have put it on the web for testing:

http://scooby.fugu-sg.org:9001/pictogram/index.html

hope this is useful.

shawn


  



More information about the Bioperl-l mailing list