From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Thu Feb 01 2007 - 15:55:30 CST

On Thu, 1 Feb 2007 politr_at_huji.ac.il wrote:

XX> Dear VMD users and developers,

dear regina,

XX> I'm interested to call my tcl script from perl when I want to transfer
XX> some arguments to tcl. How can I do it?
XX> Let say I want to transfer name of the file and in tcl script I want to
XX> open this file for writing. Does anybody knows how to do it?
XX> In the code attached I have also sent psf and dcd name and it is working
XX> but when I'm trying to send an addition argument (name) it doesn't work
XX> as well as as I can't use argument to open file for writing. All the red
XX> part is not working. I hope somebody can hep me. Thank you very much.

red??
 
i'm reading mail in plain text (as it is meant to be),
so it is only black on grey for me. ;-).

XX> Regina
XX>
XX> set psf [lindex $argv 0]
XX> set dcd [lindex $argv 1]
XX> set psf_filename $psf
XX> set dcd_filename $dcd
XX> mol load psf $psf_filename
XX> animate read dcd $dcd_filename waitfor all
XX> set peptide [atomselect top protein]
XX>
XX> set name [lindex $argv 2]
XX> set pdb_peptide /usr/people/$name
XX> animate write pdb $pdb_peptide beg 0 end $final_frame waitfor all sel
XX> $peptide
XX>
XX> set sasa_file_name [lindex $argv 3]
XX> set sasa_file [open /usr/people/$sasa_file_name w]
XX>
XX> from perl:
XX> $sasa_file_name> output.log

please check the mailing list archive. e.g.,
http://www.ks.uiuc.edu/Research/vmd/mailing_list/vmd-l/5438.html

you want do do:
vmd -dispdev text -eofexit -e my.tcl -args $psf_name $dcd_name $name

cheers,
   axel.

XX>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.