Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added more output options

There are now -data and -fh options in addition to the -file parameter
passed to draw_logo. This allows for the rendered image data to be
placed in an already opened file handle or into a reference to a scalar.
  • Loading branch information...
commit 3a81c07279c73dd2cd3362f0b83a7b62a52e0cf7 1 parent 6d98439
@neomorphic neomorphic authored
Showing with 27 additions and 3 deletions.
  1. +14 −2 HMM/Alignment.pm
  2. +13 −1 HMM/Profile.pm
View
16 HMM/Alignment.pm
@@ -589,9 +589,21 @@ sub draw_logo {
# y2 => $middleMargin+5,
# aa => 0);
}
-
+
# Finally, draw the logo
- return $i->write(file=>$args{'-file'});
+ if ($args{'-file'}) {
+ $i->write(type=>'png', file=>$args{'-file'});
+ }
+ elsif ($args{'-fh'}) {
+ $i->write(type=>'png', fh=>$args{'-file'});
+ }
+ elsif ($args{'-data'}) {
+ $i->write(type=>'png', data=>$args{'-data'});
+ }
+ else {
+ warn __PACKAGE__." WARN No data output handle passed!\n";
+ return;
+ }
}
=head2 toPRC
View
14 HMM/Profile.pm
@@ -554,7 +554,19 @@ sub draw_logo {
$isMatch = 0;
}
}
- $i->write(file=>$args{'-file'});
+ if ($args{'-file'}) {
+ $i->write(type=>'png', file=>$args{'-file'});
+ }
+ elsif ($args{'-fh'}) {
+ $i->write(type=>'png', fh=>$args{'-file'});
+ }
+ elsif ($args{'-data'}) {
+ $i->write(type=>'png', data=>$args{'-data'});
+ }
+ else {
+ warn __PACKAGE__." WARN No data output handle passed!\n";
+ return;
+ }
return 1;
}
Please sign in to comment.
Something went wrong with that request. Please try again.