Adam Witney | 21 Aug 16:38

adding HSP information to BLAST output graphic (Bio::Graphics)


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";
                                      },
(Continue reading)

Adam Witney | 27 Aug 18:21

Re: adding HSP information to BLAST output graphic (Bio::Graphics)


after some digging around myself, this seems to do the trick, although  
i don't know if it will always work, as i am having to add a separate  
sort function.

On 21 Aug 2008, at 15:41, Adam Witney wrote:

>
> 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',

                                     -part_labels => sub {
                                       my ($feature,undef,$partno) = @_;
(Continue reading)


Gmane