| 1 | package Bio::Phylo::Treedrawer::Gif; | ||
| 2 | use strict; | ||
| 3 | use Bio::Phylo::Util::Exceptions 'throw'; | ||
| 4 | use Bio::Phylo::Util::Dependency 'Bio::Phylo::Treedrawer::Png'; | ||
| 5 | use base 'Bio::Phylo::Treedrawer::Png'; | ||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | Bio::Phylo::Treedrawer::Gif - Graphics format writer used by treedrawer, no | ||
| 10 | serviceable parts inside | ||
| 11 | |||
| 12 | =head1 DESCRIPTION | ||
| 13 | |||
| 14 | This module creates a gif file from a Bio::Phylo::Forest::DrawTree | ||
| 15 | object. It is called by the L<Bio::Phylo::Treedrawer> object, so look there to | ||
| 16 | learn how to create tree drawings. | ||
| 17 | |||
| 18 | |||
| 19 | =begin comment | ||
| 20 | |||
| 21 | # only need to override finish to write to a different format | ||
| 22 | |||
| 23 | =end comment | ||
| 24 | |||
| 25 | =cut | ||
| 26 | |||
| 27 | sub _finish { | ||
| 28 | my $self = shift; | ||
| 29 | my $gif; | ||
| 30 | eval { $gif = $self->_downsample->gif }; | ||
| 31 | if ( not $@ ) { | ||
| 32 | return $gif; | ||
| 33 | } | ||
| 34 | else { | ||
| 35 | throw 'ExtensionError' => | ||
| 36 | "Can't create GIF, libgd probably not compiled with it: $@"; | ||
| 37 | } | ||
| 38 | } | ||
| 39 | |||
| 40 | =head1 SEE ALSO | ||
| 41 | |||
| 42 | There is a mailing list at L<https://groups.google.com/forum/#!forum/bio-phylo> | ||
| 43 | for any user or developer questions and discussions. | ||
| 44 | |||
| 45 | =over | ||
| 46 | |||
| 47 | =item L<Bio::Phylo::Treedrawer> | ||
| 48 | |||
| 49 | The gif treedrawer is called by the L<Bio::Phylo::Treedrawer> object. Look there | ||
| 50 | to learn how to create tree drawings. | ||
| 51 | |||
| 52 | =item L<Bio::Phylo::Manual> | ||
| 53 | |||
| 54 | Also see the manual: L<Bio::Phylo::Manual> and L<http://rutgervos.blogspot.com>. | ||
| 55 | |||
| 56 | =back | ||
| 57 | |||
| 58 | =head1 CITATION | ||
| 59 | |||
| 60 | If you use Bio::Phylo in published research, please cite it: | ||
| 61 | |||
| 62 | B<Rutger A Vos>, B<Jason Caravas>, B<Klaas Hartmann>, B<Mark A Jensen> | ||
| 63 | and B<Chase Miller>, 2011. Bio::Phylo - phyloinformatic analysis using Perl. | ||
| 64 | I<BMC Bioinformatics> B<12>:63. | ||
| 65 | L<http://dx.doi.org/10.1186/1471-2105-12-63> | ||
| 66 | |||
| 67 | =cut | ||
| 68 | |||
| 69 | 1; |