From: John Stone (johns_at_ks.uiuc.edu)
Date: Wed Jul 30 2008 - 10:31:50 CDT

Ignacio,
  The next version of VMD has multiple user fields, so you
shouldn't necessarily feel the need to use the dummy atom method just
to save the use of the user field for other things.

  John

On Wed, Jul 30, 2008 at 12:24:58AM -0700, Ignacio Fernández Galván wrote:
> --- On Wed, 23/7/08, Axel Kohlmeyer <akohlmey_at_cmm.chem.upenn.edu> wrote:
>
> > if you don't want to use the dummy atom option that i suggested,
> > and compute everything explicitly, you can use the "user" field
> > to store per-timestep information about each atom of your system.
> > this can not only be used to color code atoms but to do selections
> > (user > 0).
>
> Thank you all for your suggestions.
>
> I could have used the dummy atom, but can I add atoms to a molecule in VMD? and can I add them (easily) to a dcd file? Or can I use atoms in another molecule in a selection?
>
> I load an xyz file with my solute, and a dcd file with all the coordinates of solute + solvent molecules, and then align and wrap every frame of the dcd to fit the solute in the xyz file. Then I solved my problem with this script:
>
> # calculate the coordinates of the "dummy atoms" P1 and P2
> set V1 [expr [[atomselect 0 "index 0"] get {x y z}]]
> set V2 [expr [[atomselect 0 "index 1"] get {x y z}]]
> set V3 [expr [[atomselect 0 "index 2"] get {x y z}]]
> set V4 [expr [[atomselect 0 "index 3"] get {x y z}]]
> set V5 [expr [[atomselect 0 "index 4"] get {x y z}]]
> set V6 [expr [[atomselect 0 "index 5"] get {x y z}]]
> set Cen [vecscale [expr 1.0/6] [vecadd $V1 $V2 $V3 $V4 $V5 $V6]]
> set Per [vecnorm [veccross [vecsub $V3 $V1] [vecsub $V5 $V1]]]
> set P1 [vecadd $Cen [vecscale 3.5 $Per]]
> set P2 [vecsub $Cen [vecscale 3.5 $Per]]
>
> # set the user field with the distance to the "dummy atoms"
> set solv [atomselect 1 "all"]
> for {set i 0} {$i < $n} {incr i} {
> set dist {}
> $solv frame $i
> foreach pos [$solv get {x y z}] {
> set d1 [vecdist $P1 $pos]
> set d2 [vecdist $P2 $pos]
> if {$d1 < $d2} {lappend dist $d1} else {lappend dist $d2}
> unset d1 d2
> }
> $solv set user $dist
> unset dist
> }
>
> ... and then I can use the user field in representations and calculations.
>
>
> __________________________________________________________
> Not happy with your email address?.
> Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078