From: Mehdi Bagherpour (mehdi.bpour_at_gmail.com)
Date: Tue Feb 28 2017 - 13:22:23 CST

Dear VMD users,

I am trying to write the center of mass of residues in a separate .pdb file
(for all frames).
I have written this code but it does not work.
I get the error:
*atomselect: set: 3 data items doesn't match 24 selected atoms.*

0 to 181 are number of residues.

*set mol [molinfo top] *
*set nf [molinfo $mol get numframes] *
*############# *
*for {set i 0} {$i < $nf} {incr i} {*
*for {set x 0} {$x <= 181} {incr x} {*
*set selA [atomselect $mol "residue $x"]*
*#############*
*$selA frame $i*
*set com [measure center $selA weight mass] *
*$selA set {x y z} $com *
*$selA writepdb "com.pdb"*
*} *
*}*

Please let me know if you have any suggestion to this problem.

Cheers,
Mahdi