From: John Stone (johns_at_ks.uiuc.edu)
Date: Sun Apr 01 2007 - 23:03:24 CDT

Hi,
  The best thing to do when your script appears not to be running is to
add calls to 'puts' in there to print messages at various stages of the
script, along with any useful status information about internal variables
in the script so you can figure out what is happening. If your script
contains syntax errors, that would explain why it is not running and
you're presented with a text prompt. Have you scrolled the text console
back to see if you missed noticing some error messages from the embedded
Tcl interpreter?

  John Stone
  vmd_at_ks.uiuc.edu

On Sat, Mar 31, 2007 at 07:50:43PM -0500, Jianhui Tian wrote:
> Hi John,
>
> The "if" appear to be the same line of the "set psi" was just a written
> error for this email.
>
> When I run the script with "vmd -dispdev text -e calhbond.tcl", it stopped
> with "vmd>", seems to waiting for following commands. I cant figure out what
> bug there is. Thanks.
>
> Jianhui
>
>
> On 3/31/07, John Stone <johns_at_ks.uiuc.edu> wrote:
> >
> >Hi,
> >What error message do you get?
> >I suspect you might have a problem with the 'if' statement
> >that begins on the same line as the 'set psi' without any semicolon.
> >
> >Also, if you're running this for batch analysis, you're going to
> >need to replace the deprecated "mol load" command with the new
> >"mol new" and "mol addfile" commands, in order to guarantee that
> >the loading completes before your script commences trying to process
> >the data:
> >
> ># DON'T use 'mol load' anymore, it will be removed from a future VMD
> >release
> >mol load parm7 $parm dcd $dcdFile
> >
> ># Use these commands instead, they have long since replaced 'mol load'
> ># and are the only way to access various new features that did not exist
> ># in the old versions of VMD
> >mol new $parm type parm7 waitfor all
> >mol addfile $dcd type dcd waitfor all
> >
> >Cheers,
> >John Stone
> >vmd_at_ks.uiuc.edu
> >
> >On Fri, Mar 30, 2007 at 03:49:45PM -0400, Jianhui Tian wrote:
> >> Hi all,
> >>
> >> I write a tcl script to calculate the helix content of the peptide.
> >> But there is a small bug I can't find out myself to make it run
> >> properly. Can someone help? Thanks a lot.
> >>
> >> Jianhui
> >> ##########################
> >> set dcdFile n_aka3rm14w6_run10.dcd ;# name of your psf file
> >>
> >> set parm aka3rm14w6.prmtop ;# name of parm file
> >>
> >> set incrm 1
> >> ##########################
> >> mol load parm7 $parm dcd $dcdFile
> >>
> >> set num_steps [molinfo top get numframes]
> >> puts $num_steps
> >> set out [open helixcontent.dat w]
> >>
> >> for {set frme 1} {$frme <= $num_steps} {incr frme $incrm} {
> >> puts $frme
> >>
> >> set hlxflag 0
> >> set hlxcont 0
> >>
> >> ###### From resid 125 to 148 is amino acid.
> >> for {set i 125} {$i <= 148 } { incr i} {
> >> set atom [atomselect top "protein and name CA and resid $i"]
> >> $atom frame $frme
> >>
> >> set phi [$atom get phi]
> >> set psi [$atom get psi] if { $phi <= -30 && $phi >= -90
> >> && $psi <= -17 && $psi >= -77 } {
> >> if {$hlxflag == 0} {
> >> set num 1
> >> set hlxflag 1
> >> } elseif {$hlxflag == 1} {
> >> set num [expr $num + 1]
> >> }
> >> } else {
> >> if {$hlxflag == 1} {
> >> set hlxflag 0
> >> if { $num > 2 } { set hlxcont [expr $num - 2]
> >> }
> >> }
> >>
> >> $atom delete
> >> }
> >> set cont [expr $hlxcont / 24]
> >> puts $out "$frme $cont"
> >> }
> >> exit
> >
> >--
> >NIH Resource for Macromolecular Modeling and Bioinformatics
> >Beckman Institute for Advanced Science and Technology
> >University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> >Email: johns_at_ks.uiuc.edu Phone: 217-244-3349
> >WWW: http://www.ks.uiuc.edu/~johns/ Fax: 217-244-6078
> >

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