Re: VMD scripting

From: JC Gumbart (gumbart_at_ks.uiuc.edu)
Date: Thu Oct 06 2005 - 14:39:51 CDT

vmdtext is just an alias that we use in the tutorials to streamline
some things.

While you can of course run it from the tkcon in vmd (source split.s),
what you want is "vmd -dispdev text -e split.s ".

On Oct 6, 2005, at 2:33 PM, Shirley Li wrote:

> Dear all,
>
>  
>
> I have a question about VMD scripting. 
>
>  
>
> I have created the script file using a text editor such as "vi", and
> save it, such as the one attached below.  How can I execute it?  I
> tried "vmdtext -e split.s" but got a error message "vmdtext: command
> not found".  Do I need to lounch VMD in order to run this script?
>
>  
>
> Your help/information will be greatly appreciated.
>
>  
>
> Shirley
>
>  
>
>  
>
> -------------------------------------- split.s
> --------------------------------------------
>
>  
>
> # Split a file containing protein and water into separate segments.
>
> # Creates files named myfile_water.pdb, myfile_frag0.pdb,
> myfile_frag1.pdb,...
>
> # Requires VMD.
>
> mol load pdb myfile.pdb
>
> set water [atomselect top water]
>
> $water writepdb myfile_water.pdb
>
> set protein [atomselect top protein]
>
> set chains [lsort -unique [$protein get pfrag]]
>
> foreach chain $chains {
>
>   set sel [atomselect top "pfrag $chain"]
>
>   $sel writepdb myfile_frag${chain}.pdb
>
> }
>
> Yahoo! for Good
> Click here to donate to the Hurricane Katrina relief effort.

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