[Bioperl-l] identifying objects in Bio::Graphics SVG

Crabtree, Jonathan crabtree at tigr.org
Fri Aug 6 14:20:07 EDT 2004

Hi Steve-

I looked into this briefly and I'm pretty sure that the answer is "no".
The way that the Bio::Graphics module generates SVG output is by using
GD::SVG, which is more or less a drop-in replacement for GD.  Since the
GD API doesn't require (or permit, AFAIK) the association of logical
identifiers with graphics primitives (e.g., these four lines are part of
exon #1234), this information isn't included in the GD API calls and
therefore isn't available to GD::SVG.  So even if GD::SVG wanted to
group the various elements within an SVG <g>roup, it doesn't have any
way of gleaning the necessary information without going beyond the GD

Now of course this isn't to say that it wouldn't be possible to
implement this type of functionality, but it would require making
Bio::Graphics somewhat more SVG-aware than it is now, and would probably
entail delving into the workings of GD::SVG a little bit.  I can also
imagine taking a somewhat heavyweight approach that would be relatively
inefficient but might be easier to implement.  One could conceivably
make a fresh GD::SVG object for each glyph to be rendered, and then add
some code to Bio::Graphics to strip out the essential SVG rendered by
each glyph, wrap it in a <g> element, and place it into a dummy
top-level GD::SVG object that serves only to collect the text of the SVG
document.  I don't know...at some point it's going to be easier to just
go ahead and add direct SVG support into Bio::Graphics.


p.s. Re-reading your original message, it might be possible to do
something using the bounding box of the feature of interest (which can
be obtained from the Bio::Graphics panel) to search through the SVG text
for the relevant section.  It would be messy, though, and rather

> -----Original Message-----
> From: bioperl-l-bounces at portal.open-bio.org 
> [mailto:bioperl-l-bounces at portal.open-bio.org] On Behalf Of 
> Roels, Steven
> Sent: Friday, August 06, 2004 1:49 PM
> To: bioperl-l at bioperl.org
> Subject: [Bioperl-l] identifying objects in Bio::Graphics SVG
> Hello,
> I'd like to take the nice SVG output I can generate with the 
> Bio::Graphics modules, and add javascript to (for example) 
> alter/hide elements based on a slider or other user-controlled input.
> Is there a way to map various panel items to the resulting 
> svg components?
> e.g transcript3, exon4 == <rect id="3633-9-510">
> Given that the "<g>" grouping element doesn't seem to be used 
> (which would facilitate this for non-simple elements), I'm 
> guessing not, but thought I would ask.
> Thanks,
> -Steve
> *****************************************************************
> Steve Roels, Ph.D.                       
> Senior Scientist I
> Computational Biology     
> Millennium Pharmaceuticals, Inc.   Phone: 617.761.6820
> 640 Memorial Drive                 FAX:   617.577.3555
> Cambridge, MA 02139-4815           Email: steven.roels at mpi.com
> *****************************************************************
> This e-mail, including any attachments, is a confidential 
> business communication, and may contain information that is 
> confidential, proprietary and/or privileged.  This e-mail is 
> intended only for the individual(s) to whom it is addressed, 
> and may not be saved, copied, printed, disclosed or used by 
> anyone else.  If you are not the(an) intended recipient, 
> please immediately delete this e-mail from your computer 
> system and notify the sender.  Thank you.
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org 
> http://portal.open-> bio.org/mailman/listinfo/bioperl-l

More information about the Bioperl-l mailing list