Personal tools
Document Actions

Overview

by Sargis Dallakyan last modified 2011-07-07 10:01
The Python Molecule Viewer (PMV) has been developed on top of the following independent and re-usable packages MolKit, DejaVu and ViewerFramework . This viewer has most of the features usually expected in a molecule viewer:
  • stick and cpk representation
  • different coloring schemes (by atom, by residue type, by chain, by molecule, by propreties, etc...)
  • measuring tools
  • atom identification by picking
  • support for multiple molecules
  • secondary structure representation
  • user definable sets of atoms, residues, chains and molecules etc....

basic features
click to see bigger image...
advanced features
click to see bigger image...

In addition to these traditional features it is dynamically extensible, i.e. new commands can be developed independently and placed in libraries. The Viewer inherits from the ViewerFramework the capability to dynamically import these commands as needed. In fact, all commands in that viewer have been developed based on this principle. This provides a way to add features to the application that is incremental and well suited for team development. In addition this approach avoids the "feature overload" problem, i.e overloaded menus cluttered with commands that are irrelevant for the problem at hands.

load dynamically commands and modules
click to see bigger image...
Load commands or modules dynamically in the viewer

Customization files allow, among other things, to specify which commands should be loaded when the application starts. This allows to define a number of molecular viewing applications just by creating different customization files, each loading different sets of commands.

from MolKit.protein import Protein, Chain, Residue 
from MolKit.molecule import Molecule, Atom, AtomSet
loadCommand('fileCommands','readPDB','Pmv')
loadCommand('displayCommands','lines','Pmv')
loadModule('selectionCommands','Pmv')
loadModule('secondaryStructureCommands','Pmv')
self.readPDB("/tsri/pdb/struct/4phv.pdb"

We have written a surface calculation command and one to selectively display pieces of a surface corresponding to a sub set of atoms. In fact in this viewer all geometries relate to the underlying molecules, therefore a subset of atoms can be used to: partially displayed/ undisplay;selectively labeled; locally colored using different schemes; any of the geometries. And vice-versa, picking done on any geometry (molecule, surface, secondary structure) is mapped back onto the molecule.

python shell
click to see bigger image...
This application also provides a Python Shell.

This Python aware, typein widget, is the standard input and standard output of the python interpreter running the application. From the Python Shell, any command can be called interactively and scripts operating on the application can be written. Commands log themselves into a file as they are executed. This file can be saved, edited and played back to restore a previous session.

This application runs unmodified on any platform that has a Python interpreter with the following extensions:
Numeric, Tkinter/Togl and OpenGL.
Maybe the most interesting feature of this application is that creating the application actually comes down to write the commands, and writing commands is made easy by the built-in support provided by the ViewerFramework.

Reference

Michel F. Sanner. Python: A Programming Language for Software Integration and Development. J. Mol. Graphics Mod., 1999, Vol 17, February. pp57-61.
Full paper 326kB

Tutorial

Python Molecular Viewer by Ruth Huey, Sargis Dallakyan and Michel Sanner. 5.1MB
Related content

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: