From: Matteo Guglielmi (
Date: Tue Oct 09 2007 - 07:02:34 CDT

Dear All,

recently I did try to rotate a protein fully
solvated by water molecules using the 'pcb'
plugin and the following simple script:

# pdb file header:
# CRYST1 111.108 98.438 115.981 90.00 90.00 90.00
set sys [mol new RUN01.pdb]
set all [atomselect $sys all]
set com [measure center $all]
# 55.5484428406 49.2036247253 58.0394554138 ('set com...' outcome)
$all moveby [list -55.5484428406 -49.2036247253 -58.0394554138]
pbc set {111.108 98.438 115.981 90.00 90.00 90.00} -now
pbc box -center origin
set delta_deg 0.01
# rotate x by -15 deg
for {set x 0} {$x>-15} {set x [expr {$x - $delta_deg}]} {
$all move [transaxis x -$delta_deg]
pbc wrap -center origin
# rotate y by 40 deg
for {set x 0} {$x<40} {set x [expr {$x + $delta_deg}]} {
$all move [transaxis y $delta_deg]
pbc wrap -center origin
# rotate z by -55 deg
for {set x 0} {$x>-55} {set x [expr {$x - $delta_deg}]} {
$all move [transaxis z -$delta_deg]
pbc wrap -center origin
$all writepdb rotated.pdb

.... well, the pbc box was correctly placed
on top of the simulation box (volume) but
the resulting 'rotated.pdb' was not good at
all (water molecules close to the box edges
got wrongly placed in the 'rotated.pdb' file)

To see the weird effect just try the script with
a simple water box.

Do you know any better way to rotate a box
with the pbc plugin?