From: Lena Simine (lena.simine_at_rice.edu)
Date: Sun Apr 24 2016 - 00:46:23 CDT

Hi,
Can't figure out how to prevent the added graphics or new
representations from "accumulating" in a trajectory.
I'd like to make a selection which differs in each frame and do
something to it, like add graphics or add a representation
for that selection in that frame alone.
Instead I end up with *all* of my graphics/representations on *all* frames..

Any clues how to fix this? (sorry, a total newb)

I'm doing something along the lines of this:
set n [ molinfo top get numframes ]
for {set i 0} {$i < $n} {incr i} {
     set sel_text [lindex $data2 $i]
     set sel2 [atomselect top "serial $sel_text"]
     $sel2 frame $i
     set xyz [$sel2 get {x y z}]
     set xyz2 [split {*}$xyz]
     graphics top sphere $xyz2 radius 4
}

or with representations

set n [ molinfo top get numframes ]
for {set i 0} {$i < $n} {incr i} {
     set sel_text [lindex $data2 $i]
     mol representation beads 1 68
     mol selection $sel_text frame $i
     mol material Transparent
     mol addrep top
}

Cheers,
Lena