[Bioperl-l] suggestion for drawing pedigrees
Jason Stajich
jason at cgt.duhs.duke.edu
Sat Nov 8 19:15:21 EST 2003
Assuming this code works (which I've not really touched in quite a while
so other changes might have broken things):
my $draw = new Bio::Pedigree::Draw();
$draw->draw(-pedigree => $pedigree,
-rendertype => 'pedplot',
-file => ">$outfile",
-format => 'png');
Then the following code will put image data into a scalar instead of a
new file.
my $fh = new IO::String;
$draw->draw(-pedigree => $pedigree,
-rendertype => 'pedplot',
-fh => $fh,
-format => 'png');
Image is now in $fh->string_ref;
Although if you are doing this for CGI you will probably be just writing
to STDOUT so -fh => \*STDOUT would work.
As for the imagemapping stuff - that is well beyond the current
capabilities, mostly because I don't know anything about how to generate
imagemaps + GD. But since this is open-source code you are encouraged to
work on that and add it back to the project.
An as for the general behavior of those modules - it probably needs some
time and energy, I designed and wrote that code when I was a perl OO
neophyte and tried to clean it up later so it has some cruft that can be
refactored. My idea would be to see the graphics layer futher abstracted
so the postscript or GD level could also be replaced with Todd's new SVG
modules as well.
Work on this is pretty low on my priority list however so if you really
want these type of improvements it would be good to try and contribute
some work yourself.
-jason
On Fri, 7 Nov 2003, Lowell Umayam wrote:
> It would be nice if there was a function that returned an array or hash
> of an imagemapping of a all the individuals in the pedigree. This can
> allow people to display these pedigrees in a cgi script and have the
> image link to other pages.
>
> Lowell
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu
More information about the Bioperl-l
mailing list