Yes the source is where its supposed to be. The problem is creating several pngs at once. If i change the script to this:
sub parseBlastOutput{
use Bio::Graphics;
use Bio::SearchIO;
use Bio::SeqFeature::Generic;
my $searchio = Bio::SearchIO->new( -file => 'CAZyOutputM7.xml',
-format => 'blastxml' ) or die
+'parse failed';
my $result = $searchio->next_result() or die "no result";
#while (my $result = $searchio->next_result) {
my $panel = Bio::Graphics::Panel->new( -length => $result->
+query_length,
-width => 800,
-pad_left => 10,
-pad_right => 10 );
my $full_length = Bio::SeqFeature::Generic->new( -start
+ => 1,
-end
+ => $result->query_length,
-display_name
+ => $result->query_name );
$panel->add_track( $full_length,
-glyph => 'arrow',
-tick => 2,
-fgcolor => 'black',
-double => 1,
-label => 1 );
my $track = $panel->add_track( -glyph => 'graded_segment
+s',
-label => 1,
-connector => 'dashed',
-bgcolor => 'blue',
-font2color => 'red',
-sort_order => 'high_score',
-description => sub { my $featu
+re = shift;
return un
+less $feature->has_tag('description');
my ($desc
+ription) = $feature->each_tag_value('description');
my $score
+ = $feature->score;
"$descrip
+tion, score=$score"; } );
while (my $hit = $result->next_hit) {
my $hitname = $hit->name;
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);
}
open my $blast, '>', 'sumting.png' or die "Failed to create su
+mting.png\n";
print $blast $panel->png;
close $blast or die "Failed to close $blast\n";
#}
}
Then the script works just fine, however it only generates 1 png of the first hit in the blastoutput file |