PDB2VRML


NAME

PDB2VRML - PDB to VRML converter.


SYNOPSIS

  use PDB2VRML;

  $pdb = PDB2VRML->new();

  $pdb->readPDB( 'filename' );
  $pdb->centerAtom();
  $pdb->genBonds();
  $pdb->setStyle( 'BallAndStick' );
  $pdb->setColor( 'byAtom' );
  $pdb->printVRML();


DESCRIPTION

The PDB2VRML class allows the creation of objects which can read molecular structures stored in the PDB format. It actually reads ATOM, HETATM, and CONECT records. The object can create additional bonds based on a minimum distance criteria. The final goal is to write a representation of the molecular structure in the VRML format.


FUNCTIONS

new()
Creates a new and empty converter object.

  $pdb1 = PDB2VRML->new();
  $pdb2 = $pdb1->new();

readPDB()
Reads all atoms and connects from the given PDB file. The subroutine returns 'undef' on error. Currently only the ATOM, HETATM, and CONECT records are read.

  $pdb->readPDB( 'fileName' );

printVRML()
Prints the molecular structure in the current style in the VRML format on <stdout>.

  $pdb->printVRML();

centerAtoms()
Shift the molecules center of geometry into the origin of the coordinate system.

  $pdb->centerAtoms();

genBonds()
Create additional bonds between the atoms. A maximum distance for the 2 atom types of a potentially connected atom pair is computed. If the actual distance is shorter, a new bond is created. The algorithm applied distributes the atoms over a 3D grid. Therefore, the order of the generated bonds is not very deterministic.

  $pdb->genBonds();

setStyle()
Sets the style for the VRML representation of the molecular structure. Default is 'Wireframe'. Currently supported styles are:

        Wireframe, BallAndWire,
        Stick, BallAndStick,
        CPK

  $pdb->setStyle( 'Wireframe' );

setColor()
Set the overall color of the molecular structure. If the color is set to 'byAtom', the color the for atoms and bonds is defined by the atom type. Default is 'byAtom'. Currently supported colors are:

        byAtom,
        yellow, blue, red,
        green, white, brown,
        grey, purple

  $pdb->setColor( 'blue' );

setStickRadius()
Defines the radius in Angstrom for the cylinders in the 'Stick' and 'BallAndStick' style. Default is 0.15 .

  $pdb->setStickRadius( 0.15 );

setBallRadius()
Defines the factor which is multiplied with the VDW radius for the spheres in the 'BallAndWire' and 'BallAndStick' style. Default is 0.2 .

  $pdb->setBallRadius( 0.2 );

setCompression()
Turns on/off compression of the output. If turned on, all leading whitespaces are removed. This produces a less readable but approx. 20% smaller output, the speed is increased by 10% as well.

   $pdb->setCompression( 1 );


AUTHOR

Horst Vollhardt, horstv@yahoo.com


COPYRIGHT

Copyright (c) 1998 by Horst Vollhardt. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


SOURCES

The most recent version can be found at:

  http://reality.sgi.com/horstv_basel/pdb2vrml/


SEE ALSO

See http://www.vrml.org/ for a description of the VRML format.