From: Eduard Schreiner (eduard.schreiner_at_theochem.ruhr-uni-bochum.de)
Date: Thu Mar 03 2005 - 06:16:58 CST

Stef wrote:
> Le mercredi 02 mars 2005 à 12:18 +0100, Eduard Schreiner a écrit :
>
>>Stef wrote:
>>
>>>Over a trajectory, i'd like to pick up snapshot containing certain
>>>particularities (for instance distance < cutoff, ...).
>>>
>>>I'd like to display the 'sub-trajectory' and also to be able to keep the
>>>trace of snapshot number (for instance i'd like to see from the whole
>>>trajectory all snapshots containing dist1 <4.0 angstroems AND dihedral
>
>
>>if i understood You correctly, You have a trajectory where only steps
>>should be displayed having some specific features whereas the others
>>should be removed. Additionally You want to know the the correct
>>(original) time step. Right?
>
>
> The best thing would be to generate a sub-trajectory from the original
> one (and have a way to link frame 1 of sub-trajectory to fram <x> of the
> original one).
>
>
>>You could try the following:
>> One could go through the trajectory checking whether the current time
>>step contains atoms in the specified selection.This one could check by
>
>
> Something missing here ?

Not really, I forgot to remove that part of the sentence. Ignore it.
>
>
>>If a given step matches one writes its number in one array (the name of
>>the array is, say, OK) if not in an other.
>>Something like:
>
>
> I've just adapted a little the script you sent me :
> label add Dihedrals 0/159 0/162 0/182 0/187
> set ts 0
> set OK 0
> foreach dihed [label graph Dihedrals 0] {
> incr ts
> if {$dihed < 75.0} {
> lappend OK $ts
> }
> }
>
> foreach i $OK {
> animate goto $i
> graphics text {x y z} "$i" [size s]
> }
>
> But when i launch it, i get :
> vmd > source prune_trajec.tcl
> invalid command name "size"
>
> Although on the website this command seems correct (and i've tried to
> change [size s] to anything without more luck).
> As described on the website :
>
> http://www.ks.uiuc.edu/Research/vmd/current/ug/node114.html
> The documentation is may be out-of-date or i'm not understanding it
> correctly.
>
>
>>I hope this will be useful for You.
>
>
> Thanks a lot for the help, you gave me useful directions !
>
>>Eduard Schreiner
>
>
> Stéphane Teletchéa

Hey,
are You launching this script as it is, or are You assigning some values
to x,y,z, and s in
"graphics text {x y z} "$i" [size s]"
?
Just one example for using "graphics text" (one writes here in molecule 0)
set i "hello world"
graphics 0 text {0.0 0.0 0.0} $i size 4
This command writes the string "hello world" at the position (0.0, 0.0,
0.0) in molecule 0 (one has to specify that) with text size 4 times the
default value.

Nevertheless a better to understand command is draw:
set i "hello world"
draw text {0.0 0.0 0.0} $i size 4

Additionally I just saw that one has of course also to delete the text
from the last frame.
Thus perhaps something like this:

set ts 0
set OK 0
foreach dihed [label graph Dihedrals 0] {
       incr ts
          if {$dihed < 75.0} {
              lappend OK $ts
        }
  }
set last 0
  foreach i $OK {
  animate goto $i
  draw delete $last
  set last [draw text {0.0 0.0 0.0} $i size 3]
  }

Eduard Schreiner

-- 
--
=======================================================================
Eduard Schreiner                        e-mail: eduard.schreiner_at_rub.de
Lehrstuhl fuer Theoretische Chemie          Phone: ++49 (0)234/32-22121
Ruhr-Universitaet Bochum - NC 03/52         Fax:   ++49 (0)234/32-14045
D-44780 Bochum                               http://www.theochem.rub.de
=======================================================================