From: Olaf Lenz (olenz_at_icp.uni-stuttgart.de)
Date: Tue Jun 18 2013 - 01:55:17 CDT

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

On 06/14/2013 06:01 AM, Solen wrote:
> I want to visualize atomic structures in a way that I can show how
> radii of the different particles vary. My coordinate file has a
> fourth dimension for the radius of the particles. Is this possible
> with VMD? and how?

I believe I do have a solution for you, which still needs some lengthy
explanation.

To be able to solve your problem (and more), I have developed an
extension to the VTF format
(https://github.com/olenz/vtfplugin/wiki/VTF-format). The VTF format is
a format that I have developed with applications like yours in mind. It
is a textual format that is very simple to produce. In fact, your
"xyzr"-coordinate file can already be interpreted as VTF.

Unfortunately, the most recent VTF reader plugin that can help you is
not in VMD 1.9.1 yet. I have already submitted the updated code to the
VMD devels, and I hope it will be included in VMD 1.9.2, which is
intended to be released pretty soon (?). So it will be simple as soon as
VMD 1.9.2 is out, before that you will have to compile the VTF reader
plugin yourself. All code can be found here:

  https://github.com/olenz/vtfplugin

To be able to use it, you have to compile the vtfplugin and load it into
VMD. The usage is not exactly simple, but it gives you quite some power
once you have understood it. The idea is as follows:
1. The VTF format is extensible, i.e. a user can put arbitrary user data
into the file without breaking the format. In particular, you can add
arbitrary data after the coordinates, which I call "user data". In your
case this would be the radius, others would be the dipole moment, or any
other data that a user can think of.
2. The VTF reader plugin reads all data that VMD can use directly from
the file.
3. Furthermore, the Tcl-plugin "vtftools" provides a function that can
be used to load all user data from the file into Tcl variables.
4. Once this is done, you can use Tcl scripting and traces to visualize
the user data, e.g. you can set up a trace that updates the radii of all
atoms when you change the frame. You can find my example for atoms with
arbitrary radii in the files samples/userdata/radius.* in the above
repository. To run it, execute

  vmd -e radius.vmd

The file radius.vtf is a VTF file that has the radii of the atoms in the
 extra column. radius.vmd defines a function "sample_load" that loads
the VTF file into VMD and the userdata into Tcl variables and sets up a
trace that automatically changes the radii when the frame is changed.

I'm afraid this is not exactly trivial to understand, but I think that
it should actually solve your problem. If you need further help, contact
me!

Olaf
- --
Dr. rer. nat. Olaf Lenz
Institut für Computerphysik, Allmandring 3, D-70569 Stuttgart
Phone: +49-711-685-63607
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlHABFUACgkQtQ3riQ3oo/pMFACgg1Vajks39CbfB8Sa7o1TVmjT
+6IAn0ibljLptDrdMxlOvbOLOUkWOIch
=UxkC
-----END PGP SIGNATURE-----