[Bioperl-l] BioSVG [ Was ABI file parsing]

Malay boolda@yahoo.com
Thu, 2 May 2002 06:36:00 -0700 (PDT)


Hi Dr Stein:

> 
> Since Bio::Graphics already works very nicely
> hand-in-hand with
> BioPerl annotation objects and there is a web-based
> browser and other
> application software based on it, could I suggest
> that you have a look
> at creating a format-independent graphics layer that
> can be used by
> Bio::Graphics and your code to draw on top of either
> GD or SVG at the
> switch of a software toggle?
> 

Pastel is a format independent graphics layer that
just happens to generate SVG.

There is a quick way I can think of that can be done.
Replace all the GD call with Pastel call so that
Bio::Graphics generates SVG.

Here is the pseudocode

User file:

use Bio::Graphics::Chromatogram;
$ch =
Bio::Graphics::Chromatogram->new(width...height...etc);

$ch->set_trace(@a);


$ch->draw(-format=>SVG/PNG/PDF);

In Bio::Graphics::Chromatogram:

use Pastel;
use GD;

sub draw{
  if $param =~ /SVG/i draw_svg();
  if $param =~ /PNG/i draw_png();
}

   
draw_svg {
  ...
  $g = Pastel::Graphics->new();
  $g->draw_polyline(@a);
}

draw_png {
  $g = new GD...
  $g->draw....
}

What you do think?

-Malay
  



__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com