From: Axel Kohlmeyer (axel.kohlmeyer_at_theochem.ruhr-uni-bochum.de)
Date: Sat Apr 23 2005 - 06:22:25 CDT

On Fri, 22 Apr 2005, John Stone wrote:

JS>
JS> Hi,
JS> You can do various tricks with the .vmdrc file by having your script
JS> detect when you load a new structure file and setup the default behavior
JS> according to your preferences. You could add your atom radii settings
JS> into a your own variant of the "default visualization" script that
JS> Axel Kohlmeyer has in his VMD tutorial:
JS> http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/cpmd-vmd/part7.html#chap9_sect2

yep. i had not had the time to update the pages recently,
but since changing the default radii was asked for repeatedly
i already had an example sitting on my machine. here it is.

enjoy,
        axel.

###########################
# example to change the default VDW radii
# function to apply the radii on loading a structure
proc my_set_def_vdw {args} {
  lassign $args fname molid
# define list of selections and matching radii
  set my_def_vdw {
    {name H } { 1.0 } \
    {name C } { 1.5 } \
    {name N } { 1.4 } \
    {name O } { 1.3 } \
    {name F } { 1.2 } \
    {name P } { 2.0 } \
    {name S } { 1.9 } \
    {name Cl} { 2.5 } \
  }
  foreach {selstr rad} $my_def_vdw {
     set my_sel [atomselect $molid "$selstr"]
     $my_sel set radius $rad
     $my_sel delete
  }
}
# hook up the function.
trace variable vmd_initialize_structure(0) w my_set_def_vdw
trace variable vmd_initialize_structure(1) w my_set_def_vdw
trace variable vmd_initialize_structure(2) w my_set_def_vdw

JS>
JS> John
JS>
JS> On Thu, Apr 21, 2005 at 04:04:39PM -0400, Kurt Smith wrote:
JS> > Thank you. that seems to work. I am wondering if it is possible
JS> > to do this through the .vmdrc file. For example, I would
JS> > like to set the defaults such that the "types" coloring method
JS> > is used, type C atoms are drawn as lines,
JS> > type O atoms are drawn as VDW spheres, and the atom radius is
JS> > set to 1. Is it possible to make this the default?
JS> > Thanks,
JS> >
JS> > Kurt
JS> >
JS> > On Wed, 20 Apr 2005, John Stone wrote:
JS> >
JS> > >
JS> > > Kurt,
JS> > > VMD guesses the atoms' VDW radii based on the atom string
JS> > > names if they weren't included in the file(s) you loaded
JS> > > the structure from. Depending on what the atoms are that
JS> > > you're simulating, the radii vary from 1.0 to 1.9. You can
JS> > > set the atom radius for atoms with a given name with a
JS> > > sequence of command like these:
JS> > > set sel [atomselect top "name H"]
JS> > > $sel set radius 1.0
JS> > > $sel delete
JS> > >
JS> > > John Stone
JS> > > vmd_at_ks.uiuc.edu
JS> > >
JS> > >
JS> > > On Wed, Apr 20, 2005 at 06:18:45PM -0400, Kurt Smith wrote:
JS> > > > I'm using VMD to visualize MD simulations
JS> > > > done in LJ units. My question is, how can
JS> > > > I properly control atom sizes? For instance
JS> > > > using VDW spheres, if I place one atom
JS> > > > at (0,0,0) and another at (1,0,0) I cannot
JS> > > > get the 2 spheres to exactly touch by
JS> > > > setting the sphere scale to 0.5, to 1, or to
JS> > > > any other value. Do I need to modify something?
JS> > > > Thanks
JS> > > >
JS> > > > Kurt
JS> > >
JS> > > --
JS> > > NIH Resource for Macromolecular Modeling and Bioinformatics
JS> > > Beckman Institute for Advanced Science and Technology
JS> > > University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
JS> > > Email: johns_at_ks.uiuc.edu Phone: 217-244-3349
JS> > > WWW: http://www.ks.uiuc.edu/~johns/ Fax: 217-244-6078
JS> > >
JS>
JS>

-- 
=======================================================================
Dr. Axel Kohlmeyer   e-mail: axel.kohlmeyer_at_theochem.ruhr-uni-bochum.de
Lehrstuhl fuer Theoretische Chemie          Phone: ++49 (0)234/32-26673
Ruhr-Universitaet Bochum - NC 03/53         Fax:   ++49 (0)234/32-14045
D-44780 Bochum  http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.