From: Pawel Siuda (siuda.pawel_at_gmail.com)
Date: Thu Dec 13 2012 - 04:48:58 CST

Hello everyone,

I would really appreciate if someone would be able to help me to find a way
to ascribe time-varying atom descriptors to user field.

I was trying to use beta field of pdb file to do so. In script library
there is a pdbbfactor.tcl script, which is supposed to do the job, but is
not working (user values are not being changed). I was also trying to write
a script on my own, but as I am kind of new to Tcl, there is still sth
wrong with it. I would really appreciate if any of you could help me out.

Regards,
PaweĊ‚

here is my code:
display projection orthographic

set dane [open "hyd.pdb" r]
set numframes [molinfo top get numframes]
set sel [atomselect top "all"]
for {set i 0} {$i<$numframes} {incr i} {

  $sel frame $i
  gets $dane
  gets $dane
  gets $dane
  gets $dane
  gets $dane
  for {set j 0} {$j < 15875} {incr j} {
  gets $dane war
  set lst [split $war " "]
  set k [llength $lst]
  set l [expr {$k - 1}]
  set z "[lindex $lst $l]"
  $sel set user $z
  }
  gets $dane
  gets $dane
  $sel frame $i
}
$sel delete

mol representation VDW 20.500000 40.000000
mol color Name
mol material Opaque
mol selection {user >= 4}
mol addrep top
set molid 0
set n [molinfo $molid get numreps]
for {set i 0} {$i < $n} {incr i} {
    mol selupdate $i $molid on
}
animate goto start