From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Tue May 22 2007 - 12:56:58 CDT

On Tue, 22 May 2007, Manali Joshi wrote:

MJ> Hello,

hello manali,

MJ> I have multiple pdb files of spheres with varying radii. Each file has around 500 spheres.
MJ> One way i have found to make vmd display them according to their radii is to load them all as one type of atom (example Carbon) and then write a script such as
MJ>
MJ> draw sphere { x y z } radius 1.01
MJ> draw sphere { xy z } radius 2.4
MJ> :
MJ> and so on, one line for each sphere.

actually you can set the radius as an atom property
using the selection mechanism.

MJ> However with multiple pdb files its getting too cumbersome to write
MJ> a script for each file. Is there a way i can make vmd read the radii
MJ> from the B factor/ occupancy column, by one command ?

you can use the selection mechanism for that as well.
if you put the following into a script and 'source' it
you'll have a new command beta_to_radius that will copy
the information in the way you desire.

proc beta_to_radius { {mol top} } {
    set sel [atomselect top all]
    $sel set radius [$sel get beta]
    $sel delete
    unset sel
}

now you can use:

beta_to_radius 2

to copy the beta field from a pdb file to radius
for molecule 2 (if you leave out the number it
should take the current top molecule).

hope that helps,
    axel.

MJ>
MJ> Thanks in advance for any help.
MJ>
MJ> Manali
MJ>
MJ>
MJ>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.