An extensive example

Konrad Hinsen hinsen@ibs.ibs.fr
Thu, 3 Jul 1997 19:20:39 +0200


In a few minutes I'll send a longish MMTK example for analysing
protein conformations. Thanks to Andrew Dalke for suggesting this
application! Two comments are necessary for those who want to
actually run the example:

1) Preparation: Get PDB entries 4q21 and 6q21 and put them into
   a PDB directory on the MMTK database path.

2) The visualization part requires an animation-capable viewer, which
   currently means VMD. If you don't have VMD, uncomment that line
   and run the rest. Even if you have VMD, you'll have a small problem
   because viewSequence() is not yet in MMTK 1.0b2 (it's a new function
   for MMTK 1.0b3). But it's a short and simple one, so you can add
   it for yourself. Add the following function at the end of the
   file Visualization.py, and add "from Visualization import viewSequence" 
   to mmtk.py. Here it comes:

def viewSequence(object, conf_list):
    tempfile.tempdir = tempdir
    file_list = []
    for conf in conf_list:
        file = tempfile.mktemp()
        file_list.append(file)
        object.writeToFile(file, conf, 'pdb')
    script = tempfile.mktemp()
    tempfile.tempdir = None
    file = open(script, 'w')
    file.write('mol load pdb ' + file_list[0] + '\n')
    for conf in file_list[1:]:
        file.write('animate read pdb ' + conf + '\n')
    file.write('animate style once\n')
    file.write('animate forward\n')
    for conf in file_list:
        file.write('file delete ' + conf + '\n')
    file.write('file delete ' + script + '\n')
    file.close()
    os.system(viewer['pdb'] + ' -nt -e ' + script + ' 1> /dev/null 2>&1')

Have fun with the example!

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                          | E-Mail: hinsen@ibs.ibs.fr
Laboratoire de Dynamique Moleculaire   | Tel.: +33-4.76.88.99.28
Institut de Biologie Structurale       | Fax:  +33-4.76.88.54.94
41, av. des Martyrs                    | Deutsch/Esperanto/English/
38027 Grenoble Cedex 1, France         | Nederlands/Francais
-------------------------------------------------------------------------------