From: John Stone (johns_at_ks.uiuc.edu)
Date: Tue Sep 13 2011 - 13:52:43 CDT

Hi,
  You should add "waitfor all" to the end of the "mol new" command.
That's a significant potential cause of your problem.

Cheers,
  John Stone

On Tue, Sep 13, 2011 at 06:06:10PM +0100, dwds gerge wrote:
>
> Hi,
> I have a little script attached that is supposed to simply load and render a molecule. 
> However,
>
> if the script below is copied and pasted into the VMD terminal, the cartoon representation of all protein residues changes to 'turn'. If the script is called from the command line using vmd -e script.vmd, it will work as expected.
> If a for loop is build around the script, that is, if the the first line of the script is replaced by the following and if a closing bracket is appended at the last line,
> foreach molecule [glob *.pdb] {...}
> then all protein residues will be shown as 'turn' again, loosing secondary structure.
>
> This is the script:
> set molecule 1.pdb
> mol new $moleculerotate x by -90rotate y by 135scale by 1.7translate by 0 -0.3 0
> # representation of moleculemol modstyle 0 top Cartoon 2.100000 12.000000 5.000000mol modcolor 0 top ColorID 2mol modmaterial 0 top Transparentmol modselect 0 top chain A and not resid 121mol addrep topmol modselect 1 top chain B and not resid 121mol modstyle 1 top Cartoon 2.100000 12.000000 5.000000mol modcolor 1 top ColorID 2mol modmaterial 1 top Transparentmol addrep topmol modselect 2 top chain C and not resid 121mol modstyle 2 top Cartoon 2.100000 12.000000 5.000000mol modcolor 2 top ColorID 2mol modmaterial 2 top Transparentmol addrep topmol modselect 3 top chain D and not resid 121mol modstyle 3 top Cartoon 2.100000 12.000000 5.000000mol modcolor 3 top ColorID 2mol modmaterial 3 top Transparentmol showrep top 0 0
> # rendering of moleculesource [file rootname $molecule].vmd
> set sel [atomselect top {resid 121}]$sel set structure turn
> set sel [atomselect top {resid 248 to 251}]$sel set structure turn
> render TachyonInternal [file rootname $molecule].tga
> # empty memory and start over with next moleculemol delete top
>
> I'm using VMD1.9 on MacOSX 10.6.8. Is there are workaround?
>
> Best,
> Matthias

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
http://www.ks.uiuc.edu/~johns/           Phone: 217-244-3349
http://www.ks.uiuc.edu/Research/vmd/       Fax: 217-244-6078