[MMTK] PDB to VRML

khinsen at cea.fr khinsen at cea.fr
Mon Aug 22 11:49:48 CEST 2005


On Aug 19, 2005, at 19:23, mohammed ibrahim wrote:

> hi,
> i want to construct a vrml file  for a structure of a pdb file
> thanks

Try this (untested!):

from MMTK import *
from MMTK.PDB import PDBConfiguration
from MMTK.ConfigIO import OutputFile

conf = PDBConfiguration(pdb_file)
universe = InfiniteUniverse()
universe.addObject(conf.createAll())

out = OutputFile('scene.wrl', 'vrml.wireframe')
out.write(universe)
out.close()


You can also try vrml.ball_and_stick, vrml.charge (wireframe with atoms 
coloured according to their charge).

Konrad.
--
---------------------------------------------------------------------
Konrad Hinsen
Laboratoire Léon Brillouin, CEA Saclay,
91191 Gif-sur-Yvette Cedex, France
Tel.: +33-1 69 08 79 25
Fax: +33-1 69 08 82 61
E-Mail: khinsen at cea.fr
---------------------------------------------------------------------




More information about the mmtk mailing list