Re: running VMD from a script?

From: Nicolas Sapay (n.sapay_at_ibcp.fr)
Date: Mon Mar 21 2005 - 02:29:34 CST

Dear Sam,
the easiest way is probably a shell script "run_vmd.sh" looking like
this:
--------------------
#! /bin/sh

tmpdir=`mktemp -d /tmp/nsapay_vmd_XXXXXX` || exit 1
pdbstart="$HOME/namd_projects/vmd_script/afile.pdb"
psffile="$HOME/namd_projects/vmd_script/afile.psf"
dcdfile="$HOME/namd_projects/vmd_script/afile.dcd"
vmdinput="$HOME/namd_projects/vmd_script/vmd.in"

echo "initial PDB structure .... $pdbstart"
echo "VMD script ............... $vmdin"
echo "output directory ......... $outdir"
echo "tmp directory ............ $tmpdir"

/usr/bin/vmd/vmd -dispdev none -e $vmdin -pdb $pdbstart -psf $psffile
-args $tmpdir

cp -f $tmpdir/* $outdir
rm -f $tmpdir/*
rmdir $tmpdir
---------------------------
You can get the value of tmpdir in you vmd script using the argv list
(i.e. [lindex $::argv 0]). You can also put in argv all additional
values that
are required in your script. Then, you can put your VMD commands in the
VMD input file and run the shell script, i.e. if you use a PBS server:
qsub -q batch -e vmd.e -o vmd.o -N VMD ./run_vmd.sh

if you want to run VMD several times, you can create a new shell script
"batch.sh" where you put the qsub command in a loop
--------
for ((i=1 ; i<10 ; i=$[i+1]))
do
       qsub -q batch -N vmdjob$i ./run_vmd$i.sh
done
--------

Then, you just have to run batch.sh to submit your jobs

Le lun 21/03/2005 ŕ 01:22, Samuel Flores a écrit :

    Howdy all,
    
    Many thanks for the multiple responses I received about the tutorial files!
    I have completed the tutorial, for which I am most grateful.
    
    I'm wondering -- is it possible to run VMD commands from a shell script? Of
    course, there exist tcl scripts, which can be run inside VMD with a few
    mouse clicks, or perhaps by typing a command into the vmd console. But I'd
    like to not have to do anything at all interactively, since I have batch
    jobs that will have to be run 100 times with slight variations.
    
    Any help will be much appreciated!
    
    Sam
    
    

_ Nicolas Sapay ________________________ PhD student _

IBCP - Institut de Biologie et Chimie des Protéines
Pôle BioInformatique Lyonnais - Gerland
>> 7, Passage du Vercors
69367 Lyon cedex 07, France
>> Tel : (33) (0)4 72 72 26 46
>> Fax : (33) (0)4 72 72 26 04

____________________________________ n.sapay_at_ibcp.fr _

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:39:16 CST