From: Jorgen Simonsen (
Date: Fri Jul 05 2013 - 11:25:55 CDT


I am trying to make a script that will display the center of mass of a
chosen residue in my simulation. I have run into some issues with the
tcl where I am not familiar with the syntax.

My first issues is that I would like to loop over all the frame in my

set numframes [molinfo 0 get numframes]
# Returns 1124 frames which is correct
# Loop over frames

for {set frame 0} {${frame} < ${numframes}} {incr frame} {

set ref [atomselect 0 "resname CFN" frame ${frame}]
set com_ref [measure center ${ref} weight mass]
puts $outfile "Frame $frame com $com_ref"

draw sphere $com_ref radius 0.5


My problem is that it only outputs 1104 frames and not 1124 as I would
expect it to do?