[Bioperl-l] adding HSP information to BLAST output graphic (Bio::Graphics)

Adam Witney awitney at sgul.ac.uk
Thu Aug 21 14:41:10 UTC 2008


Hi,

I am going through the Bio::Graphics HOWTO on the wiki.

Looking at render_blast4.pl, the description text describes the whole  
hit and is set for the whole track, but i would like to be able to add  
HSP information such as the identity matches onto the picture, this is  
stored in the $hsp object. How would i go about adding that to the  
picture?

the relevant piece of code is:

       my $track = $panel->add_track(
                                     -glyph       => 'graded_segments',
                                     -label       => 1,
                                     -connector   => 'dashed',
                                     -bgcolor     => 'blue',
                                     -font2color  => 'red',
                                     -sort_order  => 'high_score',
                                     -description => sub {
                                       my $feature = shift;
                                       return unless $feature- 
 >has_tag('description');
                                       my ($description) = $feature- 
 >each_tag_value('description');
                                       my $score = $feature->score;
                                       "$description, score=$score";
                           #            "score=$score";
                                      },
                                    );

       next unless $hit->significance < 1E-20;

       my $feature = Bio::SeqFeature::Generic->new(
                                                   -score        =>  
$hit->raw_score,
                                                   -display_name =>  
$hit->name,
                                                   -tag          => {
                                                                      
description => $hit->description
                                                                    },
                                                  );

       while( my $hsp = $hit->next_hsp )
         {
          $feature->add_sub_SeqFeature($hsp,'EXPAND');
         }

       $track->add_feature($feature);

thanks for any help

adam



More information about the Bioperl-l mailing list