From: Vlad Cojocaru (Vlad.Cojocaru_at_eml-r.villa-bosch.de)
Date: Fri Oct 26 2007 - 07:39:58 CDT

Dear VMD users,

I need to transform the coordinates of my system in such a way that a
vecor v {vx vy vz} is brought to the x axis. The system is a cubic
periodic box with the vectors {a 0 0}, {0 b 0}, and {0 0 c}. When I
apply the transformations in the script below, the periodic box rotates
such as that the vectors are not valid anymore. Could somebody give an
advice on how to derive the new cell vectors for the transformed
coordinates ?

Thank you very much in advance,

Best wishes
vlad

--------VMD transformation script -------------
mol load parm7 a.top
mol addfile a_rst.coor type pdb
set all [atomselect top "all"]
set sel1 [atomselect top "resid 230"]
set center_sel1 [measure center $sel1]
set sel2 [atomselect top "name CA and resid 76 192"]
set center_sel2 [measure center $sel2]
set smd_dir [vecnorm [vecsub $center_sel2 $center_sel1]]
puts "Direction of force is $smd_dir"
set tm1 [transvecinv "$smd_dir"]
$all move $tm
unset all
set all [atomselect top "all"]
set center [measure center $all]
set tm2 [trans origin "$center"]
$all move $rm2
$all writepdb a.pdb
quit

-- 
----------------------------------------------------------------------------
Dr. Vlad Cojocaru
EML Research gGmbH
Schloss-Wolfsbrunnenweg 33
69118 Heidelberg
Tel: ++49-6221-533266
Fax: ++49-6221-533298
e-mail:Vlad.Cojocaru[at]eml-r.villa-bosch.de
http://projects.villa-bosch.de/mcm/people/cojocaru/
----------------------------------------------------------------------------
EML Research gGmbH
Amtgericht Mannheim / HRB 337446
Managing Partner: Dr. h.c. Klaus Tschira
Scientific and Managing Director: Prof. Dr.-Ing. Andreas Reuter
http://www.eml-r.org
----------------------------------------------------------------------------