b_hall has asked for the wisdom of the Perl Monks concerning the following question:

Hi Everybody,

I'm interested in learning how to write and display SVG in perl to create a simple, lightweight molecule viewer similar to rasmol. The advantage to using SVG would be that (hopefully) I could create quick and effective 3D effects, as well as some other effects which are hard to achieve in available molecule viewers (such as textured or hand-sketched effects). However I am having difficulty finding a good resource on manipulating SVG images in perl and I was hoping that the monks could recommend a web resource or a text book to help me.

Thanks in advance

Ben

Update

Thanks for everybodys' advice so far. I reread my node and thought it would be worth clarifying what I think a molecule viewer would need to do. When first run it would open a window into which molecule representations would be drawn, and a simple shell. You would then enter commands to tell the program to read in a pdb file, make a selection of atoms and then draw them with one of a selection of draw types -eg van der waals spheres, balls and sticks, cartoon/ribbon representations etc. You can rotate the molecule by commands from the shell, and save the SVG file when you have a view/representation you are happy with. The key factors are the elements of interactivity and a display which updates.

Replies are listed 'Best First'.
Re: Lightweight Molecule Viewer with SVG
by marto (Cardinal) on Nov 21, 2005 at 15:36 UTC
Re: Lightweight Molecule Viewer with SVG
by planetscape (Chancellor) on Nov 21, 2005 at 16:17 UTC

    DeveloperWorks at IBM has many articles and tutorials on SVG. Just type SVG into the search box at the top of this page. :-)

    This article talks specifically about 3D representations.

    HTH,

    planetscape
Re: Lightweight Molecule Viewer with SVG
by marto (Cardinal) on Nov 22, 2005 at 09:53 UTC
    b_hall,

    As far as reading PDB files the Chemistry::File::PDB module looks like it would be of some use to you. Failing that search Cpan. Regeards the rest of the chemistry stuff, without spending time finding out exactly what it all means its over my head. You may find the article Building a 3D engine in Perl over at Perl.com useful:

    "This article is the first in a series aimed at building a full 3D engine. It could be the underlying technology for a video game, the visualization system for a scientific application, the walkthrough program for an architectural design suite, or whatever."

    Hope this helps.

    Martin
Re: Lightweight Molecule Viewer with SVG
by planetscape (Chancellor) on Aug 26, 2009 at 12:26 UTC

    Not a Perl solution for the OP, however, I just found VMD:

    VMD is a molecular visualization program for displaying, animating, and analyzing large biomolecular systems using 3-D graphics and built-in scripting. VMD supports computers running MacOS X, Unix, or Windows, is distributed free of charge, and includes source code.

    ... and it looks really interesting.

    HTH,

    planetscape